A git repository
repo-harness is repo-local. Run it from a git work tree — git init first if the
folder isn’t one yet.
This guide takes a repository from zero to a working repo-harness workflow: install the runtime, adopt the repo, wire your agent’s hooks, and confirm the guards fire.
A git repository
repo-harness is repo-local. Run it from a git work tree — git init first if the
folder isn’t one yet.
An agent
Claude Code or the Codex CLI as the executor. ChatGPT Pro is optional, for planning.
Bun
The CLI runs on Bun — the installer pulls it in if it’s missing. No Node setup required.
Get the repo-harness binary onto your machine with whichever entry point fits:
# macOS / Linux — installs Bun if missing, then the CLIcurl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.sh | shbun add -g repo-harnessnpm install -g repo-harnessRun init once per machine. It’s idempotent — it wires the host hook adapters, the
Waza skills, and the CodeGraph index for every project you’ll use:
repo-harness init# ✓ host adapters · skills · CodeGraph configuredCheck readiness any time (read-only):
repo-harness status # CLI version, host install state, route coveragerepo-harness doctor # PATH, version, hosts, trust stateFrom the root of your repo, preview what will change. Nothing is written:
repo-harness adopt --dry-run # Migration ReportApply the repo-local contract:
repo-harness adoptAdopt inspects the repo, installs the workflow files, wires the hooks, builds the CodeGraph index, and runs the workflow check. The tree it lays down:
init installs host adapters that dispatch editor events into repo-harness. Point
your agent at them, then restart the session so the hooks load.
The adapter lives in your user settings — ~/.claude/settings.json — and routes every
SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, and Stop event into
the harness. Restart Claude Code to pick it up.
Codex reads ~/.codex/hooks.json. After init writes it, trust the hook config in
Codex Settings — Codex won’t execute untrusted hooks. Then start a new session.
Prompt routing — submit any prompt. The UserPromptSubmit hook classifies intent
and surfaces plan status in its advisory output.
The edit guard — ask the agent to edit a file before any plan is approved. The
PreToolUse.edit guard fails closed and blocks the write until you capture a plan.
The workflow check — run the gate directly:
bash scripts/check-task-workflow.sh --strictA green check means the contract surface is consistent and the guards are armed.
Want ChatGPT Pro reading your plans without touching source? Expose only the workflow files through a local MCP sidecar:
repo-harness mcp setup chatgpt --repo .repo-harness mcp serve --transport http \ --host 127.0.0.1 --port 8765 --profile plannerFull details — including the read-only safety boundary — are on the ChatGPT Pro planner page.