One Agent Harness
This server bridges AI coding-agent sessions by extracting and transferring context across Claude Code, Antigravity, Codex, and Grok Build CLI.
Pull verbatim conversation turns, plans, task lists, modified/read files, terminal errors, git state, and cross-platform session snapshots.
List recent sessions with IDs, titles, working directories, turn counts, and timestamps.
Search across all agents’ transcripts, plans, and modified file paths by keyword, error, or filename.
Save checkpoint summaries and next steps for the next agent.
Inject a context bundle into a target agent’s native session store for native resume.
Enables cross-agent context handoff with OpenAI Codex by extracting session context and artifacts from Codex sessions and injecting them into Codex, including native session resumption and $handoff support.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@One Agent Harness hand off my latest Claude Code session to Codex and launch it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
One Agent Harness (harness)
Universal Cross-Agent Context Bridge for Claude Code, Antigravity, OpenAI Codex, and Grok Build CLI.
Never re-explain your problem or manually copy-paste context when switching AI coding tools. One Agent Harness extracts your exact verbatim conversation turns, active implementation plans, task lists, modified files, terminal errors, and uncommitted git state from any agent and injects or hands them off to any other agent in one command.
Supported Platforms & Operating Systems
AI Coding Agent | Session & Artifact Storage | Native Session Injection | MCP & |
Claude Code |
| ✅ | ✅ |
Antigravity |
| ✅ | ✅ |
OpenAI Codex |
| ✅ | ✅ |
Grok Build CLI |
| ✅ | ✅ |
Works out of the box on Linux (X11, Wayland, WSL2, SSH/OSC 52), macOS, and Windows (PowerShell, CMD, Windows Terminal, Git Bash) with zero external runtime dependencies (100% Python 3.9+ standard library).
Related MCP server: passoff
Installation (Linux · macOS · Windows)
Option 1: One-Line Bootstrap Installer (Recommended)
Linux & macOS (bash / zsh / sh):
git clone https://github.com/ajmainapon/one-agent-harness.git
cd one-agent-harness
chmod +x install.sh && ./install.shWindows (PowerShell):
git clone https://github.com/ajmainapon/one-agent-harness.git
cd one-agent-harness
.\install.ps1Option 2: Standard Python Package (pipx, uv, or pip)
# Install globally with pipx or uv (Linux, macOS, Windows)
pipx install .
# or: uv tool install .
# or: pip install -e .
# Register MCP server + /handoff & $handoff skills across all 4 agents
harness install
# Start background Auto-Sync Watcher daemon
harness watch --daemonUsage Guide
1. Inside Any Agent Chat (/handoff & $handoff)
No need to remember session UUIDs! Pass a session number (1, 2, 3), project name, keyword, or agent name:
In Claude Code, Antigravity, or Grok Build CLI:
/handoff(loads the latest active session)/handoff my-project(fuzzy-matches your project or session title)/handoff 2(loads session#2from the recent sessions list)/handoff claude(loads your latest Claude Code session)
In OpenAI Codex (
v0.162.1+):$handoff,$handoff my-project, or$handoff 2(Codex reserves/for built-in TUI commands and uses$for skills).
2. Zero-Flag Terminal Shorthands
Run harness (with no arguments) to see the colorized dashboard with numbered sessions (#1, #2, #3, ...):
# View colorized dashboard of all recent sessions across all 4 platforms
harness
# Interactive menu — pick a session & action by number
harness pick
# 1-command switch into an agent (accepts session number, project keyword, or agent alias)
harness codex # Inject latest session into Codex & launch
harness codex 3 # Inject session #3 into Codex & launch
harness codex "auth refactor" # Inject session matching "auth refactor" into Codex & launch
harness claude 2 # Inject session #2 into Claude Code & launch
harness agy 1 # Inject session #1 into Antigravity
# Copy any session's full handoff bundle to system clipboard
harness copy # Copy #1 latest session
harness copy 2 # Copy session #2
harness copy "auth" # Copy session matching "auth"
# Read context without writing files or changing your clipboard
harness handoff "auth refactor" --read-only
# Preview a switch without changing files or clipboard
harness codex "auth refactor" --dry-run
# Search across all 4 platforms' transcripts & touched files
harness search "keyword"3. Selecting the Right Session
Use the same filters when listing and selecting sessions:
harness status --agent claude --cwd /path/to/project
harness handoff 1 --from claude --cwd /path/to/projectNumbers refer to the filtered list and may change when new sessions become active. Use --session <session-id> for a stable selection. A query or workspace with no match reports an error instead of loading an unrelated project. With no filters, the latest substantive session is selected.
4. Saving and Recovery
Handoffs save to
.harness/LIVE_CONTEXT.mdand.harness/bundle.jsonin the workspace. If the workspace cannot be written, Harness reports the fallback location under~/.harness.If neither location is writable, CLI and MCP still return the extracted context with a warning.
--read-onlyprints context without attempting a save or clipboard change.Use
--no-update-agent-mdto save a handoff without updating existingAGENTS.mdorCLAUDE.mdpointers. Use--no-copyto leave your clipboard unchanged.The watcher syncs the latest session in each workspace and retries failed saves. One unavailable workspace does not block the others.
User prompts are preserved in full within the selected turns. Long assistant responses and artifacts may still be shortened. Claude plans are included only when the session explicitly read or modified them.
Installation validates existing JSON settings before making changes and backs up every existing MCP JSON config, including Grok. If a config is malformed, repair the indicated file and rerun
harness install; the original is left unchanged.
5. Environment Variable Overrides
All storage paths default to standard user home directories on Linux, macOS, and Windows (~ / %USERPROFILE%), and can be customized via environment variables:
Environment Variable | Default Path | Description |
|
| Claude Code data directory |
|
| Antigravity data directory |
|
| OpenAI Codex data directory |
|
| Grok Build CLI data directory |
|
| One Agent Harness state, logs, and checkpoints |
Running the Test Suite
python3 -m unittest discover -s tests -vLicense
MIT License — see LICENSE.
Available Tools
5 toolsinject_session_to_agentB
Convert and inject the latest context bundle directly into a target agent's native session store ('claude', 'codex', 'antigravity', or 'grok') so it can be resumed natively.
Inputs: to_agent (required), cwd, from_agent, session_id.
list_recent_sessionsB
List recent coding sessions across Claude Code, Antigravity, Codex, and Grok Build CLI with session IDs, titles, working directories, turn counts, and timestamps.
Inputs: cwd, agent, limit.
pull_handoff_contextA
Pull the exact context (verbatim recent conversation turns, implementation plans, task checklists, modified/read files, terminal commands/errors, and git state) from the user's previous session in Claude Code, Antigravity, Codex, or Grok Build CLI. Also returns a snapshot of the latest active sessions across all other platforms. Call this whenever the user says '/handoff', '$handoff', 'continue from my last session', or switches from another agent.
Inputs: cwd, query, max_turns, session_id, +2 more.
save_checkpoint_noteA
Save an explicit checkpoint summary and next steps so the next agent you open receives it at the top of its handoff context.
Inputs: summary (required), cwd, next_steps.
search_cross_agent_historyA
Search across all 4 agents' conversation transcripts, plans, and modified file paths for a keyword, error message, or filename.
Inputs: query (required), agent, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct action: pull context, list sessions, search history, save checkpoint, and inject into an agent. There is minor overlap between pull_handoff_context (which also returns an active session snapshot) and list_recent_sessions, but the descriptions clarify their primary purposes.
All tools follow a consistent snake_case, verb-first convention (pull_, list_, search_, save_, inject_). The prepositional suffix in inject_session_to_agent is a slight variation but remains readable and predictable.
Five tools is well-scoped for a cross-agent handoff harness, with each tool covering a necessary operation (pull, list, search, save, inject). There is no redundancy or obvious missing tool at this scale.
The toolset covers the core lifecycle: reading context (pull, list, search) and writing/injecting (save checkpoint, inject). Minor gaps exist, such as updating or deleting saved checkpoint notes, but agents can work around these.
Maintenance
Related MCP Connectors
Sync coding-agent sessions and resume them in any other agent: Claude Code, Codex, Cursor, more.
Hand off work between AI agents in any tool. Start Devin or Cursor cloud and share memory.
Your AI apps as one team: hand work to Codex or Claude Code on your Mac, with a shared logbook.
Shared memory and context across ChatGPT, Claude, Claude Code, Codex, Cursor and 20+ AI tools
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI coding assistants like Claude Code, Cursor, and Codex to share chat logs, terminal history, and session context with each other. Eliminates the need to re-explain context when switching between different AI coding tools.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables handoff of context between AI coding agents like Claude Code, Cursor, Codex, and Windsurf with built-in provenance tracking.MIT
- AlicenseNot gradedqualityBmaintenanceUniversal context, rules & handoff bridge for AI coding tools (Cursor, Claude Code, GitHub Copilot, Cline, Antigravity, Windsurf).92 npm8MIT
- AlicenseAqualityBmaintenanceUniversal session & handoff layer for AI coding agents: shared task, decision, blocker and test state, checkpoints, and deterministic handoff between Claude Code, Codex, OpenCode, Cursor, Cline, pi and omp. Local SQLite, git-aware, 25 tools + 7 resources over stdio or streamable-http.26MIT