Skip to main content
Glama
README.md
<p align="center">
  <img src="assets/x-harness.png" alt="x-harness" width="220">
</p>

<h1 align="center">x-harness</h1>

<p align="center">
  <b>Let your AI coding terminals talk to each other and share memory —<br>hands-free, local-only, and zero dependencies.</b>
</p>

<p align="center">
  <a href="https://github.com/dupe-com/x-harness/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/dupe-com/x-harness/ci.yml?branch=main&label=CI&labelColor=1C1917" alt="CI status"></a>
  <img src="https://img.shields.io/badge/dependencies-0-2ea043?labelColor=1C1917" alt="zero dependencies">
  <img src="https://img.shields.io/badge/runtime-Node%20%E2%89%A5%2022.5%20%7C%20Bun%20%E2%89%A5%201.1-F5A623?labelColor=1C1917" alt="Node 22.5+ or Bun 1.1+">
  <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-8A8175?labelColor=1C1917" alt="MIT license"></a>
</p>

<p align="center">
  <a href="#features">Features</a> •
  <a href="#the-problem">The problem</a> •
  <a href="#install"><b>Install</b></a> •
  <a href="#try-it-in-60-seconds">Try it in 60s</a> •
  <a href="#how-it-works">How it works</a> •
  <a href="#scaling-up">Scaling up</a> •
  <a href="#what-this-is-not">What this is not</a>
</p>

