agmsg: Cross-Agent Messaging for CLI AI Coding Agents

Connect Claude Code, Codex, Gemini CLI, and other coding agents with shared messaging, delivery modes, spawn tools, and setup notes.

agmsg is a free, open-source messaging tool for CLI AI coding agents. It lets Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, OpenCode, and other supported agents exchange short messages through a shared SQLite store.

It is useful when several coding agents work on the same project and need to pass review requests, file paths, commit SHAs, task status, or short handoff notes. The local CLI workflow requires Bash and SQLite, and agmsg keeps the message history available across sessions.

Features

  • Sends short messages between independent CLI AI agent sessions through a shared SQLite store.
  • Works with Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, Antigravity, OpenCode, Cursor, Grok Build, Hermes, and shell-based agent workflows with different levels of integration.
  • Keeps message history across sessions and lets agents replay earlier team conversations.
  • Supports monitor, turn-based, combined, and manual delivery options where the connected agent supports them.
  • Lets one project use named roles through actas and release them through drop.
  • Can launch supported peer agents with spawn and close spawned peers with despawn.
  • Supports short handoffs that reference file paths, commit SHAs, issue numbers, and saved artifacts.
  • Offers npm, direct-script, and Claude Code plugin installation paths for the CLI tool.
agmsg two monitor mode

Use Cases

  • Send a code review request from Claude Code to Codex and return a concise review summary.
  • Pass a file path, issue number, commit SHA, or task status between coding agents.
  • Split planning, implementation, review, and analysis across named agent roles.
  • Launch a reviewer or implementation peer from the current session with a boot prompt.
  • Keep short coordination messages available when agent sessions restart.
  • Run several agents in one local team while each agent keeps its own CLI session and model context.

How agmsg Works

agmsg stores team messages in SQLite. Each registered agent has an identity inside a named team, and the installed skill reads or writes messages for that identity.

Automatic delivery depends on the connected agent and selected delivery mode. Claude Code can use monitor delivery for near-real-time message pickup. Codex can also use monitor delivery through agmsg’s app-server bridge, while turn-based delivery checks for messages between interactions.

Messages work best as concise handoffs. Store long diffs, logs, generated files, or reports on disk and send a short note that points the recipient to the relevant file or commit.

Supported Agents

AgentCommand / IntegrationNotes
Claude Code/agmsgSupports monitor, turn, both, and manual delivery.
Codex$agmsgSupports monitor through an app-server bridge, plus turn and manual delivery.
GitHub Copilot CLI/agmsgSupports turn and manual delivery.
Gemini CLI$agmsgUses the installed Agent Skill workflow.
Antigravity$agmsgUses the installed Agent Skill workflow.
OpenCode$agmsgSupports monitor through the external opencode-sentinel plugin, plus turn and manual delivery.
Cursor, Grok Build, HermesAgent-type supportIntegration details vary by agent type and runtime.

How To Install and Use agmsg

Install agmsg via NPM:

npx agmsg

You can also install it globally:

npm i -g agmsg
agmsg install

Claude Code users can install agmsg from its plugin marketplace entry:

/plugin marketplace add fujibee/agmsg
/plugin install agmsg@fujibee-agmsg
/reload-plugins
/agmsg

For a source checkout, clone the repository and run the installer:

git clone https://github.com/fujibee/agmsg.git
cd agmsg
./install.sh

After installation, restart the coding agent so it can detect the skill. Start agmsg inside the project with the command for your agent:

# Claude Code and GitHub Copilot CLI
/agmsg
# Codex, Gemini CLI, and Antigravity
$agmsg

The first run asks for a team name and agent name. After registration, you can use natural-language requests such as:

send alice a message saying the deploy is done
check my messages
who's on the team

Spawn and Despawn Peer Agents

spawn starts another supported CLI agent as an independent peer and assigns it a role. A boot prompt can send the new peer directly into a task during its first turn.

/agmsg spawn codex reviewer
/agmsg spawn claude-code alice --window
/agmsg spawn codex reviewer --boot-prompt "review the diff on this branch"

Current spawn support includes Claude Code, Codex, Grok Build, Cursor, Gemini, Antigravity, Copilot, and OpenCode.

Use despawn for peers that agmsg started:

/agmsg despawn reviewer
/agmsg despawn alice --force

Delivery Modes

ModeHow It Delivers MessagesBest Use
monitorUses a live watcher or agent-specific bridge for message pickup.Sessions that need near-real-time coordination.
turnChecks the inbox between agent interactions.Agents that work well with turn-based polling.
bothUses monitor delivery with turn-based fallback where supported.Claude Code workflows that need a fallback path.
offLeaves message checks to manual commands.Minimal setups and explicit inbox checks.

Inspect or change the current mode with these commands:

/agmsg mode monitor
/agmsg mode turn
/agmsg mode both
/agmsg mode off
/agmsg mode

