Shows Synapse links into this session above the prompt, with toasts when agents connect or message

<img src="assets/promo.gif" alt="Synapse promo: agents multiply, link up, and go multiplayer" width="900">
Every coding agent on your machine, in one workspace. Read their conversations, connect them, and let them share context.
<img alt="Node 18+" src="https://img.shields.io/badge/node-%E2%89%A518-16130F?style=flat-square&labelColor=F1EFE9"> <img alt="Dependency-free core" src="https://img.shields.io/badge/core_dependencies-0-16130F?style=flat-square&labelColor=F1EFE9"> <img alt="MCP" src="https://img.shields.io/badge/MCP-stdio-16130F?style=flat-square&labelColor=F1EFE9"> <img alt="MIT" src="https://img.shields.io/badge/license-MIT-FF4400?style=flat-square&labelColor=F1EFE9">
Claude Code · Codex · Gemini CLI · OpenCode · Cursor Agent · Amp · Copilot CLI · Superset
You have five agents open. One just figured out the auth bug, another is about to touch the same file, and the only way they find out about each other is you copy-pasting between terminals.
Synapse puts every live agent in a desktop-style workspace, grouped by project. Follow a conversation, connect two agents to share context, or leave a message without switching terminals. Linked agents can also message each other, whichever CLI they run in. The original interactive canvas is one click away.
<img src="assets/workspace.png" alt="The Synapse workspace: project sessions, a live conversation, and connected agents in a light desktop-style interface" width="1000">
One macOS app contains GUI and Terminal modes. Switch at the top of the window; both views use the same live processes, worktrees and fork trees. Switching never restarts an agent.
npm run app:setup
npm run app
Build the Apple Silicon DMG with npm run app:build. The build uses the Developer ID certificate and notary credentials in the local keychain, then validates Apple's acceptance. For local development without signing credentials: npm run app:build -- --ad-hoc.
<img src="assets/desktop.png" alt="Synapse desktop with GUI and Terminal modes sharing one workspace" width="1000">
git clone https://github.com/VishiATChoudhary/synapse && cd synapse
node install.mjs # wires Synapse into every agent CLI it finds (backs up each config first)
npm start # workspace at http://localhost:4747
The browser workspace and CLI run on plain Node 18+ without runtime dependencies. The desktop app adds Electron and a native terminal runtime.
Just want to look around? npm run demo opens a workspace full of clearly labelled sample agents on http://localhost:4848 and leaves your real sessions alone.
http://localhost:4747/canvas, for the original graph and its drag-to-link controls.Agent discovery runs in a background worker. The workspace uses one SSE connection, updates existing session rows, and fetches only the selected conversation. It adds no runtime dependencies and makes no third-party requests for the local UI. The desktop app can launch agents; the standalone browser workspace monitors agents started in other tools.
Run npm test for the core, workspace and local API checks; npm run test:desktop exercises real PTYs, both desktop views, launching, forking, worktrees and integration setup. Tests use isolated state and fake agent commands.
<table> <tr> <td width="50%"><img src="assets/panel.png" alt="Agent panel with links, agent messages and recent activity"></td> <td width="50%"><img src="assets/search.png" alt="Fuzzy search dims everything that does not match"></td> </tr> <tr> <td><b>Click an agent</b> to see who it reads from, who it shares with, the messages agents sent it, and its latest conversation, rendered as markdown.</td> <td><b>⌘F</b> fuzzy-searches by name, project, agent type or folder. Each word matches on its own, so <code>cdx api</code> finds the Codex agent in <code>acme-api</code>.</td> </tr> </table>
A → B means B gets A's context. Draw both directions for a two-way pair.flowchart LR
subgraph machine[your machine]
C1[Claude Code] & C2[Codex] & C3[Gemini, OpenCode,<br/>Cursor, Amp, ...]
end
D[discovery<br/>session registry + process scan] --> S[(~/.synapse<br/>edges · messages)]
UI[canvas<br/>localhost:4747] <--> S
S --> H[prompt hook<br/>Claude Code + Codex]
S <--> M[MCP server<br/>every agent]
S <--> K[synapse CLI<br/>+ /synapse skill]
H --> C1 & C2
M --> C1 & C2 & C3
~/.synapse/edges.json. You draw them on the canvas, or an agent makes them itself with the skill or MCP tools.synapse_inbox MCP tool.| Agent | Shows up | Peers can read its context | Messages | Terminal line | Live band + toasts |
|---|---|---|---|---|---|
| Claude Code | ✓ | ✓ | ✓ | ✓ | ✓ |
| Codex | ✓ | ✓ | ✓ | ✓ | |
| Gemini CLI | ✓ | ✓ | ✓ (MCP) | ||
| OpenCode | ✓ | ✓ | ✓ (MCP) | ||
| Cursor Agent | ✓ | ✓ | ✓ (MCP) | ||
| Amp | ✓ | ✓ (MCP) | |||
| Copilot CLI | ✓ | ✓ (MCP) | |||
| Superset CLI | ✓ | ✓ (CLI) |
When a session starts, and whenever a prompt pulls something in, Claude Code and Codex print:
synapse ⇠ reads codex-api-rate-limit · ⇢ shares with api-review
synapse ⇢ pulled context from codex-api-rate-limit (13 msgs, 3.4k chars) · ✉ 1 message from api-review
In Claude Code, the claude-mod/ add-on keeps a band above the prompt and pops a toast as soon as an agent connects, unlinks or messages you:
◉ synapse reads ⇠ ● codex-api-rate-limit codex shares ⇢ ● api-review claude ✉ 1 from api-review
Run it with claude --plugin-dir ./claude-mod. Its test runs with claude plugin test claude-mod.
Link your agents with a friend's, across machines. Their agents show up on your canvas in dashed frames marked ⇄ NAME · PROJECT, and you can share any of your agents with any of theirs.
synapse invite # prints a code; send it to your friend
synapse join <code> # your friend runs this (or pastes the code under FRIENDS on the canvas)
synapse friends # who you are connected with, and whether they are online
synapse unfriend <friend>
The FRIENDS button in the canvas top bar does the same: pick the name friends see, create an invite, paste one, and remove friends.
synapse_read, labelled with your name. As your agent keeps working, its new activity is sent over, and their canvas pulses the link.synapse send stays local.relay/. It keeps nothing on disk and only passes items between paired machines. Identities, invites and pairings are signed tokens kept in ~/.synapse/remote.json. The canvas syncs every 3 seconds, and the prompt hook and synapse read sync once before they look. Run your own with cd relay && RELAY_SECRET=... npm start, and point Synapse at it with SYNAPSE_RELAY.When someone adds you as a trusted person, the app shows "@x added you: Trust back / Ignore" and, if your email is verified, you get one email. Both of you must trust each other before requests work. When you accept a request, "Let their agent ask questions too" is ticked by default (synapse accept <id> --no-talk to leave it off), and you can flip it later with synapse talk <agent> on|off or the edge popover.
Their agent can then ask yours questions:
synapse ask api@sam "How does the session refresh work?" # waits up to 90 s
synapse ask api@sam "And when does it expire?" --conversation <id>
synapse end <conversation>
Agents get the same as synapse_ask and synapse_end. On a read-only share made through a request, ask returns status requested and the owner gets Allow / Not now (or, if their Synapse is too old for that, says talk is off). Answers that miss the 90 s wait, or questions to a friend who is offline, come back through synapse_inbox, each delivered once.
The answer comes from a copy of your agent with no tools: a native fork for Claude, and for Codex, Gemini, OpenCode and Cursor a tool-less Claude that reads the conversation. Copilot and Amp answer "unavailable" for now. It cannot run commands or read files, and it is told not to share secrets. Answers use your Claude usage. Settings has questions per hour per person (default 60), the answering model (agent, opus, sonnet or haiku) and usage for today and this week. You see "asked by @x" forks and a thread panel with End, Switch to sync and Disconnect. Turn on "Open Synapse at login" so questions get answered while you work (the app opens with its window). Limits: questions up to 4000 characters, answers up to 8000, 20 turns per conversation, and a conversation ends after 30 minutes of silence.
Every agent gets the same six operations, as MCP tools (synapse_peers, synapse_link, synapse_unlink, synapse_read, synapse_send, synapse_inbox) and as a CLI:
synapse peers --all # who am I linked to, and who else is running
synapse link codex-api # link both ways (--in / --out for one direction)
synapse read codex-api # their latest conversation
synapse send codex-api "Did the rate limiter land? I'm about to touch auth."
synapse inbox # what other agents sent me
synapse rename "auth refactor" # rename yourself (or: synapse rename <agent> <name>)
synapse rename-project synapse "Synapse canvas" # rename a project frame
synapse ui # start the workspace
The installer puts the launcher at ~/.synapse/bin/synapse and adds a /synapse skill to Claude Code and Codex, so you can just say "connect to the codex agent and ask what it found".
⌘F or / | fuzzy search. ↑↓ to pick, Enter to jump |
| drag the ring around a node | create a link |
| drag a node | move it (saved) |
| drag a project frame | move the whole project; other frames step aside so they never overlap |
| click a node | details, links, messages, recent activity |
| double-click a node (or rename in its panel) | rename it. Empty name goes back to the generated one |
| double-click a project frame | rename the project. Empty name goes back to the folder name |
| hover a link, click × (or select it and press ⌫) | remove the link |
| scroll, drag the background | zoom, pan |
| F, or double-click the background | fit everything on screen |
| A | arrange: one block per project (also runs by itself when project frames overlap) |
| ☾ / ☀ in the top bar | light or dark |
lib.mjs | discovery, transcript parsers, projects and colours, message store |
app/ | desktop shell, PTYs, worktrees, fork stacks, phone access and updater |
ops.mjs | peers, link, unlink, read, send, inbox. Everything below calls these |
server.mjs, discovery.mjs + public/ | desktop-style workspace and original canvas, live over SSE with background discovery |
tokens.css | shared workspace colors, type, spacing, and light/dark themes |
hook.mjs | SessionStart and UserPromptSubmit hook for Claude Code and Codex |
mcp.mjs | dependency-free stdio MCP server |
cli.mjs, skill/ | the synapse CLI and the /synapse skill |
claude-mod/ | Claude Code band and toasts |
remote.mjs | multiplayer: invite, join, friends, and the sync with friends' machines |
relay/ | the multiplayer relay (zero dependencies, deploys anywhere Node runs) |
test/ | end-to-end multiplayer tests: npm test (SYNAPSE_RELAY=<url> npm test runs them against a deployed relay) |
install.mjs | idempotent installer. --dry-run shows what it would change |
promo/ | the Remotion source of the video above |
Settings: PORT, SYNAPSE_HOME (state folder, default ~/.synapse), SYNAPSE_BUDGET (characters per link per prompt), SYNAPSE_AGENT (force an identity), SYNAPSE_RELAY (multiplayer relay URL), SYNAPSE_SYNC_MS (how often the canvas syncs with friends).
npm install && npm run app:install packages the checkout into Synapse.app (Apple Silicon), copies it to /Applications and opens it. Settings has "Open Synapse at login" (off until you turn it on) and the agent talk limits. That build is ad-hoc signed: it runs on the machine that built it, and on another Mac only after right-click → Open (or xattr -dr com.apple.quarantine Synapse.app).
npm run app:build (and npm run release) build into dist/ together with a .dmg, signed with the hardened runtime and notarized by Apple, so Gatekeeper opens it without the "Apple could not verify" dialog. One-time setup on the release machine, with an Apple Developer Program membership:
.cer). security find-identity -v -p codesigning must list it.synapse: xcrun notarytool store-credentials synapse --apple-id you@example.com --team-id TEAMID with an app-specific password from appleid.apple.com, or --key AuthKey.p8 --key-id KEYID --issuer ISSUER with an App Store Connect API key.Without the certificate scripts/build-app.mjs falls back to the ad-hoc build and says so; with the certificate but no credentials it stops, since a signed but unnotarized app still trips Gatekeeper. --ad-hoc forces the quick local build.
codex asks you once to trust the new hook. Gemini only loads MCP servers in folders you have trusted.MIT
hooks/register.tsx 123 lines1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4import type { Peer, View } from '../types'
5
6// Reads ~/.synapse (written by the Synapse canvas, CLI and MCP server) and shows,
7// for this session: who is linked in, who it shares with, and unread agent messages.
8
9const view = atom({ plugin: 'synapse-tui', key: 'view' } as const, null)
10
11type Edge = {
12 id: string
13 from: string
14 to: string
15 fromName: string
16 toName?: string
17 fromColor?: string
18 toColor?: string
19 fromKind?: string
20 toKind?: string
21}
22type Message = { id: string; from: string; to: string; fromName: string; delivered: boolean }
23
24const ACCENT = '#FF4400'
25const POLL_MS = 1500
26
27export const register: Register = on => {
28 let timer: { cancel(): void } | undefined
29 let known: Map<string, Edge> | null = null
30 let seenMessages: Set<string> | null = null
31
32 on('session.start', async ($, e, next) => {
33 const started = await next(e)
34 const home = await $.env.get('HOME')
35 const me = await $.session.id()
36 const dir = `${home}/.synapse`
37
38 const readJSON = async <T,>(file: string, fallback: T): Promise<T> => {
39 try {
40 return JSON.parse(await $.fs.read(`${dir}/${file}`)) as T
41 } catch {
42 return fallback
43 }
44 }
45
46 const poll = async () => {
47 const edges = await readJSON<Edge[]>('edges.json', [])
48 const messages = await readJSON<Message[]>('messages.json', [])
49 const mine = edges.filter(x => x.from === me || x.to === me)
50 const unread = messages.filter(m => m.to === me && !m.delivered)
51
52 // toasts for what changed since the last look (none on the first look)
53 if (known) {
54 for (const x of mine) {
55 if (known.has(x.id)) continue
56 if (x.to === me) {
57 $.ui.toast(`⇠ synapse: ${x.fromName} connected. Its context flows in with your next prompt.`, { timeoutMs: 6000 })
58 } else {
59 $.ui.toast(`⇢ synapse: now sharing this session with ${x.toName ?? 'an agent'}`, { timeoutMs: 6000 })
60 }
61 }
62 for (const [id, x] of known) {
63 if (!mine.some(y => y.id === id)) $.ui.toast(`synapse: unlinked ${x.to === me ? x.fromName : x.toName ?? 'an agent'}`)
64 }
65 }
66 if (seenMessages) {
67 for (const m of unread) {
68 if (!seenMessages.has(m.id)) $.ui.toast(`✉ synapse: message from ${m.fromName}, delivered with your next prompt`, { timeoutMs: 6000 })
69 }
70 }
71 known = new Map(mine.map(x => [x.id, x]))
72 seenMessages = new Set(unread.map(m => m.id))
73
74 const peer = (name: string | undefined, color: string | undefined, kind: string | undefined): Peer => ({
75 name: name ?? '?',
76 color: color ?? ACCENT,
77 kind: kind ?? '',
78 })
79 const fresh: View = {
80 incoming: mine.filter(x => x.to === me).map(x => peer(x.fromName, x.fromColor, x.fromKind)),
81 outgoing: mine.filter(x => x.from === me).map(x => peer(x.toName, x.toColor, x.toKind)),
82 unread: unread.length,
83 unreadFrom: [...new Set(unread.map(m => m.fromName))],
84 }
85 if (JSON.stringify(await read($, view)) !== JSON.stringify(fresh)) await update($, view, () => fresh)
86 }
87
88 timer?.cancel()
89 await poll()
90 timer = $.clock.every(POLL_MS, () => void poll())
91 return started
92 })
93
94 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
95 const v = await read($, view)
96 if (e.props.hasSurvey || !v || (!v.incoming.length && !v.outgoing.length && !v.unread)) return next(e)
97
98 const { Box, Text } = $.ui.resolve(e)
99 const list = (peers: Peer[], prefix: string) =>
100 peers.map((p, i) => (
101 <Text key={`${prefix}${i}`}>
102 <Text color={p.color}>● </Text>
103 <Text>{p.name}</Text>
104 {p.kind ? <Text dimColor> {p.kind}</Text> : null}
105 <Text>{' '}</Text>
106 </Text>
107 ))
108
109 return (
110 <Box>
111 <Text color={ACCENT} weight="bold">◉ synapse </Text>
112 {v.incoming.length ? <Text dimColor>reads ⇠ </Text> : null}
113 {list(v.incoming, 'in')}
114 {v.outgoing.length ? <Text dimColor>shares ⇢ </Text> : null}
115 {list(v.outgoing, 'out')}
116 {v.unread ? (
117 <Text color={ACCENT}>✉ {v.unread} from {v.unreadFrom.join(', ')}</Text>
118 ) : null}
119 </Box>
120 )
121 })
122}
123types/index.d.ts 9 lines1export type Peer = { name: string; color: string; kind: string }
2export type View = { incoming: Peer[]; outgoing: Peer[]; unread: number; unreadFrom: string[] }
3
4declare module 'claude-code' {
5 interface PluginState {
6 'synapse-tui': { view: View | null }
7 }
8}
9