> **Works across your whole terminal lineup:** **Claude Code**, **Antigravity (`agy`)**, **Codex**, **OpenCode**, and **Cursor** — all sharing one local SQLite file. Built by [Dupe](https://dupe.com).

---

## Features

- 💬 **Cross-harness messaging, hands-free.** Every open agent session auto-registers with its harness, git branch, tmux pane, and PID. Agents DM each other, broadcast (`*`), or send + wait for a reply in one call — handling routine, read-only requests autonomously and only interrupting you for destructive or approval-gated actions.
- ⚡ **Zero-nudge auto-wake.** Sending a message automatically wakes an idle recipient in tmux (only when its prompt is empty and you're not mid-typing) or triggers an active background `x-harness watch` task. No more switching panes to type *"ok"* or *"check inbox"*.
- 🧠 **Shared project memory across harnesses & worktrees.** Repo-keyed memory lives in `~/.agents/memory/<repo-id>/` so every git worktree shares one source of truth. Antigravity and Codex automatically load your `MEMORY.md` at session start, and a `PreToolUse` budget guard keeps `MEMORY.md` under its size limit on both Claude Code and Antigravity.
- 🔁 **Unified cross-harness handoffs.** Bundled `/handoff` skill + `x-harness handoff path --rotate` before clearing or switching tools; the next fresh session in that directory (in *any* harness) picks it up once automatically, sharing `.picked-up` markers so nothing ever double-injects.
- 🪶 **Zero daemon, zero ports, zero npm dependencies.** Backed by a single local SQLite WAL file using Node 22.5+'s built-in `node:sqlite` or Bun's built-in `bun:sqlite`. Nothing stays running in the background; dead sessions are pruned automatically by PID.
- 🧩 **One-command setup for every harness.** `x-harness init` wires MCP servers, lifecycle hooks, canonical `~/.agents/skills/` (with relative symlinks that respect dotfiles repos), `~/.local/bin/x-harness`, an optional 2-line terminal status line (`x-harness statusline` — context %, rate limits, model, subagents, git branch, PR badge, unread count, pinned notes), and optional lean-Haiku session briefs (`x-harness sitrep`).
- 🧭 **Scales up to multi-agent fleets (optional).** Ready when you need workstream Coordinators, an interactive Human Triage TUI (`x-harness triage`), a zero-token Orchestrator gate (`x-harness orch check`), a tmux launcher (`x-harness launch`), or a GitHub PR feedback router (`x-harness pr-watch`). ([details →](./docs/MULTI-AGENT.md))

## The problem

You're running Claude Code in one terminal, Antigravity or Codex in another, maybe Cursor on the side — all on the same repo. In practice, they're completely blind to each other. You end up playing human copy-paste router between windows, re-explaining context Claude already saved in `MEMORY.md`, and manually nudging idle panes just to check a reply.

`x-harness` gives every coding agent on your machine one shared local bus — messaging, memory, and handoffs — without locking you into a single vendor, running a background daemon, or installing a dependency tree.

## Install

Requires **Node ≥ 22.5** or **Bun ≥ 1.1**.

### Option 1: Paste into Claude Code / Antigravity / Codex

```text
Set up x-harness on this machine from https://github.com/dupe-com/x-harness: verify Node >= 22.5 (or Bun >= 1.1), clone the repo to ~/Work/x-harness (or ~/.local/share/x-harness-src), run `node bin/x-harness.mjs init`, verify with `x-harness status`, and tell me what was configured and to restart my session.
```

### Option 2: Manual commands

```bash
git clone https://github.com/dupe-com/x-harness.git
node x-harness/bin/x-harness.mjs init
```

`init` wires MCP, hooks, and skills for every harness you have installed, and symlinks `x-harness` into `~/.local/bin` when present (otherwise run `npm link` inside `x-harness`). Check everything anytime with `x-harness status`.

## Try it in 60 seconds

1. Open **Terminal 1** in any repo with **Claude Code** (in tmux, or running `x-harness watch`).
2. Open **Terminal 2** in the same repo with **Antigravity** (or **Codex**) and say:
   > *"Message the Claude session, ask it to review my git status, and wait for its reply."*
3. Watch Claude wake up automatically, check `git status`, and reply straight back into Terminal 2 — zero copy-pasting, zero manual nudging. You're only interrupted if a peer asks for something destructive or needing approval.

## How it works

```text
Claude Code          Antigravity (agy)          Codex / OpenCode / Cursor
    │                        │                              │
    ├── stdio MCP ───────────┼────────── stdio MCP ─────────┤
    └── lifecycle hooks ─────┴────────── lifecycle hooks ───┘
                                  │
                                  ▼
             ~/.local/share/x-harness/state.db  (SQLite WAL)
              • live agents (PID-checked, tmux pane, branch)
              • direct & broadcast messages + threads
              • optional workstreams, board log & triage answers
                                  │
             ~/.agents/{skills,memory,handoffs}  (canonical files)
              • shared MEMORY.md per git repo + PreToolUse budget guard
              • once-only SessionStart handoff pickup (.picked-up mtime)
```

- **Everything stays on your machine.** No cloud relay, no account, no listening socket, no background daemon.
- **Session-scoped hooks.** Hooks walk your process ancestor tree (`ps`) so sibling sessions in the same directory never steal or block each other's messages.
- **Hard safety boundary.** Agents handle routine read-only peer requests autonomously, but `x-harness` never relays human approvals, `!` commands, or merge consent between sessions.

## Scaling up

The everyday layer above is all most people need. When you're running parallel git worktrees and want structured Coordinator status, a Human Triage TUI, a zero-token Orchestrator gate, tmux session launching, or GitHub PR feedback routing:

- [**Setup & Reference Guide**](./docs/SETUP.md) — install, verify, and remove instructions for every skill, mod (`context-coach`), hook, and CLI command.
- [**Multi-Agent Workstreams & Tool Reference**](./docs/MULTI-AGENT.md) — all 14 MCP tools, `coord`, `triage`, `orch`, `launch`, `pr-watch`, and hooks.
- [**Architecture**](./docs/ARCHITECTURE.md) — the full 4-layer design and SQLite schema.

## What this is *not*

Deliberately focused. `x-harness` is **not** a cloud agent platform, an LLM proxy, or a replacement for your harness's native UI. It's a tiny, zero-dependency local connective tissue so whichever coding agents you already love can work together cleanly.

## Development & Tests

```bash
npm test          # End-to-end multi-process test suite on Node
npm run test:bun  # Same suite on Bun
```

## License

MIT — see [LICENSE](./LICENSE).

TDQS

A3.5/5.0

Scored across 14 tools

Disambiguation3/5

Several tools overlap in purpose: inbox_list_agents and coord_sessions both list sessions with live state, PR URL, unread count and who-owes-whom status, differing only by scope (all harnesses vs workstream). Likewise inbox_report, coord_status, coord_board append, and orch_record are four different ways to publish status/state, and the boundary between them (session-level report vs workstream status vs board event vs rate-capped orchestrator action) requires careful reading of descriptions rather than being self-evident. The inbox_/coord_/orch_ namespacing does help carve out domains, but an agent can still misselect the first time.

Naming Consistency4/5

A clear namespace_verb convention runs through nearly all tools (inbox_send, inbox_check, inbox_wait, inbox_register, coord_status, orch_check, orch_record). A few are noun-only (coord_board, coord_sessions, inbox_whoami) and memory_info breaks the namespace pattern entirely, but the overall scheme is predictable and readable.

Tool Count4/5

14 tools sits comfortably in the reasonable range for a multi-agent messaging plus coordination plus orchestration server, and each tier (inbox, coord, orch, memory) earns its tools. The count is slightly inflated by the redundant listing/status tools (list_agents vs coord_sessions, report vs coord_status vs board event).

Completeness4/5

The surface covers the full lifecycle: register/rename, whoami, discover peers, send/broadcast, check, blocking wait, status reporting, board events, memory index, and an orchestrator gate with dedup and rate-capped recording. Minor gaps exist — no message history/search beyond unread/recent, no way to prune or deregister a dead session handle, and no explicit tool for a coordinator to answer pending human triage questions (only implied via board 'answer' events).

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues