Step 11 of 24
Harness engineering
Build the files, checks and loops around a coding agent that make its work reliable. The same model does better or worse work depending on what surrounds it: the context it reads, the checks it must pass and the limits it cannot cross. Most mistakes an agent repeats are fixed in the harness, not the prompt.
By Sheela · Checked Nov 6, 2026 · How we review
How to choose
- Keep AGENTS.md or CLAUDE.md short, and point it at docs rather than copying them in.
- Let tests, type checks and linters judge the agent's work before a person reads it.
- One workflow framework per project, sized to the change; sandbox the agent and guard destructive commands.
What to look for
The questions that separate the options, in order of how much they matter.
01
A short context file that points elsewhere
AGENTS.md or CLAUDE.md is loaded into every session, so every line costs tokens on every turn and competes with the task for the model's attention. OpenAI's harness team found one large instruction file went stale and could not be checked automatically, and moved to an AGENTS.md of roughly 100 lines that works as a table of contents for a structured docs/ folder. Start with a few rules you can defend (the Karpathy CLAUDE.md is four), add a line only when the agent repeats a mistake, and put detail in files the agent opens when it needs them.
02
Guides before the agent acts, sensors after
Birgitta Böckeler's model on martinfowler.com splits the harness into guides, which steer the agent before it works (context files, skills, specs, language servers), and sensors, which check the result so the agent can correct itself (tests, linters, type checkers, structural tests, review). You need both: guides alone never learn whether they worked, and sensors alone catch the same mistake every time. Prefer deterministic sensors, which are fast, cheap and repeatable, over AI review, and write linter messages that tell the agent how to fix the problem.
03
Context cost of skills, plugins and hooks
Skills are cheap until they pile up. Anthropic's docs put the startup cost at about 100 tokens per installed skill and up to 5,000 more when one triggers; ECC at full install loads enough rules and skills to take a large share of the context window, which is why it offers a minimal profile. In Claude Code, claude plugin details reports what each plugin adds to every turn. Install the smallest set that covers your workflow, and remove what you have not used in a month.
04
Process sized to the change
Spec-driven and multi-role frameworks turn agent work into documents you can review, and charge for it. Scott Logic's trial of Spec Kit took about 2 to 3.5 hours of human review per feature; BMAD produces several planning documents per feature; Superpowers is slow and token-heavy on small fixes. Matt Pocock's skills sit at the other end: nothing runs unless you call it. Check whether a tool scales its process down for a one-line fix (BMAD's Build skill now does), and install one workflow framework per project, because Superpowers, BMAD, ECC and Addy Osmani's pack overlap and compete.
05
State that survives the end of a session
Every new session starts with no memory of the last one. Anthropic's post on long-running agents describes a plain-file answer: a feature list in JSON with each item marked passing or not, a progress log, an init.sh that starts the app, one feature per session and a git commit at the end of each. Memory plugins automate this at a price: claude-mem summarises every session with a model you pay for, and its local worker has no request authentication; context-mode keeps tool output in a local index and rebuilds the working state after compaction. Try the plain files first.
06
A sandbox and a command guard, not one or the other
An agent can be talked into running anything, so limits belong in the operating system, not the prompt. Anthropic's Sandbox Runtime, the engine behind Claude Code's /sandbox, restricts file writes and network access to what you allow, but permits writes inside the project by design, so git reset --hard and git push --force still run. CC Safety Net reads each shell command before it runs and blocks those, but controls neither files nor network. Together they cover each other's gaps.
07
Token-saving claims, checked against your own bill
Several tools promise smaller context and lower costs. Shorter tool output is not the same as a cheaper session: two independent tests of rtk found no saving in their headline runs (7.6% and 5.8% more), partly because its hook sees only Bash calls, and nobody has published a cost test of context-mode's free plugin. Measure before and after with your own usage logs (ccusage reads them locally) over a week of normal work, not a single demo task.
08
Who can change the code running in your agent
Plugins and skill packs run hooks and MCP servers with your permissions. Claude Code's official marketplace pins each entry to a commit, but Anthropic says a listing is not a security audit and plugins auto-update by default. ECC's README warns that mirrors may carry malware, and CC Safety Net's default install pulls @latest. Install from the original repository, pin versions for a team, and read the hook scripts before you enable them.
How the options differ
Harness engineering is the work around a coding agent rather than inside it: the files it reads, the checks that judge its output and the loops that carry work across sessions. The tools here fall into a few groups. Context files and skill packs (the Karpathy CLAUDE.md, Anthropic Skills, Addy Osmani's and Matt Pocock's skills) give the agent rules and procedures. Workflow frameworks (Superpowers, Spec Kit, BMAD, ECC) impose a whole sequence of spec, plan, test and review, and differ mainly in how much paperwork they ask a person to read. Context and memory tools (context-mode, rtk, claude-mem) try to keep the context window small or carry state between sessions. Safety layers (Sandbox Runtime, CC Safety Net) limit what the agent can do whatever it has been told. Claude Code's official marketplace is how most of these are installed, and Learn Harness Engineering is a course that teaches the whole discipline.
The agent itself (Claude Code, Codex, OpenCode) is the inner harness and is covered in our coding-agent reviews. The most important sensors in an outer harness are usually ones you already own: your test suite, type checker, linter and CI. None of the tools below replaces them, and several only work well when they exist.
14 tools, compared
Ranked by our rating. Open any review for sources, prices and the full verdict.
| Tool | Rating | Our verdict | Best for | Price |
|---|---|---|---|---|
| Superpowersrepo | 4.7/5 | A discipline layer that makes a coding agent behave like a careful junior engineer, and worth its extra tokens on anything bigger than a one-line fix. | Developers who want an agent to run multi-hour features with a plan, tests and review built in. | Free and open source (MIT). You pay for the model usage of the agent you run it in. |
| Matt Pocock's Skillsrepo | 4.5/5 | Matt Pocock's skills make the agent argue the plan out with you before it writes code, and /grill-me alone justifies the install. | Engineers who want lightweight planning and TDD habits without handing the process to a framework. | Free and open source (MIT). You pay for your agent's model usage. |
| Anthropic Skillsrepo | 4.4/5 | Read it before writing a skill of your own, and install it if Claude Code has to handle Office files and PDFs; just don't mistake the document skills for something you can fork. | Anyone writing skills, and Claude Code users who need Office and PDF handling. | Free. Example skills are Apache-2.0; the document skills are source-available, not open source. |
| Anthropic Sandbox Runtime (srt)repo | 4.4/5 | Your coding agent can be talked into anything; the operating system can't, and srt puts the operating system in charge. | Every developer running a coding agent on their own machine, as the first layer of protection. | Free and open source under Apache 2.0. |
| Spec Kitrepo | 4.3/5 | Spec Kit turns agent work into reviewable documents in git, and charges for it in hours of human reading per feature. | Teams that want written, reviewable specs before an agent writes code. | Free and open source (MIT). |
| Agent Skills (Addy Osmani)repo | 4.3/5 | Addy Osmani's pack turns senior-engineer habits into gates an agent cannot talk its way past, and it is the rare skill set that takes the browser seriously. | Web developers who want one structured skill pack from spec to launch. | Free and open source (MIT). You pay for your agent's model usage. |
| Claude Code official plugin marketplacerepo | 4.3/5 | Start here before adding any third-party marketplace: commit-pinned entries and visible context cost make it the safest default, though a listing is not a security audit. | Every Claude Code user, as the first place to look for plugins. | Free. The catalogue repo is Apache-2.0; each plugin has its own licence, and many vendor plugins need a paid account with that vendor. |
| Learn Harness Engineeringrepo | 4.1/5 | A real curriculum for the unglamorous part of agent coding, the scaffolding around the model, and better on structure than on originality. | Engineers already using Claude Code or Codex who want a structured way to make unattended agent sessions more reliable. | Free (MIT); you need your own coding agent such as Claude Code or Codex to do the projects. |
| CC Safety Netrepo | 4.0/5 | The seatbelt for the damage a sandbox allows on purpose: force-pushes, hard resets and rm -rf inside your own project. | Anyone letting a coding agent run shell commands without approving each one. | Free and open source under MIT. |
| BMAD Methodrepo | 3.8/5 | BMAD earns its paperwork on projects with stakeholders who sign things off, and charges for it in hours on everything smaller. | Teams on larger projects that want PRDs, architecture and stories generated and reviewed. | Free and open source (MIT). "BMad" and "BMAD-METHOD" are trademarks of BMad Code, LLC. |
| Everything Claude Code (ECC)repo | 3.8/5 | ECC is a parts bin rather than a workflow: useful in a minimal profile, a standing tax on context at full size. | Claude Code power users who want a large toolkit and will trim it to a minimal profile. | Free and open source (MIT). ECC Pro GitHub App for private repos is $19 per seat a month; Enterprise is quoted. You pay for your agent's model usage. |
| claude-memrepo | 3.7/5 | Real cross-session memory for Claude Code, wrapped in an installer that steers you towards a hosted subscription and a compression bill you have to watch. | Developers on long-running projects who want the agent to remember past sessions. | Open source (Apache-2.0). Compression runs on your Anthropic plan or your own key. Hosted CMEM plans: Pro $30/month, Heavy $70/month, Max $100/month with overages; TeamBrain pricing not announced. |
| context-moderepo | 3.6/5 | Worth trying for long sessions that lose the thread after compaction; nobody has yet shown the free plugin lowers your bill. | Claude Code users whose long sessions lose track of their work after compaction. | Plugin free (Elastic License 2.0). Hosted gateway: 1,000 free requests once; Starter $20/month (10,000 requests); Pro $49/month (50,000 requests); you pay your model provider directly. |
| rtk (Rust Token Killer)repo | 3.4/5 | It makes shell output shorter, which is not the same as making Claude Code cheaper, and both independent cost tests found it was not. | Developers with very noisy shell output who will measure the effect themselves. | Free (Apache-2.0 CLI plus BUSL-1.1 engine; Apache-only rtk-oss available). Commercial resale needs a licence. RTK Pro team edition is paid, with a 7-day trial. |
Side by side
The specifications that matter for this step. Checked Nov 6, 2026; confirm on the vendor’s site before you commit.
| Tool | Type | What it adds | Agents | Context or token cost | Licence |
|---|---|---|---|---|---|
| Superpowers | Workflow skills plugin | Brainstorm, plan, TDD, subagent review | 16 harnesses | High; grows with tasks per plan | MIT |
| Matt Pocock's Skills | Composable skills | /grill-me, /tdd, /code-review | Claude Code, Codex, Copilot; others via npx | Only when called; subagent reviews add up | MIT |
| Anthropic Skills | Reference skills and spec | 19 skills incl. docx, pdf, skill-creator | Claude Code, claude.ai, Claude API | About 100 tokens per skill; up to 5,000 on use | Apache 2.0; document skills source-available |
| Anthropic Sandbox Runtime (srt) | OS-level sandbox | File-write and network allowlists | Any process; Claude Code /sandbox | None | Apache 2.0 |
| Spec Kit | Spec-driven CLI and commands | Constitution, spec, plan, tasks, converge | 41 agents | Agent usage plus 2 to 3.5 h review per feature | MIT |
| Agent Skills (Addy Osmani) | Engineering workflow skills | 25 skills, 9 commands, evidence gates | Claude Code, Codex, 70+ via skills CLI | Longer sessions; no figures published | MIT |
| Claude Code official plugin marketplace | Plugin marketplace | 315 plugins, pinned to commits | Claude Code | Per plugin; shown by claude plugin details | Apache 2.0 |
| Learn Harness Engineering | Course: 14 lectures, 8 projects | Templates, harness-creator skill, audit script | Agent-agnostic | Free; your agent's usage | MIT |
| CC Safety Net | Command guard (hook) | Blocks destructive git, rm -rf, secret reads | Claude Code, Codex, Cursor and more | None | MIT |
| BMAD Method | Agile role framework | Briefs, PRDs, architecture, stories | Claude Code, Codex and others | High; several documents per feature | MIT (names trademarked) |
| Everything Claude Code (ECC) | Harness kit | 71 agents, 311 skills, hooks, AgentShield | Claude Code stable; others beta | Heavy at full install; minimal profile | MIT |
| claude-mem | Cross-session memory plugin | Hooks record sessions; recall over MCP | Claude Code, Codex, OpenCode and others | Compression tokens every session | Apache 2.0 |
| context-mode | Context plugin and MCP server | Indexed tool output; state rebuilt after compaction | 17 platforms | Aims to cut; free plugin untested | Elastic 2.0 |
| rtk (Rust Token Killer) | Shell output proxy (hook) | Compressed output for 100+ commands | 18 agents | Two independent tests found no saving | Apache 2.0 / BUSL-1.1 |
Sources for this guide
- OpenAI: Harness engineering, leveraging Codex in an agent-first world
- Birgitta Böckeler: Harness engineering for coding agent users (martinfowler.com)
- Anthropic: Effective harnesses for long-running agents
- Anthropic: Beyond permission prompts (Claude Code sandboxing)
- Agent Skills overview (Claude Platform docs)
- Putting Spec Kit through its paces (Scott Logic)
- rtk Claude Code token savings benchmark (JetBrains)