Skip to main content
Glama

🏃 Baton

Continues where you left off.

Baton is a tiny, zero-dependency MCP server that gives your AI coding agents a shared relay baton. When one agent (or one session) runs out of context and stops, the next one — even a different agent — picks up exactly where the last left off.

Works with Claude Code, Codex, and any MCP-capable client. One .baton/ folder per project is the shared brain.


The problem

Two agents on the same repo still can't hand off work:

  • Instructions are siloed. Claude Code auto-reads CLAUDE.md; Codex auto-reads AGENTS.md. Point both at one folder and one of them starts blind.

  • Session state is private and lossy. Claude stores transcripts in ~/.claude/…, Codex in ~/.codex/…. Neither reads the other's, and replaying a raw transcript is expensive and lossy. The intent — which step you're on, what you just learned, why you stopped — lives in the context window and dies when the session ends.

So "let Codex continue what Claude started" fails: the second agent sees the files but not the plan.

Related MCP server: SloplessCode

The fix

Baton writes the intent to disk in an agent-neutral format both sides read:

  • HANDOFF.md — human- and agent-readable "where we stopped / what's next."

  • .baton/baton.json — structured live state (done, next, open questions, gotchas, key files).

  • .baton/ledger.jsonl — append-only history (crash-resilient: breadcrumbs survive even if an agent dies mid-task).

  • baton_init bridges CLAUDE.mdAGENTS.md with a symlink so both agents load the same instructions.

Install

# no install needed — runs from GitHub via npx
npx -y github:timurabi3/baton-mcp

Claude Code

# identify this agent in handoffs with BATON_AGENT:
claude mcp add baton -e BATON_AGENT=claude-code -- npx -y github:timurabi3/baton-mcp

Codex — ~/.codex/config.toml

[mcp_servers.baton]
command = "npx"
args = ["-y", "github:timurabi3/baton-mcp"]
env = { BATON_AGENT = "codex" }

Then add one line to your instructions (CLAUDE.md / AGENTS.md):

At session start, call baton_pick_up. Before you stop, call baton_pass.

An unrelated package named baton-mcp exists on npm — install from GitHub as shown above.

Tools

Tool

When

baton_status

Session start — is there a baton here?

baton_pick_up

Continue where the last agent left off. Returns full handoff + recent ledger.

baton_pass

Stopping — record where you left off (merges; rewrites HANDOFF.md).

baton_log

Mid-task progress breadcrumb.

baton_history

Read the recent ledger.

baton_init

Create .baton/ + bridge CLAUDE.mdAGENTS.md.

The relay in practice

Claude Code  ──(hits context limit)──►  baton_pass { handoffNote, next, watchOut }
                                              │  writes .baton/ + HANDOFF.md
Codex        ──(fresh session)────────►  baton_pick_up  ◄── reads it, continues

BATON_AGENT env tags each pass, so the ledger reads like a relay log:

14:02 [claude-code] pass: moved 25 project folders; venvs for ayra-caller/cashclaw need rebuild
14:05 [codex]       pick_up
14:31 [codex]       pass: rebuilt venvs, wired both agents

Design notes

  • Zero dependencies. MCP stdio is newline-delimited JSON-RPC 2.0 — implemented directly, so npx works offline and the whole thing is auditable in one file.

  • stdout is protocol-only; all logs go to stderr.

  • Storage is per-project (.baton/ under the project root, override with BATON_PROJECT).

  • The on-disk contract is spelled out in PROTOCOL.md.

License

MIT © Timur Abi

Available Tools

6 tools
baton_historyB

Read the recent handoff/progress ledger for this project.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
projectNo

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The word 'Read' signals a read-only operation, which is useful since no annotations are provided. 'Recent' hints at temporal ordering, but the description does not disclose pagination, default limits, required project context, or what happens with omitted parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no redundancy. It is appropriately brief for a read operation, though additional parameter detail would make it more useful without hurting structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations, no output schema, and no parameter descriptions, the description carries too much burden and falls short. It leaves the agent unsure what 'limit' controls, how 'project' is specified, what the returned ledger looks like, and how this tool differs from baton_log or baton_status.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description only weakly maps to the 'project' parameter via 'for this project'. The 'limit' parameter is completely unexplained, including whether it caps the number of entries or controls pagination. The description does not compensate for the missing schema detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('Read') and a specific resource ('recent handoff/progress ledger'), so an agent can tell the basic purpose. It does not explicitly differentiate from siblings like baton_log or baton_status, but the 'history' focus is reasonably clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for reviewing recent history, but it never states when to use this over baton_log or baton_status, and it provides no exclusions or alternative routing. The usage context is present but only by implication.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

