Harness engineering: what it means, and how we do it
Harness engineering is everything you build around a coding agent except the model: the AGENTS.md it reads, the commands it may run, and the checks that fail when it gets something wrong. Most of it is added on the day something breaks, as a rule or a check, so the agent can't break it the same way twice.
Contents
Harness engineering means building what sits around a coding agent, everything except the model: the AGENTS.md it reads, the commands it may run, the checks that go red when it slips. Ours is a 298-line CLAUDE.md, one pre-commit script and a named test behind each fix. Most of it was written on the day something broke.
We build Shuriken with Claude Code and Codex working side by side in one repository. The harness around that repository is listed further down, with the dates and counts from its git history.
Where the term comes from#
Three pieces made it common in 2026. On 11 February, OpenAI's Ryan Lopopolo wrote Harness engineering about a team that shipped an internal beta with "0 lines of manually-written code", around a million lines written by Codex. On 2 April, Birgitta Böckeler's article on martinfowler.com defined the harness as "everything in an AI agent except the model itself" and wrote the formula on our cover: "Agent = Model + Harness". On 19 April, Addy Osmani put it shorter: "If you're not the model, you're the harness."
We couldn't find a first use of the term we'd stand behind, so we don't credit one.
Guides and sensors#
Böckeler's article sorts a harness into two kinds of control. Guides "anticipate the agent's behaviour and aim to steer it before it acts". Sensors "observe after the agent acts and help it self-correct". Each kind is either computational, "deterministic and fast, run by the CPU", or inferential, where a model judges the work: "Slower and more expensive; results are more non-deterministic."
Here is our repository's harness in her terms:
| Control | Kind | What it does |
|---|---|---|
CLAUDE.md / AGENTS.md |
Guide, inferential | Rules the agent reads at the start of a session |
shuriken.json worktree setup |
Guide, computational | Installs and builds a fresh worktree before the agent starts |
lefthook.yml |
Sensor, computational | Format, lint and typecheck before a commit |
scripts/check-staged-parse.mjs |
Sensor, computational | Parses, formats and lints the staged copy of each file |
Gate: line in a commit |
Sensor, computational | Names the test that proves the change |
| Site content tests | Sensor, computational | Fail the build on wrong wording |
| Review of the diff | Sensor, inferential | A person or a second agent reads the change |
The harness around our repo#
Everything here is in the Shuriken repository and its git log, read on 25 October 2026. AGENTS.md is a link to CLAUDE.md, one 298-line file, so Claude Code and Codex read the same rules.
What broke, and what we added#
On 29 September 2026, seven commits reached main that didn't parse. Several agents were editing the same files, and each staged only its own lines with git apply --unidiff-zero. With no context lines, git put some of them outside the function they belonged in. The same day scripts/check-staged-parse.mjs appeared, and CLAUDE.md banned zero-context hunks. Every agent now commits like this:
node scripts/check-staged-parse.mjs <paths> && git commit --no-verify -m "…" -- <paths>
The --no-verify is there on purpose, and it caused the next failure. On 2 October CI failed on formatting in 20 files and on 17 lint errors. We have a lefthook.yml that formats, lints and typechecks before each commit, but it never ran for commits that skipped hooks. The fix went into the same script, which now runs oxfmt and oxlint over the staged copies as well. Since 30 September it has also refused anything under .secrets/, where our own keys live.
On 2 October, too, an agent's stale git index replaced the shared one, so 368 files showed as changed or deleted while the tree matched HEAD. Every command that uses a private index now sets GIT_INDEX_FILE.
None of those rules was planned. Osmani's advice is the same: "You only add constraints when you've seen a real failure."
The Gate line#
A fix's commit message ends with Gate: and the test, harness or check that proves it. Of the 5,080 commits on main since our first prerelease on 29 September 2026, 1,114 carry one, and 538 add "red without": the test was run against the old code and failed. A test that also passes on the old code doesn't test the fix. REGISTER.md, our list of planned and finished work, turns an item ☑ "only with its gate named".
Tests for words#
A few of the 248 test files in packages/cloud/test-node, the website's test folder, never look at code.
company-facts.test.tsfails if a page writes out our email address instead ofoffice@shuriken.sh.vat-wording.test.tsfails on tax wording that doesn't match how we're registered.answer-first.test.tsfails if a compare page has no short answer at the top.
A worktree that starts ready#
shuriken.json in the repo root lists what a new worktree runs before an agent's first turn there: npm ci, two seed scripts, npm run build:server and the build of one Expo module.
How to start on your own repo#
Nothing here needs a product. In the order we'd set it up again:
- One rules file for every agent:
AGENTS.md, withCLAUDE.mdeither the same file or a one-line@AGENTS.mdimport. Write the incident next to the rule. Our CLAUDE.md guide covers what belongs in it. npm run typecheck, the formatter and the linter in a pre-commit hook, plus a script agents call themselves if they commit with--no-verify.- A
Gate:line in every fix's commit message, with "red without" when the test was run against the old code. - A Claude Code
PostToolUsehook that runs the tests after an edit, so the agent hears a failure mid-task. Our hooks examples include one. - Review of what no check covers. How we read an agent's diff is in reviewing AI-generated code.
All of that is the harness around one repository. The layer that runs the agents themselves, with accounts, machines and a worktree for any chat you put on its own branch, is what we mean by an agent harness, and it's what Shuriken is.
Sources
- Harness engineering for coding agent users (Birgitta Böckeler, martinfowler.com, 2 April 2026) (accessed 25 October 2026)
- Harness engineering: leveraging Codex in an agent-first world (Ryan Lopopolo, OpenAI, 11 February 2026) (accessed 25 October 2026)
- Agent Harness Engineering (Addy Osmani, 19 April 2026) (accessed 25 October 2026)
Frequently asked questions
Who coined the term harness engineering?
We couldn't find a first use we'd stand behind. OpenAI's post titled Harness engineering is dated 11 February 2026; Birgitta Böckeler's article on martinfowler.com is dated 2 April 2026.
Is CLAUDE.md or AGENTS.md part of the harness?
Yes, the guiding part. It tells the agent what to do before it acts, but nothing enforces it; a test, a hook or a pre-commit check is the part that does.
Do I need special tools for harness engineering?
No. Our harness is a rules file, a pre-commit script, git hooks, ordinary tests and a convention for commit messages. Claude Code's hooks and permission rules help, and they are configuration, not a product.