A developer going by fujibee has released agmsg on Hacker News—a lightweight messaging system that lets CLI AI agents like Claude Code and OpenAI's Codex talk to each other through a shared SQLite database. The project requires no daemon, no network connectivity, and minimal dependencies—just bash and sqlite3 installed locally.
How It Works
The architecture is elegantly simple: all communication flows through a single SQLite file operating in WAL mode, which supports multiple concurrent readers plus one writer without conflicts. When agents join the same 'team,' they register their identity as (agent name, team) pairs with project metadata attached. From there, any agent on that team can send messages to any other using natural language prompts like '/agmsg send alice the deploy is done' or '$agmsg check my messages'.
A Tic-Tac-Toe Demo Without Human Input
The most striking demonstration shows two Claude Code instances running in monitor mode—left alone together in the same team—playing tic-tac-toe against each other with zero human intervention. Each agent picks up the opponent's move in real time via SQLite streaming. In another use case, a developer has Claude Code ask Codex for a code review and receive it back—all routed through agmsg rather than copy-pasting between terminals.
Delivery Modes for Different Agent Architectures
Since Claude Code and Codex have different capability sets, agmsg offers four delivery modes: monitor (real-time push via SessionStart hook and Monitor tool, ~5s latency), turn (stop-hook fires check-inbox.sh between assistant turns), both (monitor primary with turn as a safety net), or off (manual /agmsg only). Claude Code defaults to monitor mode while Codex defaults to turn since it lacks the Monitor tool. Settings are stored per-project in .claude/settings.local.json.
Multiple Roles and Identities
The system supports sophisticated multi-identity setups within the same project. Agents can 'act as' different roles—say, a tech-lead identity for architecture reviews and a biz-analyst identity for requirements work—switching between them with /agmsg actas
Getting Started
Installation is a single curl command: bash <(curl -fsSL https://raw.githubusercontent.com/fujibee/agmsg/main/setup.sh). After running ./install.sh and restarting your agent, you join teams by running /agmsg (Claude Code) or $agmsg (Codex), which prompts for team name and agent name on first use. The skill adds slash commands and hooks automatically—tests are available via bats-core.
Key Takeaways
- Cross-agent communication without network infrastructure—just filesystem access to a shared SQLite database
- Works with Claude Code, Codex, Gemini CLI, and any CLI-based AI agent that can invoke shell scripts
- Real-time messaging for Claude Code via Monitor tool streaming; turn-based fallback for agents without real-time capabilities
- Supports multiple identities per project with role-switching for specialized workflows like code review pipelines
The Bottom Line
Agmsg is the kind of elegant, minimal tool that makes you wonder why nobody built it sooner. By leveraging SQLite's concurrency guarantees and bash scripting, fujibee has created a protocol for agent-to-agent communication that sidesteps API keys, network latency, and daemon maintenance entirely—just filesystem access required.