baton_initA

Set up Baton for a project: create .baton/ and bridge CLAUDE.md <-> AGENTS.md (symlink) so both Claude Code and Codex read the same instructions.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden. It states what the tool creates (.baton/ directory) and what it modifies (symlinks CLAUDE.md and AGENTS.md), which is good. However, it does not disclose potential side effects such as overwriting existing files, whether the symlink replaces one side, idempotency, or whether the tool fails if one of the files does not exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficiently structured sentence that front-loads the purpose and then lists the concrete actions. Every word earns its place, and it avoids redundancy with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and an undocumented parameter, the description is incomplete. An agent knows the broad setup intent but not what value to pass for 'project,' whether the tool needs to be run from a particular directory, or what the success/failure behavior looks like. The missing parameter guidance is the most significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has one parameter ('project') with zero description coverage, and the tool description never mentions 'project,' its format, default behavior, or how it affects the setup. Since schema coverage is 0%, the description had a full responsibility to explain this parameter and completely failed to do so.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('Set up'), a specific resource ('Baton for a project'), and the concrete actions ('create .baton/' and 'bridge CLAUDE.md <-> AGENTS.md (symlink)'). This clearly distinguishes it from sibling tools like baton_status, baton_pass, or baton_history, which are clearly operational rather than initialization actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies when to use this tool: when setting up Baton for a new project, and it explains the intended outcome. It does not explicitly name alternatives or exclusions, but the init/operation distinction among siblings is strong enough that an agent can infer the correct context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

baton_logA

Drop a lightweight progress breadcrumb into the ledger without a full baton pass. Use for mid-task milestones.

ParametersJSON Schema
NameRequiredDescriptionDefault
noteYes
projectNo

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It does disclose that the operation is lightweight and non-handoff, which is useful behavioral context. However, it does not explain persistence, side effects, permissions, or failure behavior, leaving some transparency gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences with no filler. The core action is stated first, and the usage qualifier is added second, making it highly scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter tool with no output schema, the when-to-use context is adequate. But the absence of any parameter explanation and minimal behavioral detail means an agent still has to infer some invocation specifics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description gives no meaning to either 'note' or 'project.' The agent must rely entirely on parameter names and general context, so the description fails to compensate for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific action ('Drop'), a specific resource ('breadcrumb into the ledger'), and explicitly contrasts it with a full baton pass, distinguishing it from sibling baton_pass. This makes the tool's purpose immediately clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description says 'Use for mid-task milestones,' which is clear when-to-use guidance. It also implies avoiding this tool for full handoffs by saying 'without a full baton pass,' though it does not explicitly name which sibling tool to prefer in that case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

baton_passA

PASS THE BATON. Record where you're stopping so the next agent/session continues seamlessly. Merges with existing state — pass only the fields you want to update. Rewrites HANDOFF.md.

