Claude Code Integration
Fastest path — once per machine:
nerveplane setup # global hooks + login service + register this repo
claude mcp add --scope user nerveplane -- nerveplane mcp # MCP server for all projects
# restart Claude CodeThis installs the hooks at user scope (~/.claude), so there's no per-repo setup — every agent you launch auto-registers, and warnings/DMs are injected before edits.
If you'd rather wire a single repo (project scope):
claude mcp add nerveplane -- nerveplane mcp # register the MCP server
nerveplane install claude-code # project-scoped hooks + instructions
# restart Claude Code1. The MCP server (claude mcp add)
claude mcp add nerveplane -- nerveplane mcp registers Nerveplane's seven MCP tools the idiomatic way. The spawned stdio server is a thin bridge that proxies to the daemon's REST API, keeping the daemon the single writer.
- Scope: add
--scope user(all your projects) or--scope project(commit a shared.mcp.json); default is local to you. - HTTP transport (no stdio bridge):
claude mcp add --transport http nerveplane http://127.0.0.1:7734/mcp— the same seven tools are served over both transports from one definition.
2. The hooks (nerveplane install claude-code)
This is the piece claude mcp add can't do. Three hooks:
SessionStart→ runsnerveplane session-start, which auto-registers the agent for the current worktree the moment a session begins — so registration never depends on the model remembering to callregister. It also seeds the session with a short coordination summary (active peers + "callsync").PreToolUse→ routing puts a warning in an agent's inbox, but routed ≠ read — MCP has no reliable server→agent push. Before the agent runsEdit/Write/MultiEdit, this hook resolves the agent for the current worktree and injects any unread high-severity warnings and direct messages straight into its context. It always exits 0 and never blocks the edit.Stop→ runsnerveplane stop-checkwhen the agent finishes a turn. A Claude agent is turn-based with no background loop, so a teammate's DM would otherwise sit unread until the agent next acts. If there are unread direct messages, this hook returns ablockdecision ({"decision":"block","reason":…}) so the agent handles them before going idle — autonomous reply, no human needed. It's loop-safe (honorsstop_hook_active) and only blocks on direct messages (not info events). This makes concurrently-active agents ping-pong on their own; waking a fully-parked agent needs the always-on worker model (see the roadmap).
nerveplane install claude-code writes (under .claude/ for the project, or ~/.claude/ with --global):
settings.json— theSessionStart+PreToolUse+Stophooks.nerveplane-instructions.md— the agent protocol (below).- appends the instructions
@importtoCLAUDE.md(idempotent) so they load automatically — no copy-paste.
Flags: --global (user scope — install once, applies to all repos), --with-mcp (also write a project .mcp.json — use this if you don't have the claude CLI), --print (dry-run).
3. The agent protocol (auto-imported into CLAUDE.md)
- You're auto-registered at session start; call
registerto add your capabilities/task and read the join packet. - Periodically and before finalizing, call
sync. - Before changing API contracts, DB schemas, or shared types, call
publish. - Record durable decisions with
decision. - To talk to a specific agent, use
chat(andchat action='wait'to block for a reply). When you finish a turn with unread teammate messages, theStophook asks you to handle them before going idle.
Other clients
The Streamable HTTP endpoint (http://127.0.0.1:7734/mcp) works with any HTTP-MCP client (Cursor, Codex, custom agents) — register it the same way with claude mcp add --transport http … or your client's MCP config.