amq-cli

Coordinate agents via the AMQ CLI for file-based inter-agent messaging. Use when you need to send messages to another agent (Claude/Codex), receive messages from partner agents, set up co-op mode between Claude Code and Codex CLI, or manage agent-to-agent communication in any multi-agent workflow. Triggers include "message codex", "talk to claude", "collaborate with partner agent", "AMQ", "inter-agent messaging", "agent coordination". For spec/design tasks use the /spec command instead.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "amq-cli" with this command: npx skills add avivsinai/agent-message-queue/avivsinai-agent-message-queue-amq-cli

AMQ CLI Skill

File-based message queue for agent-to-agent coordination.

Prerequisites

Requires amq binary in PATH. Install:

curl -fsSL https://raw.githubusercontent.com/avivsinai/agent-message-queue/main/scripts/install.sh | bash

Environment Rules (IMPORTANT)

When running inside coop exec, the environment is already configured:

  • Always use amq from PATH — never ./amq, ../amq, or absolute paths
  • Never override AM_ROOT or AM_ME — they are set by coop exec
  • Never pass --root or --me flags — env vars handle routing
  • Just run commands as-is: amq send --to codex --body "hello"

When running outside coop exec (e.g. new conversation, manual terminal):

  • Use amq env to resolve the root — it reads .amqrc and returns the base root:
    eval "$(amq env --me claude)"          # sets AM_ME + AM_ROOT from .amqrc
    
  • Or resolve and pin explicitly per command (never hardcode the root — read it from .amqrc):
    AM_ME=claude AM_ROOT=$(amq env --json | jq -r .root) amq send --to codex --body "hello"
    
  • Do NOT append a session name (e.g. /collab) unless you intentionally want an isolated session. Outside coop exec, the base root from .amqrc is where agents live.
  • Pitfall: coop exec defaults to --session collab (i.e. .agent-mail/collab). If you manually use .agent-mail/collab outside coop exec, messages go to a different mailbox tree than .agent-mail. Only use a session path if the target agent is also in that session.

Root Resolution Truth-Table

ContextCommandAM_ROOT resolves to
Outside coop execamq env --me claudebase root from .amqrc (e.g. .agent-mail)
Outside coop exec, isolated sessionamq env --session auth --me claude.agent-mail/auth
Inside coop exec (no flags)automatic.agent-mail/collab (default session)
Inside coop exec --session Xautomatic.agent-mail/X

Task Routing — READ THIS FIRST

Before doing anything, match your task to the right workflow:

Your taskWhat to doDO NOT
"spec", "design with", "collaborative spec"Use the /spec command instead. It provides structured phase-by-phase guidance.Do NOT handle spec tasks from this skill.
Send a message, review request, questionUse amq send (see Messaging below)
Swarm / agent teamsRead references/swarm-mode.md, then use amq swarm
Received message with labels workflow:specFollow the spec skill protocol: do independent research first, then engage on the spec/<topic> thread.Do NOT skip straight to implementation.

Quick Start

# One-time project setup
amq coop init

# Per-session (one command per terminal — defaults to --session collab)
amq coop exec claude -- --dangerously-skip-permissions  # Terminal 1
amq coop exec codex -- --dangerously-bypass-approvals-and-sandbox  # Terminal 2

Without --session or --root, coop exec defaults to --session collab.

Session Layout

By default, .amqrc points to a literal root (e.g., .agent-mail). Use --session to create isolated subdirectories:

.agent-mail/              ← default root (configured in .amqrc)
.agent-mail/auth/         ← isolated session (via --session auth)
.agent-mail/api/          ← isolated session (via --session api)
  • amq coop exec claudeAM_ROOT=.agent-mail/collab (default session)
  • amq coop exec --session auth claudeAM_ROOT=.agent-mail/auth

Only two env vars: AM_ROOT (where) + AM_ME (who). The CLI enforces correct routing — just run amq commands as-is.

Messaging

amq send --to codex --body "Message"              # Send (uses AM_ROOT/AM_ME from env)
amq drain --include-body                          # Receive (one-shot, silent when empty)
amq reply --id <msg_id> --body "Response"          # Reply in thread
amq watch --timeout 60s                           # Block until message arrives
amq list --new                                    # Peek without side effects

Send with metadata

amq send --to codex --subject "Review" --kind review_request --body @file.md
amq send --to codex --priority urgent --kind question --body "Blocked on API"
amq send --to codex --labels "bug,parser" --context '{"paths": ["src/"]}' --body "Found issue"

Filter

amq list --new --priority urgent
amq list --new --from codex --kind review_request
amq list --new --label bug

Priority Handling

PriorityAction
urgentInterrupt current work, respond now
normalAdd to TODOs, respond after current task
lowBatch for session end

Message Kinds

KindReply KindDefault Priority
review_requestreview_responsenormal
questionanswernormal
decisionnormal
todonormal
statuslow
brainstormlow

References

For detailed protocols, read the reference file FIRST, then follow its instructions:

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

bkt

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

jk

No summary provided by upstream source.

Repository SourceNeeds Review
General

langfuse

No summary provided by upstream source.

Repository SourceNeeds Review