# Harness engineering: what it means, and how we do it

> Harness engineering is building the rules, checks and tools around a coding agent so it gets work right. Our repo's real harness, with dates and counts.

Source: https://shuriken.sh/guides/harness-engineering

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.

[Guides](https://shuriken.sh/guides) By Shuriken Updated 6 December 2026 4 min read

**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](https://openai.com/index/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](https://martinfowler.com/articles/harness-engineering.html) 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](https://addyosmani.com/blog/agent-harness-engineering/) 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 |

Shuriken runs Claude Code, Codex, Gemini CLI and 64 more agents side by side, with your own sign-ins.

[Download](https://shuriken.sh/download)

## 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:

bash
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.ts fails if a page writes out our email address instead of office@shuriken.sh.
- vat-wording.test.ts fails on tax wording that doesn't match how we're registered.
- answer-first.test.ts fails 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, with CLAUDE.md either the same file or a one-line @AGENTS.md import. Write the incident next to the rule. Our [CLAUDE.md guide](https://shuriken.sh/guides/claude-md-best-practices) 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 PostToolUse hook that runs the tests after an edit, so the agent hears a failure mid-task. Our [hooks examples](https://shuriken.sh/guides/claude-code-hooks-examples) include one.
- Review of what no check covers. How we read an agent's diff is in [reviewing AI-generated code](https://shuriken.sh/blog/review-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](https://shuriken.sh/guides/what-is-an-agent-harness), and it's what Shuriken is.

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fharness-engineering&text=Harness%20engineering%3A%20what%20it%20means%2C%20and%20how%20we%20do%20it)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fharness-engineering)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fharness-engineering&t=Harness%20engineering%3A%20what%20it%20means%2C%20and%20how%20we%20do%20it)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fharness-engineering&title=Harness%20engineering%3A%20what%20it%20means%2C%20and%20how%20we%20do%20it)[E-mail](mailto:?subject=Harness%20engineering%3A%20what%20it%20means%2C%20and%20how%20we%20do%20it&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fharness-engineering)

## Sources

- [Harness engineering for coding agent users (Birgitta Böckeler, martinfowler.com, 2 April 2026)](https://martinfowler.com/articles/harness-engineering.html) (accessed 25 October 2026)
- [Harness engineering: leveraging Codex in an agent-first world (Ryan Lopopolo, OpenAI, 11 February 2026)](https://openai.com/index/harness-engineering/) (accessed 25 October 2026)
- [Agent Harness Engineering (Addy Osmani, 19 April 2026)](https://addyosmani.com/blog/agent-harness-engineering/) (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.

Every coding agent

67 coding agents, one harness.

Run Claude Code, Codex, Gemini CLI and the rest on your own computers, with the sign-ins you already have.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [The Codex harness: what it is and what runs on it: Guide 5 Dec 2026 5 min read The Codex harness is the agent loop under every Codex surface. The App Server hands it to apps like the IDE extension as JSON-RPC over stdio.](https://shuriken.sh/guides/codex-harness)
- [Codex CLI resume session: codex resume, --last and fork: Guide 24 Nov 2026 4 min read Resume a Codex CLI session with codex resume, --last or a session ID. Where Codex keeps sessions, what comes back, and why one is missing from the list.](https://shuriken.sh/guides/codex-resume-session)
- [Codex CLI approval modes and sandbox, explained: Guide 27 Oct 2026 5 min read Codex CLI approval modes are two settings: the sandbox and the approval policy. Auto pairs workspace-write with on-request; untrusted is retired.](https://shuriken.sh/guides/codex-cli-approval-modes)
- [Codex CLI config.toml: where it lives and what to set: Guide 27 Oct 2026 4 min read Codex reads ~/.codex/config.toml, a trusted project's .codex/config.toml, a profile and -c flags. Flags win, then the closest project file.](https://shuriken.sh/guides/codex-cli-config-toml)
- [Codex CLI on Windows: native PowerShell or WSL?: Guide 27 Oct 2026 8 min read Codex CLI runs natively in PowerShell inside its own Windows sandbox. In WSL2 it uses the Linux sandbox, needs bubblewrap and no longer runs on WSL1.](https://shuriken.sh/guides/codex-cli-on-windows)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