Mode availability varies by agent. GitHub Copilot CLI supports turn and manual delivery. OpenCode can use monitor delivery through the opencode-sentinel plugin. Codex monitor uses an app-server bridge and changes how interactive Codex sessions start.

Codex Monitor Mode

Codex monitor delivery uses an app-server bridge because Codex does not expose Claude Code’s Monitor tool. agmsg can direct interactive Codex launches through a monitor shim, then inject incoming agmsg messages into the current Codex thread.

This mode changes the interactive Codex launch path. The Codex sandbox also needs write access to agmsg runtime directories such as db, teams, and run. Users who prefer the simpler setup can use turn-based or manual delivery.

Multiple Roles With actas

actas lets one project switch to another named role, which is useful for role-based workflows such as architecture review and requirements analysis.

/agmsg actas tech-lead
/agmsg actas biz-analyst
/agmsg drop biz-analyst

Role ownership is exclusive across sessions. agmsg prevents two sessions from claiming the same role at the same time.

Quick Reference

CommandPurpose
/agmsgCheck inbox across teams.
/agmsg historyShow message history.
/agmsg teamList team members.
/agmsg send <agent> <message>Send a message to another agent.
/agmsg mode <monitor|turn|both|off>Change delivery mode.
/agmsg actas <name>Use another role in the project.
/agmsg drop <name>Release a role.
/agmsg spawn <type> <name>Launch a supported peer agent.
/agmsg despawn <name>Close a peer that agmsg started.
/agmsg versionShow the installed version.
/agmsg resetClear project registration.

Shell Scripts

ScriptPurpose
send.sh <team> <from> <to> "<message>" [--force]Write a message to the team store.
inbox.sh <team> <agent_id>Read unread messages.
history.sh <team> [agent_id] [limit]Show message history.
team.sh <team>List team members.
whoami.sh <project_path> <type>Resolve the current identity.
delivery.sh set <mode> <type> <project_path>Set a delivery mode.
delivery.sh status [<type> <project_path>]Show delivery status.
reset.sh <project_path> <type> [agent_id]Clear registration data.

Storage and Data Handling

The default CLI workflow stores messages in a local SQLite database. Message history survives agent sessions, and the AGMSG_STORAGE_PATH environment variable can point the SQLite store to another directory.

AGMSG_STORAGE_PATH=/tmp/agmsg-sandbox ./scripts/send.sh myteam alice bob "hi"

agmsg messages are plain text. Connected coding agents continue to use their own model providers under the terms and data-handling rules of those services.

CLI and Desktop App

The agmsg CLI is the direct option for Agent Skill workflows and terminal automation. The project also provides a desktop app for macOS and Windows with terminal panes and agent controls in one application.

agmsg, MCP, Subagents, and Orchestration Tools

ApproachPrimary Role
agmsgPasses short messages between peer CLI agent sessions and keeps a shared message history.
MCPConnects an AI client to tools, data sources, services, and external capabilities through a standard protocol.
Built-in subagentsLets one host agent delegate work to managed agent processes inside its own orchestration model.
Multi-agent orchestration toolsCoordinate tasks, workspaces, queues, dashboards, or execution state across multiple workers.

Alternatives and Related Tools

Pros

  • Local SQLite messaging keeps the core CLI architecture lightweight.
  • Works across several popular CLI coding agents.
  • Persistent history supports handoffs across agent sessions.
  • Spawn, roles, and delivery modes support more complex multi-agent workflows.
  • Multiple installation paths support npm, source checkout, and Claude Code plugins.

Cons

  • CLI setup requires Bash and SQLite.
  • Delivery mode support differs across agent types.
  • Codex monitor changes the interactive Codex launch path and has extra setup considerations.
  • Messages are designed for concise text handoffs, while large artifacts need file references.

FAQs

Q: What is agmsg?
A: agmsg is an MIT-licensed cross-agent messaging tool for CLI AI coding agents. It uses a shared SQLite store for short messages between registered agent sessions.

Q: Can agmsg connect Claude Code and Codex?
A: Yes. Claude Code and Codex can join the same agmsg team and exchange messages. Codex supports turn-based delivery and also has a monitor option that uses an app-server bridge.

Q: Can agmsg launch another coding agent?
A: Yes. The spawn command can launch supported peer agents such as Codex or Claude Code, assign a role, and optionally send a boot prompt for the first task.

Q: Does agmsg work with MCP?
A: Yes. agmsg can run alongside an MCP setup. agmsg handles peer messaging, while MCP handles tool and data connections for compatible AI clients.

Q: Does agmsg keep message history?
A: Yes. Messages stay in the SQLite store after sessions end, and the history command can replay earlier team conversations.

Q: Can agmsg handle large files or long outputs?
A: The message layer is designed for concise text. Save large diffs, logs, or artifacts to disk and send a file path, commit SHA, or other short reference to the receiving agent.

Last Updated: Aug 20, 2026

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!