What it is: The hub for the Beginners in AI harness-engineering series — a plain-English introduction to the discipline of making AI coding agents like Claude Code, Cursor, Codex, and GitHub Copilot reliable. Links to all seven posts in the cluster plus the AGENTS.md glossary entry.
Who it is for: Developers who use AI coding agents on real work and have watched at least one session go sideways. Not for newcomers to AI; this assumes you’ve used a coding agent at least once.
Best if: You want the whole canon — failure modes, AGENTS.md, long-running tasks, verification, observability, feature lists, and the Claude Code playbook — mapped in one place.
Skip if: You’re brand new to AI. Start with How to Use AI and Claude Code Beginners Guide first. Want one practical AI workflow every morning? Subscribe to our free daily newsletter.
Heads up — this is a more intermediate AI topic. If you’re new to AI overall, start with How to Use AI, Best AI Tools for Beginners, and Claude Code Beginners Guide. This series assumes you’ve used Claude Code, Cursor, GitHub Copilot, or Codex on a real codebase and run into the failures we cover.
What is harness engineering?
Harness engineering is the discipline of designing everything around an AI coding agent so the agent produces reliable, predictable work. The agent itself — the model — is one component. The harness is the rest: the instructions file, the file-system state, the tools the agent can call, the tests that verify its output, the rules that say “stop, you’re done.”
Martin Fowler’s formula captures it cleanly:
Agent = Model + Harness
A weaker model with a strong harness routinely outperforms a stronger model with no harness at all. That single observation is why the harness-engineering canon has emerged so quickly across the industry — Anthropic’s official engineering docs, OpenAI’s February 2026 article on harness engineering for Codex, HumanLayer’s writeups, Martin Fowler’s catalog with Birgitta Böckeler, and walkinglabs’ free 12-lecture course all converge on the same set of techniques.
This hub is your map to the seven posts that cover those techniques. Read in order if you’re starting from zero; jump to the specific topic if you’re solving a specific problem.
Why does harness engineering matter?
Three numbers explain the urgency:
- The top AI coding agents score around 85–89% on SWE-bench Verified (May 2026) — a curated benchmark with clean specs and existing tests.
- The same models drop to roughly 46% on SWE-bench Pro — the harder benchmark with no leaked patches. A 40-point gap between benchmark and reality.
- Stack Overflow’s 2025 Developer Survey found 66% of developers say their top complaint with AI coding tools is “the solution is almost right, but not quite.”
That 66% — the gap between “looks plausible” and “actually works” — is what harness engineering exists to close. Switching from one model to another doesn’t help. Spending more on a Pro tier doesn’t help. Writing better prompts barely helps. What works is engineering the workflow around the model, deliberately.
What does the complete harness look like?
A working harness has eight pieces. Each is small. None require advanced engineering. Together they turn an unreliable agent into a reliable one.
- An instructions file — CLAUDE.md or AGENTS.md at the repo root, telling the agent how your project works.
- A feature list — usually a structured JSON file that bounds scope to what’s actually being built.
- A progress note — a short text file that survives between sessions and tracks what was tried, what worked, what failed.
- A test suite — the only honest verifier of whether the agent’s claim of “done” is true.
- Hooks — deterministic guardrails that run on every tool call, edit, or session end. Anthropic’s exact rule: instructions are advisory; hooks guarantee.
- Verification gates — whether self-verification (agent checks its own work) or external verification (a separate Evaluator agent checks it). Most production setups use both.
- Observability — traces, token counts, tool calls, and quality signals. Turns the agent from a black box into something you can audit.
- Permissions and safety — allowlists for the commands the agent can run, sandboxes for risky work, devcontainers for unattended runs.
The minimum viable harness is three of those eight: an instructions file, a test suite, and one hook that runs the tests after every edit. That covers maybe 70% of the reliability gap. Everything else is depth you add when specific failures start hurting you.
Want one harness-engineering pattern in your inbox every morning? Get the free Beginners in AI daily brief — one practical Claude Code, Cursor, or Codex workflow per day. Plain English, no tech background required.
Where should you start?
The seven posts in this cluster are ordered for first-time readers. If you’re solving a specific problem, jump to the matching post; otherwise read straight through.
1. Why AI Coding Agents Fail
The honest list of failure modes. Nine named ways agents go wrong — premature done, broken tests, lost context, hallucinated APIs, drift, over-engineering, codebase ignorance, circular loops, dangerous commands. Plus the data on why upgrading the model doesn’t help. Read this first.
2. What is AGENTS.md?
The open Markdown file standard now read by Codex, Cursor, GitHub Copilot, and ~30 other agents. Includes a copy-paste sample, the eight sections every working AGENTS.md has, monorepo handling, common mistakes, and a 30-minute starter checklist. Companion glossary entry at /glossary-what-is-agents-md/.
3. Long-Running Claude Code Tasks
How to run agents across multi-hour or multi-session work without context rot, drift, or premature wrap-up. Covers Chroma’s context-rot research, “lost-in-the-middle,” Sonnet 4.5’s context anxiety, progress files, agent-team patterns, and real cost data from Anthropic’s three-agent harness builds.
4. AI Agent Verification
How to stop agents from declaring done before they’re actually done. The two layers (self-verification + external), Anthropic’s Evaluator-agent pattern, sprint contracts, GitHub Spec Kit, Claude Code hooks (PreToolUse / PostToolUse / Stop), Playwright MCP, and the objective signals that beat self-grading.
5. AI Agent Observability Guide
How to see what the agent actually did during a 20-minute run. The four pillars (traces, tokens, tool calls, quality), the OpenTelemetry GenAI semantic conventions, and 10 observability tools compared (Langfuse, Helicone, Phoenix, Logfire, Weave, Honeycomb, Datadog, LangSmith, Opik, Galileo) with May 2026 pricing. Includes Claude Code’s native OTel setup.
6. Feature Lists for AI Coding Agents
How a structured feature_list.json bounds the agent’s scope and stops drift into “while I’m here…” refactors. Covers Anthropic’s schema, why JSON beats Markdown for this job, a copy-paste sample, the three-file harness pattern (AGENTS.md + feature list + progress note), and Spec Kit’s equivalent.
7. Claude Code Best Practices (capstone)
The working developer’s playbook. Distills Anthropic’s official best-practices article plus everything from posts 1–6 into a single reference. Explore-plan-code-commit loop, Plan Mode, hooks, skills, subagents, permissions, cost management, named anti-patterns, and a 30-day mastery rollout.
Who’s writing about this in 2026?
The harness-engineering canon is unusually concentrated. Six primary sources are worth knowing about; almost every claim in this series traces back to at least one of them.
- Anthropic’s engineering blog — the two foundational articles are “Effective harnesses for long-running agents” and the three-agent harness writeup. Anthropic uses these patterns to build their own production systems.
- OpenAI’s “Harness engineering: leveraging Codex” (February 13, 2026) — how OpenAI rebuilt their internal engineering practice around designing environments for Codex rather than writing code directly.
- Martin Fowler / Birgitta Böckeler — the “Agent = Model + Harness” framing plus a catalog of failure modes used across the industry.
- HumanLayer’s “Skill Issue” — analysis of roughly 100,000 developer agent sessions; named “the Dumb Zone” (the middle of a long context window where recall fails).
- Thoughtworks Technology Radar Volume 34 (April 2026) — placed AGENTS.md at “Trial,” signalling enterprise readiness.
- Walking Labs’ free course — 12 lectures plus 6 projects, MIT-licensed. The clearest pedagogical treatment of the discipline.
If you read only one external source, read Anthropic’s “Effective harnesses for long-running agents.” If you read two, add Fowler’s catalog. The rest deepen specific topics our cluster expands on.
What’s the single highest-leverage thing you can do today?
Anthropic’s own answer, quoted directly from their best-practices article: “Give Claude a way to verify its work. This is the single highest-leverage thing you can do.”
Concretely: if you do nothing else from this entire series, add one thing to your project today. A PostToolUse hook that runs npm test or pytest after every file edit Claude Code makes. Six lines of configuration. The single biggest reliability upgrade you can make on a typical project. The reason the hook is so effective is that it converts “agent says done” from a subjective claim into an objective measurement: either the test suite exits zero or it doesn’t.
After that, work through the cluster in order. Each post adds another piece of the harness, and the whole stack assembles into a working setup over roughly a month. Our capstone Claude Code Best Practices has a 30-day rollout plan that maps everything into a week-by-week schedule.
Frequently asked questions
Is harness engineering only for Claude Code?
No. The patterns work identically for Cursor, GitHub Copilot, Codex, Aider, Windsurf, and any other agent that can read project files. The only Claude-specific pieces are the file name (CLAUDE.md vs AGENTS.md), the hook configuration syntax (Anthropic’s specific format), and the slash commands (/init, /compact, /clear, /goal). The underlying ideas — instructions file, feature list, progress note, test loop, verification gate — are universal.
How long does it take to set up a real harness?
The minimum viable version is 30 minutes: run /init for your CLAUDE.md, add a PostToolUse hook that runs your tests, and you’re done. A fuller setup that includes a feature list, a progress note, and observability is closer to 3–5 hours total, spread across a week. Our capstone has a 30-day plan that gets you to the complete eight-piece harness without overloading any single day.
Do I need to read all seven posts?
No. Pick by problem. If your agent declares done when it isn’t, read AI Agent Verification. If it drifts into refactors you didn’t ask for, read Feature Lists for AI Coding Agents. If long sessions lose the plot, read Long-Running Claude Code Tasks. If you’ve never thought about any of this before, read Why AI Coding Agents Fail first, then the capstone.
Is harness engineering still relevant if models keep getting better?
Yes — the strong reason is that the workflow problems harness engineering solves (context rot, scope drift, premature wrap-up, hallucinated tools) are mostly invariant to model quality. Better models help with reasoning depth, not with knowing your project’s conventions or running your specific test suite. Anthropic, OpenAI, and the rest are investing in harness tooling exactly because they expect the discipline to outlast any single model generation.
What if my team has no test suite?
Add one. Just one. A single end-to-end smoke test that exercises your most important user flow. Without any tests at all, the agent has nothing to fail against and self-verification becomes meaningless. The first smoke test is the highest-ROI hour you can spend on agent reliability. Once that’s in, you can layer the rest of the harness on top.
Get Smarter About AI Every Morning
Free daily newsletter — one story, one tool, one tip. Plain English, no jargon.
Free forever. Unsubscribe anytime.
1-on-1 Coaching
Claude AI Crash Course
1-hour private video session with James. Walk through your real codebase: CLAUDE.md, AGENTS.md, hooks, feature lists, Plan Mode, the /goal command, observability, and the full harness pattern. Best for developers who want to compress the cluster into one focused session.
Group Format
AI Workshops for Teams
Team workshops for engineering departments standardising the full harness pattern across a codebase — CLAUDE.md, hooks, feature lists, verification gates, observability. Best for teams of 3+ developers shipping production code with AI agents. Custom-built around your repository.
The complete cluster
- Why AI Coding Agents Fail
- What is AGENTS.md? A Beginner’s Guide (+ glossary entry)
- Long-Running Claude Code Tasks
- AI Agent Verification
- AI Agent Observability Guide
- Feature Lists for AI Coding Agents
- Claude Code Best Practices: The Working Developer’s Playbook for 2026
Related Beginners in AI content
- CLAUDE.md: The File That Makes Claude Code Smarter
- The CLAUDE.md Pattern: Why Every AI Project Needs a House-Rules File
- Claude Code Beginners Guide
- Claude Code vs Cursor vs Copilot
- AI Agents for Beginners
- AI Glossary
Sources
- Anthropic — Effective harnesses for long-running agents
- Anthropic — Harness design for long-running application development
- Anthropic — Claude Code best practices
- OpenAI — Harness engineering: leveraging Codex (February 2026)
- Martin Fowler / Birgitta Böckeler — Harness engineering for coding agent users
- HumanLayer — Skill Issue: Harness Engineering for Coding Agents
- Thoughtworks Technology Radar v34 — AGENTS.md (Trial, April 2026)
- Walking Labs — Learn Harness Engineering (free course)
- agents.md — official spec (Agentic AI Foundation / Linux Foundation)
- Claude Code — Grokipedia
Last reviewed: May 2026. The harness-engineering canon is still consolidating — verify on the primary sources above before making major workflow decisions.
Two ways to go further
The AI Prompt Library
1,000+ ready-to-use prompts for Claude, ChatGPT, and Gemini. Stop staring at a blank box.
Get it for $39 →2-Hour Live AI Crash Course
A private, beginner-friendly session across Claude, ChatGPT, Gemini, and the wider landscape.
Book for $125 →