Skip to main content
Glama
One Agent Harness

One Agent Harness

by ajmainapon

One Agent Harness (harness)

Universal Cross-Agent Context Bridge for Claude Code, Antigravity, OpenAI Codex, and Grok Build CLI.

CI (Linux · macOS · Windows) Platform: Linux | macOS | Windows Python 3.9+ Zero Dependencies License: MIT

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 & /handoff / $handoff

Claude Code

~/.claude/projects/ & ~/.claude/plans/

✅ claude --resume <id>

✅ /handoff

Antigravity

~/.gemini/antigravity/brain/ & conversation_summaries.db

✅ agy <workspace>

✅ /handoff

OpenAI Codex

~/.codex/sessions/, session_index.jsonl, & state_5.sqlite

✅ codex resume <id>

✅ $handoff

Grok Build CLI

~/.grok/sessions/

✅ grok ...

✅ /handoff

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)

Linux & macOS (bash / zsh / sh):

git clone https://github.com/ajmainapon/one-agent-harness.git
cd one-agent-harness
chmod +x install.sh && ./install.sh

Windows (PowerShell):

git clone https://github.com/ajmainapon/one-agent-harness.git
cd one-agent-harness
.\install.ps1

Option 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 --daemon

Usage 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 #2 from 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/project

Numbers 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.md and .harness/bundle.json in 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-only prints context without attempting a save or clipboard change.

  • Use --no-update-agent-md to save a handoff without updating existing AGENTS.md or CLAUDE.md pointers. Use --no-copy to 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

HARNESS_CLAUDE_HOME / CLAUDE_CONFIG_DIR

~/.claude

Claude Code data directory

HARNESS_AGY_HOME / ANTIGRAVITY_HOME

~/.gemini/antigravity

Antigravity data directory

HARNESS_CODEX_HOME / CODEX_HOME

~/.codex

OpenAI Codex data directory

HARNESS_GROK_HOME / GROK_HOME

~/.grok

Grok Build CLI data directory

HARNESS_HOME

~/.harness

One Agent Harness state, logs, and checkpoints


Running the Test Suite

python3 -m unittest discover -s tests -v

License

MIT License — see LICENSE.

Available Tools

5 tools
inject_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

    A3.7/5.0

    Scored across 5 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables 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.
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables handoff of context between AI coding agents like Claude Code, Cursor, Codex, and Windsurf with built-in provenance tracking.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Universal 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.
      26
      MIT