# agmsg

> Let Claude Code, Codex, Gemini CLI and other coding agents message each other directly

- Category: Agents & Automation / Multi-Agent Systems
- Language: Shell
- Licence: MIT
- Repository: https://github.com/fujibee/agmsg
- Canonical page: https://ai-tldr.dev/tools/agmsg/

## In short

agmsg is an open-source messaging layer for CLI AI coding agents. It sits in the Multi-Agent Systems category of the Agents & Automation tools and is open-source, written in Shell and licensed MIT. To get started: install.

## Overview

agmsg is an open-source messaging layer for CLI AI coding agents. It lets Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, Antigravity, OpenCode and other terminal agents send messages to each other inside a named team, so you stop acting as the copy-paste courier between them — one agent can ask another for a code review and get the answer back without a human relaying it.

It is deliberately thin. There is no MCP server, no daemon, no broker and no network: agmsg is a set of Bash scripts over a shared SQLite file in WAL mode. Sending a message appends a row; each agent has a hook, or a Monitor stream on Claude Code, that reads the file and surfaces new messages as text it can react to. Messages persist after a session ends, so a team's history can be replayed into a fresh agent.

agmsg connects peer sessions rather than managing subagents. It installs as a skill that each agent invokes with a slash command, and it adds roles within a project (actas), the ability to spawn a new peer agent in its own tmux pane or terminal window, and a choice of delivery modes from real-time push to between-turns checking. Turn-taking and stop conditions are left to your prompts. The project is MIT licensed.

## What it does

- Direct messaging between different vendors' CLI agents — Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, Antigravity, OpenCode and more — organised into named teams
- Plain Bash plus sqlite3: no MCP server, daemon, broker or network, with a WAL-mode store that keeps durable message history
- Delivery modes per project: monitor (real-time push, about 5 seconds), turn (checked between assistant turns), both, or off
- actas roles let one project hold several exclusive identities, such as a tech lead and a business analyst
- spawn launches a new peer agent in a tmux pane or a new terminal window with a role and an optional boot task; despawn tears it down
- Shell scripts (send.sh, inbox.sh, history.sh, team.sh) for driving the same message store from automation and CI

## Getting started

agmsg needs bash and sqlite3 (macOS ships both; on minimal Linux images you may need to install sqlite3). Every install path ends up at ~/.agents/skills/agmsg/.

1. Install

   npx is the quickest route. You can also clone the repo and run ./install.sh, or, inside Claude Code, add the plugin marketplace with /plugin marketplace add fujibee/agmsg.

```bash
npx agmsg
```

2. Restart your agents and join a team

   Restart Claude Code, Codex, Gemini CLI or whichever agents you use so they pick up the new skill, then run the command in each project. On first use it asks for a team name, an agent name and a delivery mode.

```text
/agmsg      # Claude Code, Copilot CLI
$agmsg      # Codex, Gemini CLI, Antigravity, OpenCode
```

3. Talk to your agent naturally

   After onboarding you just ask — for example "send alice a message saying the deploy is done", "check my messages" or "who's on the team" — and the agent picks the right subcommand. Explicit commands also work.

```text
/agmsg send <agent> <message>
/agmsg history
/agmsg team
/agmsg mode monitor
```

4. Spawn a collaborator

   spawn launches a separate agent that joins under a role; inside tmux it opens a new pane, otherwise a new terminal window. --boot-prompt hands it a first task.

```text
/agmsg spawn codex reviewer --boot-prompt "review the diff on this branch"
```

5. Script it from the shell

   The same store can be driven from scripts or CI; both sender and recipient must already be registered in the team.

```bash
~/.agents/skills/agmsg/scripts/send.sh <team> <from> <to> "<message>"
~/.agents/skills/agmsg/scripts/inbox.sh <team> <agent_id>
```

## When to use it

- Have Claude Code hand a branch to Codex for code review and receive the review back without copy-pasting between terminals
- Run a standing team of coding agents from different vendors, each with its own role, that coordinate through one shared message history
- Fan out work by spawning peer agents in tmux panes with a boot task, then collect their replies in your main session
- Add agent-to-agent messaging to an existing setup without running an MCP server, a broker or any network service
