Multi-agent coordination

Plan on your expensive agent.
Pass the baton to your cheap one.

Baton coordinates multiple AI coding agents — Claude Code, Cursor, Codex, Gemini — on one repo. Isolated git worktrees, a live dashboard, shared memory, and one-file session handoff. No server lock-in. Open source.

The problem

You run three AI coding agents. They don't know about each other.

Two of them just edited the same file.

Your expensive agent hit its limit mid-task and all that context died with the session.

Session handoff
01

Plan

baton new cuts a branch (baton/my-task) plus an isolated git worktree at .baton/wt/my-task. Claude Code plans there — no other agent's files in reach — while every session event streams into a JSONL buffer.

git worktree add · branch baton/my-task · session → JSONL
$ baton start my-task --agent claude
02

Pass

One command distills that buffer into HANDOFF.md: objective, plan, remaining checklist, and an estimated cost to finish. Plain markdown in the worktree — it survives crashed sessions and diffs like code.

frontmatter: objective · plan · remaining · est_cost_usd
$ baton pass my-task --to cursor
03

Take

Cursor picks the brief up: the execution prompt prints, the task flips to in-progress — same worktree, same branch, zero re-explaining. If commits landed after the brief was written, a stale-brief warning says: trust git, not the brief.

prompt prints between delimiters — pipe it into any CLI agent
$ baton take my-task
04

Coordinate

Editor hooks record every file touch as an edit signal in a local SQLite store; the daemon streams them over SSE. Two agents on one file flashes an overlap — before the conflict, not at merge time.

agents ask check_files over MCP before touching a path
$ baton signals
05

Done & merge

done files a completion report to .baton/reports/ — what shipped, what it cost. merge squash-merges the branch back and reclaims the worktree; baton history keeps every file's trail queryable.

squash merge · report archived · per-file history stays
$ baton done my-task
Step by step, with the real commands — see the full walkthrough →
Features

Everything between your agents, handled.

Knowledge graph

Your repo, indexed into a queryable graph. Agents navigate instead of grepping.

Session handoff

One markdown file carries the whole session: objective, plan, checklist, cost estimate.

---
objective: SSE reconnect backoff
remaining_tasks: 3
est_cost_usd: 0.05
---

Worktree isolation

Every agent gets its own git worktree. No clobbered branches, ever.

Live edit signals

See who's editing what, in real time. Overlaps warn before they conflict.

src/server/sse.ts
src/ui/StatusPanel.tsx
src/shared/events.ts

Evidence-anchored memory

Shared facts pinned to commits and content hashes. Stale facts get withheld — agents can't hallucinate from them.

auth uses JWT, not sessions⚓ 4f2c91a
db client is knexwithheld

Installable skills

Ten agent playbooks, installed into each agent's own config. bug-fix won't touch a line until an independent skeptic corroborates the root cause at 95% — and you approve.

.claude/skills
.cursor/rules
10 skills

Model routing

Every task scored by severity, then routed into a tier — no LLM call, deterministic, and it tells you why. The bottom tier runs a local model, so it costs nothing at all.

heavy · opus
standard · cursor
light · codex
local · ollama
~0×

Cost arbitrage

Agents read the graph's repo map instead of raw files.

repo map · ~824 tokens
raw files · ~248k tokens
Built honest
Zero-dependency daemon — raw node:http
SSE, not socket.io
Plain-markdown handoffs
tmux-backed agent terminals
Git-native: no external database
MCP tools for every agent
Loopback-only — Origin + Host screened
Dashboard

Watch the relay live.

localhost:7077
Activity
claudecommittedsrc/server/sse.ts12s
cursoreditingsrc/ui/StatusPanel.tsxnow
claudepinned factmemory/auth-jwt1m
codextook handofffix-flaky-tests3m
cursoropened worktree.baton/wt/my-task4m
claudepassedmy-task → cursor5m
Conflicts · 1
src/shared/events.ts
claude + cursor editing — warned both
tmux · claude
4 tests passing
watching src/server …
tmux · cursor
resuming from HANDOFF.md
worktree clean

A realtime dashboard on localhost:7077. Activity, conflicts, terminals, memory, the graph.

Open source

Baton is open source.

Plain markdown, plain git, plain HTTP. Nothing proprietary between you and your agents.

License · AGPL-3.0