DEV Community

Cover image for We Wrote 8 Posts on Claude Code Harness Engineering. Then We Automated Our Own Advice
ShipWithAI
ShipWithAI

Posted on • Originally published at shipwithai.io

We Wrote 8 Posts on Claude Code Harness Engineering. Then We Automated Our Own Advice

TL;DR

We wrote eight posts on Claude Code harness engineering — Memory, Tools, Permissions, Hooks, Observability. Then we spent every new project rebuilding that harness by hand, and so did every teammate, slightly differently. A discipline you re-type every Monday isn't a discipline; it's a chore. So we turned the series into one open-source command.


The Monday that broke the pattern

New repo. Empty .claude/ folder. Cursor blinking in a fresh CLAUDE.md.

I did what I'd done a dozen times before: opened last month's project in a second window and started copying. The permissions block. The rm -rf guard. The MEMORY.md scaffold. The MCP config. Paste, find-and-replace the project name, tab back.

Halfway through, the irony landed. We had just published eight posts teaching developers exactly this — how to build a reliable harness, layer by layer. And here I was, the author, retyping it from memory and hoping I hadn't skipped a layer.

The discipline had no tooling

The pillar idea of the whole series is one equation:

Agent = Model + Harness

The model is a commodity — everyone on the same Claude version gets the same raw capability. The harness is the part that's yours. It's why one team ships clean while the team next door ships rollback after rollback.

We broke it into five layers, one deep dive each:

  • Memory — what it knows before you type. CLAUDE.md as a failure log, not a wishlist.
  • Tools — what it can reach, through MCP servers.
  • Permissions — what it's allowed to touch. Thirty seconds of config stops a careless install from wrecking your machine.
  • Hooks — what's enforced at runtime. The only layer context can't argue its way out of.
  • Observability — what you can see afterward, plus a loop that makes the agent verify its own work before claiming it's done. Under all of it sits the constraint paradox: the more you restrict what the agent can do, the better it does what it should. LangChain made the same case publicly — harness and context changes, not a model swap, drove a +13.7-point jump (52.8% → 66.5%) on Terminal Bench 2.0.

Good theory. Real evidence. And every post ended the same way: "copy this block into your .claude/ folder."

We'd written a beautiful manual for a factory, then asked everyone to assemble the production line by hand in every new building. An SOP you execute manually every time isn't a system. It's a memory test you eventually fail.

Two failure modes nobody warns you about

You forget a layer. Never the famous ones — you'll always remember the rm -rf hook because it scared you once. You forget the boring one: the observability log, the MEMORY.md index. And you don't notice until three weeks in, when the agent reintroduces a bug you already fixed in a session it has no record of.

Your team drifts before the project starts. One dev writes a strict permissions block. Another copies an older, looser one. A third skips hooks "just for now." Now you don't have a harness — you have four dialects of one. The point of version-controlling it is that the team inherits the same reliability. Hand-assembly defeats that on day one.

The fix isn't a smarter model. It's making the right harness the easy harness: reproducible, identical, boring to set up.

So we turned the series into one command

We took every post and asked: what if this weren't a code block to copy, but a question in an interview?

That's shipwithai-starter — one open-source plugin:

/shipwithai-starter:init
Enter fullscreen mode Exit fullscreen mode

It asks about your stack and how much rigor you want, then writes the whole harness — five minutes for the essentials, thirty for the full setup. Then:

git add CLAUDE.md .claude/ .mcp.json docs/
git commit -m "chore: add Claude Code harness"
Enter fullscreen mode Exit fullscreen mode

Your teammate clones the repo, opens Claude Code, and the harness is already there. No second window. No drift. The production line ships with the building.

Every post now has a command on the other side of it:

What you read What you can now run
The MEMORY.md fix · failure-log CLAUDE.md /setup-memory
MCP setup guide /setup-mcp
30-second install security /setup-permissions
Which hook do you need /setup-hooks
Self-verification loop /setup-observability

The blog still teaches you to do it by hand — and you should read it, because you can't maintain what you don't understand. The plugin just means you do it by hand once, to learn it, instead of every Monday, forever.

The two layers we haven't written about yet

Honest part: the series says five layers. The plugin sets up seven. That's what dogfooding does to a framework.

  • Agents — sub-agents in .claude/agents/, including a drift-monitor that runs weekly and tells you when your CLAUDE.md has quietly stopped matching the code. The failure-log pattern, automated.
  • SSOT — single-source-of-truth docs: architecture file, ADRs, codebase maps. The context that keeps the agent from re-litigating decisions you already made. We'll write the deep dives. But we'd rather ship the tool and admit the framework grew because we used it than pretend the map was perfect before we walked the territory.

Read every line before you run it

Fully open source: github.com/ShipWithAI/shipwithai-plugins — hooks, interview logic, templates, the drift-monitor agent, all in plain Markdown and Python. Audit the thing that's about to write to your .claude/ folder. That's the only honest way to ship a tool whose entire job is enforcing constraints.

Then run /shipwithai-starter:init on a real project, commit it, and have a teammate pull. The first time someone else's harness shows up identical to yours with zero setup, you'll feel the difference the whole series was pointing at.

The real test: open a new repo six months from now. If you catch yourself copying your harness out of an old project by hand, the tooling lost. If it's already there because one command and one commit put it there — that's harness engineering finally engineering itself.

We wrote eight posts about the discipline. This is the ninth, and it's the one where we stopped practicing it by hand.

shipwithai-starter is built and maintained by the ShipWithAI team. We use it on our own repos before we recommend it on yours.

Top comments (0)