batonprotocol
01 / 06 RELAY HANDOFF
GitHub ↗ Install MCP
CLAUDE-CODE · BATON_PASS
MCP PROTOCOL v0.1 · ZERO DEPS

Keep the
work moving.

When one AI coding agent hits a context limit or stops, the next one — even a different tool — picks up the exact plan, gotchas, and next step from one shared .baton/ folder.

LIVE RELAY SIMULATION PASS #04 READY
CLAUDE CODE baton_pass({ handoffNote, next })
ON DISK .baton/baton.json + HANDOFF.md
CODEX baton_pick_up() -> continues seamlessly
ZERO TRANSCRIPT REPLAY
ON-DISK CONTRACT PER PROJECT ROOT
project-root/
  HANDOFF.md              # human & agent mirror
  CLAUDE.md -> AGENTS.md  # bridged by baton_init
  .baton/
    baton.json            # live structured state
    ledger.jsonl          # append-only history

Every agent loads the exact same rules and live handoff — no vendor silos.

02 / 06 · BATON_INIT · SHARED BRAIN

One symlink.
Zero blind sessions.

Claude Code auto-reads CLAUDE.md; Codex reads AGENTS.md. baton_init bridges them into one shared instruction file and initializes .baton/ cleanly in seconds.

03 / 06 · BATON_PASS · MERGE RULES

Intent outlives
the context window.

Baton separates growing memory from forward action: completed work and gotchas append across passes while next steps and key files stay crisp and current.

MERGE SEMANTICS
done[] & watchOut[] — Cumulative Memory

Every pass appends new completed items and discovered gotchas so later sessions never repeat a trap you already solved.

.baton/ledger.jsonl
14:02 [claude-code] pass: migrated 25 project folders
14:05 [codex] pick_up: reading baton #3
14:31 [codex] pass: rebuilt venvs, tests 100% green
04 / 06 · LEDGER.JSONL · CRASH-SAFE

Every breadcrumb
survives a crash.

Each init, pick_up, log, and pass appends a single JSON line tagged with BATON_AGENT. Even if a session dies mid-task, the exact trail stays intact.

05 / 06 · BATON_PICK_UP · 6 VERBS

Six tiny tools.
Instant continuity.

Add one line to your project instructions: call baton_pick_up at session start and baton_pass before stopping. Works identically across every MCP client.

ALL 6 MCP TOOLS STDIO JSON-RPC 2.0
baton_statusCHECK baton_pick_upRESUME baton_passHANDOFF baton_logNOTE baton_historyTRAIL baton_initSETUP

Auditable in a single file (server.mjs) with zero npm runtime dependencies.

CLIENT SETUP SNIPPET
claude mcp add baton -e BATON_AGENT=claude-code -- npx -y github:timurabi3/baton-mcp
06 / 06 · SERVER.MJS · ZERO DEPS

One file.
Works with every agent.

No cloud account, no database daemon, no third-party telemetry. Runs directly via npx -y github:timurabi3/baton-mcp on Node.js with stdout kept strictly protocol-only.

MIT OPEN SOURCE · ZERO DEPENDENCIES

Pass the baton.
Never lose momentum.

Run Baton directly from GitHub via npx — no npm publish lag, no vendor lock-in, and plain Markdown + JSON you can inspect in git anytime.

npx -y github:timurabi3/baton-mcp
View on GitHub