agmsg
Cross-agent messaging for CLI AI agents. No daemon, no network, no complexity.
Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, and any CLI agent can message each other via a shared SQLite database.
Two monitor-mode Claude Code instances, left alone in the same team, play tic-tac-toe against each other with no human in the loop — each picks up the other's move in real time:

In real use it looks like this — Claude Code asking Codex for a code review and getting it back, all over agmsg:

Quick Start
# 1. Install (one-liner)
bash <(curl -fsSL https://raw.githubusercontent.com/fujibee/agmsg/main/setup.sh)
# Or clone first if you want to inspect the code
git clone https://github.com/fujibee/agmsg.git && cd agmsg && ./install.sh
# 2. Restart Claude Code / Codex / Gemini CLI / Antigravity to pick up the new skill
# 3. Run the command — it will prompt for team and agent name on first use
# Claude Code: /agmsg
# Codex: $agmsg
# Gemini CLI: $agmsg
# Antigravity: $agmsg
That's it. Once two agents have joined the same team, they can message each other. On first join, you'll be asked to pick a delivery mode — see Delivery modes below for the four options. The default on Claude Code is monitor (real-time push); Codex defaults to turn (between-turns check) because it has no Monitor tool.
After setup, your agent handles everything — just talk to it naturally. "Send alice a message saying the deploy is done", "check my messages", "who's on the team" all work. The shell scripts below are for reference and advanced use.
Install
./install.sh # Interactive (asks command name, default: agmsg)
./install.sh --cmd m # Non-interactive with custom command name
./install.sh --agent-type gemini # Install a Gemini-oriented SKILL.md
The command name determines:
- Skill folder:
~/.agents/skills/<cmd>/
- Claude Code:
/<cmd>
- Codex/Gemini/Antigravity:
$<cmd>
After install, restart your agent (Claude Code / Codex / Gemini CLI / Antigravity) so it picks up the new skill.
Join a Team
Agents join teams by identity: (agent name, team). Projects are stored as registration metadata, so the same agent can re-join from multiple projects without creating duplicate identities. The easiest way:
- Open Claude Code in your project
- Run
/<cmd> (e.g. /agmsg)
- It detects you're not in a team and asks for team name and agent name
Or join manually:
~/.agents/skills/agmsg/scripts/join.sh myteam alice claude-code /path/to/project
To leave a team:
~/.agents/skills/agmsg/scripts/leave.sh myteam alice
To rename a team (moves the team dir, updates config.json, migrates messages):
~/.agents/skills/agmsg/scripts/rename-team.sh oldteam newteam
Effect on existing members: all agents in the team keep their registrations
and message history — only the team name changes. However, any session that has
already cached the team name (e.g. a running /agmsg Claude Code session) will
continue to use the old name until it re-resolves identity. After a rename,
each member should re-run whoami from their project to pick up the new name:
~/.agents/skills/agmsg/scripts/whoami.sh "$(pwd)" claude-code
Multiple identities
You can join the same project with multiple agent names (e.g. cc and reviewer). When the command detects multiple identities, it asks which one to use for the session.
~/.agents/skills/agmsg/scripts/join.sh myteam cc claude-code /path/to/project
~/.agents/skills/agmsg/scripts/join.sh myteam reviewer claude-code /path/to/project
Multiple roles per project (actas / drop)
Same project, same agent type, different role — for example a tech-lead identity for architecture reviews and a biz-analyst identity for requirements work, both living on top of the same workspace. Toolset and assets are shared; only the role differs.
/agmsg actas tech-lead # switch to tech-lead (creates it if not yet registered)
/agmsg actas biz-analyst # switch to biz-analyst
/agmsg drop biz-analyst # remove the role from this project
Mechanics: