agmsg is a cross-agent messaging layer that lets Claude Code, Codex, Gemini CLI, and any other CLI-based AI agent communicate through a shared SQLite database. The project, posted to Hacker News by developer fujibee on May 28th, strips away the typical complexity around multi-agent coordination—no daemon process required, no network services running in the background. Just bash scripts and sqlite3 doing the heavy lifting.

How It Works

The architecture is refreshingly minimal. Each agent joins a "team" with an identity tied to (agent name, team) pairs plus registration metadata linking back to specific project paths. This means the same agent can rejoin from multiple projects without creating duplicate identities. The SQLite database runs in WAL mode for concurrent reads while ensuring writes are serialized through a single writer process—no race conditions, no conflicts. All storage lives at ~/.agents/skills//db/messages.db with team configurations stored as self-contained JSON under the teams directory.

Delivery Modes: Monitor vs Turn

The system offers four delivery modes depending on your latency tolerance and agent capabilities. Claude Code defaults to "monitor" mode, which uses a SessionStart hook to launch a blocking SQLite stream via the Monitor tool—achieving around 5-second real-time push with no polling overhead. Codex has no equivalent of the Monitor tool, so it defaults to "turn" mode: a Stop hook fires between assistant turns and runs check-inbox.sh (with a 60-second cooldown). There's also a "both" option for belt-and-suspenders reliability and an "off" mode for pure manual retrieval. Settings persist per-project in .claude/settings.local.json.

Multiple Identities and Role Switching

One of the more interesting features is support for multiple identities within the same project. An agent can register as both cc and reviewer under the same team, then use /agmsg actas to switch between them mid-session. The command TaskStops the running inbox Monitor and relaunches it filtered to only messages addressed to that specific role—keeping a tech-lead window clean from biz-analyst noise and vice versa. Switching is session-scoped; /clear or a new session resets back to the identity picker.

Demo: Two Agents Playing Tic-Tac-Toe

The proof of concept is wild in its simplicity: two Claude Code instances running in monitor mode, left alone in the same team, play tic-tac-toe against each other with no human intervention. Each agent picks up the opponent's move from the shared database and responds in real time. In a more practical demo shown on GitHub, one Claude Code instance asks Codex for a code review via /agmsg send, waits for the reply, and gets it back—fully automated handoff between agents that don't even run on the same underlying system.

Installation and Usage

Getting started is absurdly simple: bash <(curl -fsSL https://raw.githubusercontent.com/fujibee/agmsg/main/setup.sh) pulls down everything and runs the install script. After restarting Claude Code or Codex to pick up the new skill, agents can message each other immediately after joining a team—prompted on first run for team name and agent handle. From there it's natural language: "Send alice a message saying the deploy is done" or "check my messages." The underlying shell scripts are available for advanced use cases like send.sh, inbox.sh, history.sh, and team.sh.

Key Takeaways

  • agmsg requires only bash and sqlite3—no Python, no external dependencies beyond standard CLI tools
  • Cross-agent communication works across different providers (Claude Code ↔ Codex) via a shared SQLite database
  • Monitor mode delivers ~5s latency for Claude Code; turn mode handles agents without real-time streaming capability
  • Multiple identities per project enable role-based separation like tech-lead vs biz-analyst workflows
  • The tic-tac-toe demo proves zero-human-in-the-loop agent coordination is achievable with minimal infrastructure

The Bottom Line

This is the kind of boringly elegant infrastructure that makes you wonder why it didn't exist sooner. No flashy UI, no cloud sync, no vendor lock-in—just files and databases doing what they've always done. If you're running multiple AI agents in your workflow, agmsg removes one more piece of friction from an ecosystem that's still figuring out how to cohere.