WebSocket message bus Β· MCP Channel server Β· Discord-style management dashboard
Run multiple Claude Code instances on the same codebase. Have them talk to each other, share build & QA results, and coordinate edits β without stepping on each other's commits.
Running 2-4 Claude Code agents in parallel on the same repo is a real dev-velocity unlock β until two of them edit the same file, ship conflicting commits, or step on each other's branches. Synapse is what I built to make that workable: a real-time message bus and coordination layer specifically for fleets of Claude Code agents.
It does three things existing tools don't:
- πͺ Pushes server-originated messages directly into a running Claude Code conversation β a novel inversion of the standard MCP request/response model. See The Channel pattern below.
- π File-locking primitive with 30-min auto-expiring locks, consulted by a pre-edit hook before every Write/Edit, so concurrent agents never race on the same file.
- π‘ Activity feed + alerts + auto-checkpoints β every edit, commit, lock, build, and QA result streams to a Discord-style web dashboard in <100ms.
This is the bit that makes Synapse genuinely different.
Every existing MCP server today follows a pull model β Claude calls a tool, the server responds. Synapse adds a push channel:
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β Synapse Server β β Bot A (Claude Code instance) β
β (Express + WebSocket) β ββpushβββΆβ ββββββββββββββββββββββββββββ β
β β <chan> β β Channel MCP Server β β
β Activity feed Β· File locks β tag β β Injects <channel> tags β β
β Message bus Β· Alerts β into β β into the conversation β β
β Build / QA results β conv β ββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
β²
β (also handles standard pull-style MCP calls
β for file locks, alerts, activity log queries)
β
ββββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
Bot B Bot C Bot D
When Bot A makes an edit, Synapse pushes an update to every other bot's running Claude Code conversation as a <channel> tag β they see what their teammates are doing in near-real-time, without polling, without context bloat. Server-to-client MCP is the open invitation Synapse takes that nobody else is using yet.
ββββββββββββββββββββββββββββββββββββββββ
β Synapse Server β
β (Express + WebSocket) β
β β
β File Locking Β· Activity Feed β
β Message Bus Β· Alerts Β· Health β
ββββββββββββ¬ββββββββββββββββββββββββββββ
β WebSocket + HTTP
βββββββΌββββββ
βΌ βΌ βΌ
Bot A Bot B Bot C
(MCP Channel Servers Β· pre-edit hooks Β· auto-checkpoint)
| Component | Path | Role |
|---|---|---|
| π°οΈ Server | server/ |
Express + WebSocket coordination hub. Tracks bots, locks, activity, messages, alerts, builds, QA results. |
| πΊ Channel | channel/ |
MCP Channel server β pushes server-originated messages into a running Claude Code conversation as <channel> tags. |
| π οΈ MCP | mcp/ |
Standard pull-style MCP tools β file locking, alerts, activity-log queries, message send/recv. |
| πͺ Hooks | hooks/ |
Claude Code hooks β pre-edit-check.js, post-sync.js, auto-checkpoint.js, session check-in/out. |
| π₯οΈ Dashboard | dashboard/ |
Single-file Discord-style web UI. No build step, no framework. |
| π Docs | docs/ |
Setup guides, architecture deep-dives, whitepaper. |
# 1οΈβ£ Configure
cp .env.example .env # set DEV_SYNC_KEY at minimum (openssl rand -hex 32)
cp users.example.json users.json # edit with your team's Discord IDs (optional)
cd server && npm install
# 2οΈβ£ Start the server
node server.js
# β Synapse listening on :4100
# 3οΈβ£ Add the MCP servers to a Claude Code instance
claude mcp add synapse-tools -- node /path/to/Synapse/mcp/index.js \
--url http://localhost:4100 \
--developer alice \
--key your-dev-sync-key
# 4οΈβ£ Launch Claude Code with the channel attached
claude --dangerously-load-development-channels server:synapse-channelYou'll see your bot register on the dashboard at http://localhost:4100. Run two more Claude Code instances with different --developer slugs and they'll start coordinating immediately.
Synapse separates code from your team's identity data. Two files drive everything:
Copy .env.example to .env. Only DEV_SYNC_KEY is required to run.
| Variable | Purpose |
|---|---|
DEV_SYNC_KEY |
Required. Shared secret every connecting client passes via ?key= or X-Dev-Key. |
DISCORD_WEBHOOK_URL |
Outbound mirror β relay messages from code / all / direct channels into your Discord. |
DISCORD_BOT_TOKEN |
Inbound relay β listen to your Discord channels and forward into Synapse. |
DISCORD_RELAY_CHANNELS |
Comma-separated Discord channel IDs the inbound relay watches. |
DISCORD_BEN_WEBHOOK_IDS |
Webhook IDs to attribute to the primary user (e.g. external app posting on your behalf). |
SYNAPSE_USERS_FILE |
Path to users.json. Defaults to ../users.json from the server directory. |
SYNAPSE_PUBLIC_URL |
Public dashboard URL used in outbound Discord notifications. |
SYNAPSE_PROJECT_NAME |
Used by hooks to strip absolute paths down to project-relative for display. |
GH_REPO |
org/repo slug for the GitHub-activity dashboard widget. |
SYNAPSE_BACKEND_CLAUDE_MD / SYNAPSE_FRONTEND_CLAUDE_MD / SYNAPSE_QA_CLAUDE_MD |
Override per-bot CLAUDE.md paths shown in the dashboard. |
PROJECT_ROOT |
Override the directory treated as your project root. |
Copy users.example.json to users.json (gitignored β never commit). Defines:
- Synapse identity slugs for your team members + bots
- Each member's Discord ID, display name, avatar URL, chat-square emoji
- Which member is the "primary" (used for whitelisted-webhook attribution)
- Optional list of additional Discord bot IDs to filter from the inbound relay
Synapse loads users.json at startup and falls back to users.example.json if missing (with a console warning).
- Distributed file locks with 30-minute auto-expiry β no hard cleanup needed if a bot crashes
- Pre-edit hook consults the central server before every Write/Edit, blocks if locked
- Recent-edit warnings β non-blocking heads-up when another bot touched a file in the last 10 min
- Shared-files watchlist β extra-strict checks for hot files (e.g.
package.json, root configs)
- WebSocket message bus β <100ms push latency between bots
- Channel push β server-originated messages appear inside a running Claude conversation as
<channel>tags - Activity feed β every edit / commit / lock / build / QA result logged and streamed
- Alerts β priority push notifications between bots ("hey, the auth tests broke on your branch")
pre-edit-check.jsβ blocks edits to locked files; warns on shared-file editspost-sync.jsβ logs every edit + Bash command back to Synapse for the activity feedauto-checkpoint.jsβ commits WIP every 5 edits per agent (distributed-systems thinking applied to LLM agents)- Session check-in / check-out / user-prompt hooks for full lifecycle visibility
- Discord-style web UI at
http://localhost:4100β single HTML file, no build step - Live activity stream with per-bot avatars, role colors, channel tags
- File-lock visualisation β see what's locked, by whom, and when it auto-expires
- Build & QA panels β track results across bots without leaving the dashboard
- GitHub activity widget β recent commits + PR status
- Outbound mirror β relay Synapse messages to Discord via webhook
- Inbound relay β pipe Discord channel messages back into Synapse so humans can chat with bots from their phone
- Echo-loop prevention β known-bot allowlist + webhook whitelist prevents feedback loops
I run 2-4 Claude Code instances simultaneously on the same large codebase. Each lives on a different branch:
- Backend Bot on
back-endβ APIs, database, agents - Frontend Bot on
front-endβ React, Tailwind, UI components - QA Bot on
mainβ tests, code review, Playwright automation - Sometimes a fourth β docs, ops, infra
Without coordination, they ship conflicting changes, race on shared files, and waste tokens re-discovering each other's work. With Synapse, the QA Bot pushes a critical-issue message into the Backend Bot's running conversation the moment a test breaks, the Frontend Bot can tell the Backend Bot it's about to migrate a route, and package.json only ever gets edited by one of them at a time.
If you're running multi-bot Claude Code dev workflows, Synapse is what you wish you had after the second time two bots clobbered each other's package.json.
- Web-only fallback for users without Discord
- Per-channel rate-limiting + queueing
- Persistent activity log retention beyond in-memory + JSON
- Test suite for the Channel pattern's reconnection edge cases
- Public Postgres backend (currently file-state, fine up to ~10 bots)
- Native MCP
tools/list&tools/callschema validation in Channel server
Synapse is in active personal use. PRs welcome β particularly around:
- New hook scripts for additional Claude Code lifecycle events
- Adapters for other agent frameworks (Cursor, Aider, etc.)
- Dashboard improvements (search, filters, theming)
- Docs / examples / tutorials
Open an issue first if you want to discuss a larger change.
MIT β use it, fork it, ship it. Attribution appreciated but not required.
Built by Ben Cole (@ZSlayerHQ) β AI engineer working on multi-agent systems and Model Context Protocol servers.
If Synapse is useful to you, a β on this repo is the easiest way to say thanks.
Made with too many parallel Claude Code conversations.