Three settled eras of working with LLMs, plus two more taking shape, each a different thing you tune. Each one builds on the last, none of them get deprecated.
| Era | What you tune | When it dominated | Coined / popularized by |
|---|---|---|---|
| Prompt engineering | The instruction text | 2022–2024 | The community at large |
| Context engineering | The information in the window | 2025 | Tobi Lütke, Andrej Karpathy, Anthropic |
| Harness engineering | The environment around the model | 2026 | Mitchell Hashimoto, OpenAI, LangChain |
| Loop engineering | What drives the agent | 2026 (emerging) | Boris Cherny, Addy Osmani, IBM |
| Graph engineering | The organization of many agents | 2026 (emerging) | Community (contested) |
Mental model:
Graph (emerging)
└── Loop (emerging)
└── Harness
└── Context
└── Prompt
Each layer wraps the one below. A great harness still needs a well-engineered context and a well-written prompt, it just gives you more leverage on top.
Start with the three settled eras — three ways to hire a builder, three levels of leverage:
Each layer is additive. A great harness still needs good blueprints (context) and clear instructions (prompt), it just surrounds them with a worksite designed for reliable delivery.
One trap to avoid: "harness = tools" is a tempting shortcut, but in agent vocabulary "tools" usually means function calls (Read, Edit, Bash) and tool calling arrived with context engineering, not the harness. The harness is more than tools; it's the worksite around them.
Each term emerged when the previous one stopped capturing the most important lever for getting useful work out of a language model.
The pattern is consistent: each new era names existing practice that had outgrown the previous label, not a new technique invented from scratch.
The first era: writing the single instruction that produces useful output in one shot. Few-shot examples, chain-of-thought, role prompts, output format constraints.
What it solved. ChatGPT shipped with a 4k-token context window. To get good work out of it you had to pack the request densely and rely on the model's training. There was no looping, no tool use in production, no MCP, just messages.create() and pray.
Where it ran out. As soon as people started asking the model to work over more than a few hundred lines of code, "write a better prompt" stopped scaling. You couldn't fit the codebase. You couldn't update your prompt every time the file changed. And the model couldn't ask for what it needed, it could only work from what you'd already pre-loaded.
Prompt engineering didn't go away, it became the innermost layer of everything that came after. Open-source coding agents like Cline and Aider still use carefully tuned system prompts; they just don't only use them.
"The delicate art and science of filling the context window with just the right information for the next step." — Andrej Karpathy, June 2025
Coined informally by Shopify's Tobi Lütke in mid-2025 and amplified by Karpathy on X. Anthropic gave it institutional weight in Effective context engineering for AI agents (September 2025), framing it as "the natural progression of prompt engineering."
What it covers. Everything that decides what tokens are in the window when the model runs:
CLAUDE.md, AGENTS.md, project conventionsWhat it solved. With million-token windows and tool use, models could explore a real codebase, read what they needed, and take actions. Cursor, Windsurf, Cline, Aider, the first wave of coding agents , all worked this way.
Where it ran out. Tasks kept getting longer. People started asking coding agents to "clone this site end-to-end" or "migrate this service from Express to Fastify." Two failure modes emerged:
Context engineering also didn't go away, it became the next layer, sitting between the prompt and what came next.
"Any time you find an agent makes a mistake, you take the time to engineer a solution such that the agent never makes that mistake again." — Mitchell Hashimoto, My AI Adoption Journey, February 2026
The term was crystallized by Mitchell Hashimoto in February 2026 and adopted by OpenAI days later. LangChain's Vivek Trivedy followed with The Anatomy of an Agent Harness (March 2026) and the now-quoted formula:
Agent = Model + Harness
What a harness is. Everything around the model that turns a single inference call into a useful agent: the loop, the tools, the sub-agents, the sandboxes, the hooks, the file system, the verification gates, the observability.
What it adds over context engineering. Context engineering optimizes what's inside one window. Harness engineering optimizes the whole environment across many windows over time. The new primitives are the outer loop, fresh contexts per iteration, and verification gates the model can't reason around.
If "harness engineering" sounded like a buzzword, the benchmarks argue otherwise. Daniel Vaughan's The Harness Effect (April 2026) aggregates published numbers showing the same model swings significantly depending on which harness wraps it:
| Benchmark | Model | Spread |
|---|---|---|
| Terminal-Bench 2.0 | Claude Opus | 16 pts |
| CORE-Bench | Claude Opus | 36 pts |
| SWE-bench Pro | Claude Opus | 24 pts |
The takeaway: harness engineering is a measurable performance lever, often bigger than the gap between adjacent model generations. Choosing your harness matters as much as choosing your model.
Geoffrey Huntley's Ralph Wiggum as a "software engineer" (July 2025) predates the term but became the canonical example:
while :; do
cat PROMPT.md | claude-code
done
That's the whole harness. A loop, a prompt file (which the model updates between iterations), and the model itself. Each iteration starts fresh, reads what's left to do, picks one task, completes it, updates the spec, and exits. The next iteration starts clean.
Ralph works because:
Most production harnesses (Claude Code, Codex CLI, Cursor's cloud agents, Devin) are richer than Ralph, but they share the same skeleton.
Synthesizing across LangChain's 11-component breakdown, Anthropic's Claude Agent SDK post, and Birgitta Böckeler's taxonomy, here are the components a coding harness typically wires up:
| Component | What it does | Claude Code example |
|---|---|---|
| Execution loop | Thought → Action → Observation, repeated until a stop condition | The main Claude Code REPL |
| Tools | Schemas the model can call (read, edit, run, search) | Read, Edit, Bash, Grep, WebFetch |
| System prompt + rules | Always-loaded guidance | CLAUDE.md, ~/.claude/CLAUDE.md |
| Persistent guides | Conditional, auto-discovered guidance | Skills (.claude/skills/<name>/SKILL.md) |
| Filesystem as state | Disk holds work in progress, the window doesn't | docs/plans/, docs/reviews/, etc. |
| Sandboxes | Bounded blast radius for execution | Bash sandbox, MCP-isolated tools |
| Sub-agents | Isolated context for parallel or heavy work | .claude/agents/<name>.md |
| Hooks | Deterministic interception of events | PreToolUse, PostToolUse, Stop in settings.json |
| Sensors / oracles | Tests, linters, type checkers, review agents — the verification gates | test-runner subagent, lint hooks |
| Context management | Compaction, summarization, offloading | Auto-compaction in Claude Code |
| Orchestration | Spawning sub-agents, routing, handoffs | Agent tool, /skill invocations |
| Observability | Logs, traces, transcripts across iterations | Session transcripts, hook outputs |
Böckeler groups these into two roles:
Engineering a harness means tuning both, and treating sensor failures as architecture problems, not prompt problems.
Claude Code is itself a harness around the Claude model. The customization mechanisms map directly to the components above.
Each of these is a knob you turn when engineering the harness for a specific project:
CLAUDE.md is your always-on guide. Project conventions go here./security-review skill).secrets.env).PALO IT's Gen-e2 (our AI-first engineering methodology) pipeline is a harness built on these primitives: context-gathering subagents, implementation subagents, and a quality gate of test-runner / security-advisor / ui-reviewer subagents working through shared documents in docs/.
The term is new and the community hasn't fully aligned. A few things to know:
Is harness engineering a successor to context engineering, or a layer on top of it? Böckeler and Anthropic frame it as a layer ("a specific form of context engineering"); other writers frame it as a successor paradigm. This page takes the layered view, harness eng wraps context eng wraps prompt eng, but the disagreement is genuine.
Is "harness" the same as "framework"? Not quite. The loose consensus: a harness is a runtime you live inside (Claude Code, Codex CLI, Cursor); a framework is a library you compose (LangGraph, CrewAI, AutoGen, MetaGPT). The line is fuzzy, LangChain's DeepAgents is described as both.
Was Ralph a harness? Huntley's original post (July 2025) doesn't use the word. The community retroactively classified it as the minimal harness pattern after Hashimoto coined the term. A reasonable retcon, Ralph captures the loop + spec + gate skeleton that every richer harness shares.
The substantive techniques behind harness engineering, loops, sub-agents, sensors, file-based state, all predate the term. The naming is what's new; the practice was already converging.
If harness engineering was the 2026 story, two newer terms are already forming the next layers. Both fit the wrapping model this page uses.
Loop engineering. The harness gives you a reliable environment. Loop engineering is about who drives it. The shift, crystallized across developer threads in mid-2026, is from you prompting the agent to a system that prompts the agent: heartbeat, cron, hook, and goal loops that run until a stop condition is met. In our layered terms, a loop runs on top of a solid harness. The Ralph section above is really the minimal loop, loop engineering just names the practice and adds richer triggers. IBM and others have since published formal definitions, a sign the term is stabilizing rather than trending.
Graph engineering. Newer still, and more contested. Where a loop programs one agent's behavior, a graph programs the organization of many agents: which nodes exist (agents, deterministic functions, routers, human checkpoints), which handoffs are permitted, and how work gets routed and governed across them. The honest state of play: the label's provenance is unsettled, it collides with an older knowledge-graph usage, and even seasoned practitioners have publicly questioned how much it differs from existing graph-orchestration frameworks. The underlying practice, governed multi-agent topologies, is real and has a documented lineage. The name is what's still settling.
How the layers stack (in our view):
Graph → the organization of many looped agents
└── Loop → what drives a single agent inside its harness
└── Harness → the environment around one model
└── Context → what's in the window
└── Prompt → the instruction itself
Same pattern as before, each layer wraps the one below and none get deprecated. For enterprises the practical takeaway is unchanged. Get the harness solid first. Loops without trustworthy sensors just hallucinate completion faster, and graphs without reliable loops just do it at greater scale. That's the ground our agentic Gen-e2™ pipeline is built on: verification gates that hold whether you're running one loop or orchestrating many.
If you're starting from a Claude Code project today:
CLAUDE.md — project conventions, where things live, what the model should never do.test-runner subagent that runs the test suite and reports pass/fail is the simplest oracle you can build. Wire it into your workflow so the model can't claim "done" without it./plan, /execute, /validatedocs/plans/. Reviews go in docs/reviews/. Architecture decisions go in docs/architecture/. The context window is disposable; the filesystem is forever.Order matters. A loop without sensors produces hallucinated completion at high speed. A sensor without a loop wastes its signal. Build the gates first.
On GitHub Copilot? The same primitives apply: always-on instructions, conditional prompts, custom agents, skills. Microsoft's hve-core packages a ready-made set (49 agents, 102 instructions, 63 prompts, 11 skills) as a VS Code extension and CLI plugin for Copilot users, a useful reference for what a packaged Copilot harness looks like.
Loops, sensors, sub-agents, skills , it's a lot of knobs to turn, and most teams are figuring out the right combination in production. That's exactly the kind of work we live in every day. Our agentic Gen-e2 pipeline is built on the same primitives we just walked through: context-gathering subagents, implementation subagents, and a quality gate that won't let "done" slide through without proof.
If you're AI-first and want a harness that actually holds up past the demo, we'd love to hear what you're building. Reach out, swap war stories, or just tell us where your loop keeps breaking . Get in touch.
Primary sources
Agent = Model + Harness formula.Examples and implementations
create_agent.