ParametersJSON Schema
NameRequiredDescriptionDefault
doneNoCompleted items (appended)
goalNoThe overall objective
nextNoConcrete next steps (replaces)
taskNoShort title of the work
filesNoKey files as 'path — why it matters' (replaces)
statusNo
projectNo
watchOutNoGotchas learned (appended)
handoffNoteYesCRITICAL: exactly where you stopped and why — the thing that dies with your context otherwise
openQuestionsNo

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states the key side effects: it rewrites HANDOFF.md and merges with existing state, meaning only passed fields are updated. It does not cover auth or return values, but the most important behavioral traits are disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only three short sentences, front-loaded with purpose and behavior. 'PASS THE BATON' is memorable but not padding; every sentence adds information. It earns its place without fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the 10-param schema and no output schema, the description covers the essential context: when to call, what side effect occurs, and the merge behavior. The required handoffNote is highlighted as CRITICAL in the schema itself. The main gap is not explicitly routing between siblings like baton_log, but the description is sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 70%, and the description contributes a valuable global semantic: pass only the fields you want to update, others merge from existing state. This helps interpret the append/replace differences already encoded in the schema. However, it does not add detail for under-covered parameters like openQuestions or project, so compensation is partial.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('PASS THE BATON', 'Record where you're stopping') tied to a concrete resource ('Rewrites HANDOFF.md'). It also explains the merge behavior, which distinguishes it from the sibling tools like baton_status, baton_pick_up, or baton_history. This goes well beyond a tautological restatement of the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description makes the intended scenario clear: use this when stopping work so the next agent/session can continue seamlessly. It does not explicitly name alternatives or exclusions, so it does not reach the top score, but the context is unambiguous and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

baton_pick_upA

PICK UP THE BATON. Returns the full current handoff state + recent history so you continue exactly where the previous agent (or session) stopped. Call this before doing any work if a baton might exist.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations, so the description carries the full burden of disclosing side effects and behavioral traits. While it says the tool 'Returns' state and history, which implies a read operation, the tool name 'pick_up' suggests it could also claim or modify the handoff state. The description does not clarify whether calling it consumes, locks, or otherwise changes the baton, leaving important ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only two sentences, front-loads the operation with 'PICK UP THE BATON,' and includes both return content and usage timing. Every sentence earns its place, and there is no redundant repetition of schema or annotation information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool, the description covers the main purpose and when to call it, which is enough for basic use. However, it omits parameter semantics, does not clarify potential side effects, and, with no output schema, does not describe the shape of the returned state/history. These gaps leave the description minimally viable but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description never mentions the optional 'project' parameter. The agent must infer its meaning from the parameter name alone. Since the parameter is optional and simple, this is less severe than a multi-parameter gap, but the description still fails to compensate for the absent schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool picks up the baton and returns the full current handoff state plus recent history, so the agent knows exactly what the resource and operation are. It also expresses the unique role of resuming where a previous agent stopped, which separates it from sibling status/history tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear, actionable usage rule: 'Call this before doing any work if a baton might exist.' This tells the agent when to invoke it, though it does not explicitly mention when not to use it or compare it to alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

baton_statusA

Check if a baton (handoff state) exists for this project and get a one-glance summary. Call this at session start.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNoProject root path (default: cwd)

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden. 'Check' and 'get a one-glance summary' imply a read-only operation, but the description does not explicitly state that it has no side effects or describe what the summary contains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, no filler, and the key action and timing are front-loaded. Every sentence contributes behavioral or usage guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple optional-parameter status check, the description provides the essential purpose, timing, and output shape. The only minor omission is a more concrete indication of what the summary includes, but that does not block correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter is project, and schema coverage is 100%; the description adds no parameter-level detail beyond that, which is acceptable given the baseline for full schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action (check existence) and resource (baton/handoff state) plus the deliverable (one-glance summary). It reads clearly as a status/read sibling to the action-oriented baton tools, though it does not explicitly contrast with baton_history.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs 'Call this at session start,' giving the agent a clear trigger condition. It does not list exclusions or alternatives, but the sibling names make the intended role evident.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation4/5

Most tools map to a distinct step in the handoff workflow with clear usage cues. status, history, and pick_up all expose handoff information at different levels of detail, so there is minor potential for confusion among the read-focused tools.

Naming Consistency4/5

All tools share the baton_ prefix and use snake_case, which makes the set feel coherent. The mix of verb-like names (pick_up, pass, log, init) and noun-like names (status, history) is a small inconsistency, but the pattern remains predictable.

Tool Count5/5

Six tools is well-scoped for a handoff utility: setup, status check, pick-up, history, progress logging, and passing cover the workflow without unnecessary bloat.

Completeness4/5

The core lifecycle is covered: initialize, check, pick up, log progress, and pass the baton. The main gap is the lack of a reset, clear, or discard operation for ending or resetting a handoff state.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides operational continuity for AI coding agents, preserving task state, decisions, checkpoints, and project context across sessions and model switches via MCP.
    1
    Apache 2.0
  • A
    license
    A
    quality
    A
    maintenance
    A shared working-state layer for AI coding tools that provides a persistent notebook for decisions, tasks, and handoffs, enabling seamless context sharing between Claude, Cursor, and other MCP clients.
    13
    Apache 2.0

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/timurabi3/baton-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server