File-backed workflow harness for reliable Claude Code and Codex sessions.
$ npx -y skills add Ancienttwo/repo-harness --agent claude-code
Repo: Ancienttwo/repo-harness
What's inside
English | 简体中文 | 日本語 | Français | Español
Give the agent a complete PRD or Sprint; after that, your loop is just review and next, or start /goal and go AFK.
repo-harness ships a CLI plus skill/runtime hooks that write context, plans,
handoffs, checks, and review evidence back into the project, so the next agent
session continues from files instead of chat memory. It adopts an existing repo
with a tasks-first agent contract that keeps Claude and Codex aligned.
On top of that contract it runs authorized programs: long-running work that holds its own authorization, budget, task offers, and leases, so a Sprint can advance across sessions without a human driving each step.
Prerequisites: a Git working tree, bun, and usable herdr >=0.9.0 for host readiness; macOS/Linux also require bash,
while Windows requires Git for Windows (including its Bash and usr/bin
tools). jq is optional. No Node.js required — the installer uses Bun >=
1.4.0 as the runtime, installing or upgrading Bun first when needed.
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
With Bun >= 1.4.0 already on PATH, skip the shell installer. Package-manager-owned
Bun installs fail closed with the matching upgrade command (brew upgrade bun)
instead of overwriting manager-owned files.
bunx repo-harness@latest install # Bun one-shot bootstrap
bun add -g repo-harness # or install the persistent CLI first
repo-harness install
npx -y repo-harness@latest install # npx fallback; the CLI still runs on Bun
Install herdr from herdr.dev and verify herdr --version.
Persistent review hosting requires POSIX process groups; on Windows use WSL.
Missing or unusable herdr blocks host readiness. Before upgrading from tmux,
drain existing reviewers using the previous version and explicitly rebind terminal
endpoints. See runtime cutover.
repo-harness install
On Windows, keep Git for Windows on the install/update PATH. That explicit
ceremony validates and pins git.exe, its matching bash.exe/usr/bin, and
the install account's absolute TEMP directory plus native System32 tools in the OS account's
~/.repo-harness/config.json#protectedHelperRuntime. Protected workflow
helpers do not rediscover tools from a caller's PATH; rerun
repo-harness update after relocating or replacing Git for Windows.
The global bootstrap: installs the npm package as the global CLI, refreshes
repo-harness skill aliases, installs user-level hook adapters, and records an
explicit install profile. It is idempotent and does not apply repo-local workflow
files to the current directory. --dry-run --json lists components to install,
skip, and remove first. Profiles, native Codex delegation authority, refresh commands, and the
read-only setup check audit:
install-profiles.md.
repo-harness init --dry-run
Run this from the target repository root. It reports the specs, task state,
helper runtime, hook adapter target, and verification files that would be created
or refreshed. It never creates an application stack; new projects and modules use
repo-harness-setup's scaffold mode instead.
repo-harness init
bash scripts/check-task-workflow.sh --strict
bun test
Successful init enables automatic architecture document projection and proactive Stop-hook refactor recommendations when those preferences are unset. Explicit disabled choices are preserved. Suggestions present evidence for a user decision; they do not authorize a refactor. Dry-run does not write these preferences.
Apply ends with === Migration Report ===, naming where generated hook behavior
comes from, the user-level ~/.claude/settings.json and ~/.codex/hooks.json
adapter target, the repo-local surfaces created or refreshed, the
.ai/harness/scripts/* helper runtime, and an --- External Tooling ---
readiness block. Stable intent then lives in docs/spec.md, execution state in
plans/ and tasks/, resume state in .ai/harness/handoff/. If the dry run
looks wrong, stop and read
hook-operations.md first.
repo-harness update # reconcile CLI, mandatory deps, profile tooling, and CodeGraph
repo-harness update --check # read-only repair guidance, no writes
repo-harness uninstall --dry-run # preview owned user configuration cleanup
repo-harness uninstall # remove owned configuration; preserve user changes/history
repo-harness mcp uninstall --dry-run # preview independent MCP setup cleanup
repo-harness mcp uninstall --services-stopped # after stopping all MCP HTTP services
SessionStart injects the prior session's
resume packet, Stop writes the handoff, and each edit records a small journal
event. A session can end mid-task and the next one resumes the exact next step,
blockers, and changed files without re-deriving them.In an adopted repo, the surface area is intentionally small:
| Surface | Purpose |
|---|---|
docs/spec.md and docs/reference-configs/ | Shared standards and stable product intent that every agent session can read. |
plans/, plans/prds/, and plans/sprints/ | Decision-complete work packages before implementation starts. |
tasks/contracts/, tasks/reviews/, and .ai/harness/checks/ | Scope, verification, and review evidence for proving the work is done. |
.ai/harness/handoff/ and tasks/current.md | Session journal and resumable status, derived from workflow artifacts instead of chat memory. |
The product reads as two layers that share one set of files.
Layer 1 — the session contract. One human, one agent session, one task at a time. Plans, contracts, checks, reviews, and handoffs are the durable authority; hooks keep the session inside them. This is the whole product for a solo repo, and everything in Task Workflow belongs here. Nothing below is required to use it.
Layer 2 — authorized programs. Long-running work that outlives a session: an unattended controller stepping a Sprint, a repair campaign that authors and adopts GitHub Issues, a refactor program driven off the architecture model, a collaboration plane where several Module Engineers exchange signals and handoffs. Each program is gated on an operator-minted authorization, draws on a per-goal budget ledger, and holds work through renewable leases. See Authorized Programs.
| Layer 1 | Layer 2 | |
|---|---|---|
| Unit of work | One task contract | One authorized program |
| Who drives it | A human in a session | A controller, under caps |
| Authority | Plan, contract, review, checks | The above, plus authorization, budget, lease, receipts |
| Entry point | repo-harness init | repo-harness automation grant mint |
| Stop condition | Task closeout | Budget exhausted, lease lost, or a terminal receipt |
Layer 2 does not replace layer 1: a program's every step still projects into the same plan, contract, and review artifacts a human would have written.
| File-backed sessions | Plans, contracts, checks, and handoffs live in the repo, so a new session resumes from artifacts instead of a chat thread |
| Typed hook runtime | Eight shared managed routes plus three Codex-only delegation routes, each bound to exactly one typed in-process handler, with fail-closed guards at the edit boundary |
| Plan → Contract → Review | One lifecycle from approved plan to projected contract, isolated worktree, structured evidence, and a reviewable closeout |
| Authorized programs | Campaign, refactor, automation, and collaboration programs that hold their own authorization, budget ledger, task offers, and renewable leases |
| Bounded unattended controller | One Engineer dispatch loop under hard step, duration, and retry caps, reserving budget before each attempt |
| Progressive context loading | A ~12KB stable root context plus ~1KB capability contracts loaded only for the files actually being touched |
| CodeGraph integration | Structural queries (callers, callees, definitions) answered from a pre-built index instead of repeated grep-and-read passes |
| MCP planner sidecar | ChatGPT reads real repo state and writes PRD/Sprint/Goal artifacts; Codex executes them, with no default source-code write access |
| Claude + Codex alignment | One user-level adapter contract, one workflow contract, and one set of repo-local artifacts shared by both hosts |
repo-harness init or migration writes repo-local
files such as docs/spec.md, plans/, tasks/, .ai/context/,
.ai/harness/, helper scripts, and .ai/hooks/.~/.claude/settings.json and
~/.codex/hooks.json route Claude/Codex events into repo-harness-hook.The hook entrypoint exits silently for non-opt-in repos. For opted-in repos, the
Showing a partial view of a very large repo.
FAQ
repo-harness is a Claude Code plugin with 9 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes auto-campaign, claude-plan, obsidian-memory. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it