Pass context between coding agents like a baton.
baton is a terminal-native workspace that lets Claude Code, Codex, and DeepSeek Harness share one durable conversation. Switch agents without copying context, reopen the work later, or let Plugins keep it moving after an interactive turn ends.
A BatonSession belongs to you rather than to any Harness. Native sessions make resume faster, but baton keeps the logical history available even when a native session cannot be resumed. The bundled Harnesses are only the starting set.
Most multi-agent workflows turn the human into a context courier: copy an answer, explain the task again, and hope the next agent sees the same picture. baton replaces that relay race with a workspace where context is durable, agents stay native, and longer-running work can continue through explicit human and Plugin coordination.
- Work with Claude Code, Codex, and DeepSeek Harness in one terminal-native interface, switching targets, models, and modes while preserving each Harness's native experience.
- Own durable BatonSessions that unify history across Harnesses, reopen or fork work, adopt native sessions, and bring Session or Plugin context into later turns.
- Turn one chat into a long-running workflow: Plugins can ask for decisions, prepare editable drafts, wake on schedules or events, and delegate work to the mainline or asynchronous side lanes.
- Install third-party Plugins from local or Git Marketplaces without handing baton your provider credentials; each Plugin runs in its own supervised process.
Install baton with npm. You also need at least one supported runtime: an authenticated Codex CLI, Claude Code, or a DeepSeek Harness JSON-RPC runtime configured for the DSH Agent SDK.
npm install -g @compforge/batonOr try it without a global install:
npx @compforge/batonStart the TUI in your project and type a prompt:
batonThe essential commands are:
/claude or /cc Switch to Claude Code
/codex or /cx Switch to Codex
/dsh or /deepseek Switch to DeepSeek Harness
/target Pick a configured Harness target
/model Pick a model for the active Harness
/effort Set reasoning effort
/plan Toggle Plan mode
/sessions Open a previous BatonSession
/new Start a clean BatonSession
@ Search Session and Plugin context
Ctrl+V Paste text or a clipboard image
Esc Interrupt the current turn
Add a message to a switch command to route it immediately, for example /cx review this diff or /cc implement the fix.
baton -c # Continue the latest session in this project
baton -s bs_01... # Open a BatonSession by ID
baton resume [bs_xxx|native-id] # Resume a Baton or native Harness session
baton fork [bs_xxx|native-id] # Fork into a new BatonSession
baton sessions # List referenceable sessionsbaton can detect Codex and Claude Code session IDs without modifying their files. It imports their durable history into a user-owned BatonSession; resume continues the source, while fork starts a new branch of work. Reference any listed session in a later prompt:
@bs_01... Implement this feature based on Claude's earlier analysis
Plugins can ask for a decision, prepare a draft for editing, delegate a turn to a Harness, update a shared Board, or wake again from Resource changes and schedules. Install them from a local or Git Marketplace:
baton plugins marketplace add ./reqloop
baton plugins available
baton plugins install qiankun/requirement-loop
baton plugins listEach active third-party Plugin runs in its own supervised process. A blocked or crashed Plugin does not take over the terminal, and provider credentials remain in the Harness that owns them.
On first run, baton creates ~/.baton/config.yaml:
defaultTarget: codex
targets:
codex:
harness: codex
command: [codex, app-server]
claude:
harness: claude
dsh:
harness: dsh
# command: [dsh-jsonrpc-agent, /absolute/path/to/cordis.yml]
model: prod
mentionBudgetChars: 4096
showThoughts: trueSee config.yaml.example for all options. baton reuses each Harness's existing credentials and runtime configuration instead of copying provider secrets. Codex approvals continue to follow ~/.codex/config.toml unless targets.codex.approvalReviewer delegates them; Claude Code can use targets.claude.executable; DeepSeek Harness uses the command configured in targets.dsh.command.
baton stores its configuration, attachments, Plugins, projects, and durable session history under ~/.baton/. Each Harness continues to own its private native sessions; baton never edits those files and stores only the binding needed to resume them. Use baton logs [session-id] to inspect the private, rotated operational log for a session.
Apache-2.0