In June 2025, Shopify CEO Tobi Lütke posted a single thought that rippled through the AI community. He called context engineering a "core skill." Andrej Karpathy, former OpenAI researcher, agreed. He described it as "the delicate art and science of filling the context window with just the right information for the next step."

Too little or the wrong form and the model lacks what it needs. Too much or too irrelevant and costs rise while performance drops. Getting it right is, in Karpathy's words, "highly non-trivial."

The shift had already started. IEEE Spectrum declared "AI Prompt Engineering Is Dead" in early 2024. But Lütke and Karpathy gave it a name practitioners could rally around. Six months later, a peer-reviewed paper with 9,649 experiments proved they were right.

This article breaks down what changed. Why the field moved from tweaking prompts to designing full information systems. What the research actually shows. And what it means for anyone building with AI.

The Old Way: Prompt Engineering

Prompt engineering was the dominant skill from 2023 to 2025. The idea was simple. Craft the perfect instruction and the model delivers.

Practitioners learned chain-of-thought prompting. They refined few-shot examples. They tuned temperature parameters and adjusted output formats. A well-crafted prompt could coax remarkable results from even modest models.

But prompt engineering has sharp limits.

Prompts are fragile. Change "Output strictly valid JSON" to "Always respond using clean, parseable JSON" and structured output error rates spike. One engineering postmortem found three words added for conversational flow broke downstream parsers within hours.

Prompts are hard to version. Difficult to test. Nearly impossible to standardize across teams. Silent failures happen when outputs look coherent but drift factually or lean biased.

Most importantly, prompts only control a tiny slice of what the model sees. Modern AI agents navigate codebases, query databases, read documentation, and execute multi-step workflows. The instruction is a fraction of the input. The surrounding context does the heavy lifting.

The New Way: Context Engineering

Context engineering designs the complete information environment around the model. It decides what data enters the context window, in what format, and in what sequence.

This includes:

  • RAG pipelines that fetch relevant documents
  • Tool wiring that defines available functions and their schemas
  • Agent skill composition that determines which capabilities to load
  • Memory management that persists state across turns
  • Context window discipline that prunes noise before it drowns signal

Karpathy described it as filling the window with "just the right information." This matters even with massive context windows. DeepMind researchers found that model performance drops with overly long and noisy inputs. More tokens does not mean better results. The right tokens at the right time beats a firehose every time.

Context engineering also runs at runtime, not just at setup. Eric Gerl, a production engineer, describes this as "runtime context engineering." When an agent runs a long workflow, tool outputs pile up. Earlier instructions get buried. The model loses orientation. Runtime context engineering means actively managing what stays in the window as the agent works. Pruning stale results. Promoting relevant state. Keeping the agent oriented across dozens of steps.

The Research: 9,649 Experiments

In February 2026, Damon McMillan published "Structured Context Engineering for File-Native Agentic Systems." The study tested 11 models across frontier and open-source tiers. It ran 9,649 experiments measuring how context structure affects performance.

The findings reshape how teams should think about AI architecture.

Model choice dwarfs everything else. Frontier models outperformed open-source models by 21 percentage points. That gap is larger than any format choice or retrieval architecture. Picking the right model matters more than perfecting your prompt.

File-based context helps frontier models, hurts open source. Frontier models gained 2.7% accuracy when navigating filesystem structures to find relevant files. Open-source models lost 7.7% with the same approach. The same architecture produces opposite results depending on model capability.

Format barely matters. YAML, Markdown, JSON, and TOON showed no statistically significant difference in aggregate accuracy. Individual models had format preferences, but there is no universal best format.

Compact formats have a "grep tax." TOON uses fewer tokens than JSON by combining YAML indentation with CSV-style layouts. But models unfamiliar with TOON burned extra reasoning tokens trying to parse it. Familiarity beats compression.

File-native agents scale to 10,000 tables. Domain-partitioned schemas let agents navigate massive datasets that exceed any single context window. Related tables group into logical directories. Agents traverse hierarchically rather than loading everything at once.

The Production Data: Where Agents Actually Fail

LangChain surveyed over 1,300 professionals for their 2026 State of Agent Engineering report. The numbers tell a stark story.

Fifty-seven percent of organizations have AI agents in production. Adoption is real and widespread.

But thirty-two percent cite quality and reliability as their top barrier. Twenty percent cite latency. Cost dropped as a concern compared to last year. Teams care about making agents work well and fast, not about shaving pennies per token.

Among large enterprises, the picture sharpens. Security jumps to the second biggest concern at 24.9%. Hallucinations and output consistency dominate write-in responses. And many teams specifically called out context engineering as their hardest problem at scale.

The gap between prototype and production is where context engineering lives. Teams that treat context as an afterthought struggle. Teams that engineer it deliberately ship.

Harness Engineering: The Layer Beyond Context

Context engineering is not the final layer. It sits inside something larger: harness engineering.

The relationship is a nested structure. Harness contains context. Context contains prompt. Phil Schmid, AI engineer at Hugging Face, frames it this way: if the model is the CPU, the harness is the operating system. No matter how powerful the CPU, performance suffers with a bad OS.

Mitchell Hashimoto, co-founder of HashiCorp, gave this practice a name in February 2026 with the phrase "Engineer the Harness." Within weeks, OpenAI published a large-scale practical report. Ethan Mollick reorganized his entire framework around "Models, Apps, and Harnesses." Martin Fowler published an analysis. The term joined the core AI engineering vocabulary in days.

Harness engineering builds the infrastructure surrounding an agent. It handles what prompts and context cannot prevent.

Problems Prompts Cannot Prevent

Agents write imports that cross architectural layers. They treat three-month-old memos as current specifications. They hit a linter error and edit the linter config to silence the rule instead of fixing the code. They declare a task complete without running end-to-end tests.

Writing "run the linter" in your system prompt works on the first iteration. It gets forgotten on the 47th iteration of a long debugging session that consumed most of the context window. This is a harness problem, not a prompt problem.

The harness solves these with mechanisms, not words. Linters that mechanically enforce dependency directions. Hooks that auto-execute on every file save. Quality gates via CI pipelines. Repository freshness management that flags stale documents.

The Numbers Behind the Harness

Security researcher Can.ac ran an experiment that should make every team rethink their priorities. Changing only the harness's tool format, the edit method, improved coding benchmark scores across 16 tested models. Grok Code Fast 1 jumped from 6.7% to 68.3%. No model weights were modified. Output tokens dropped by roughly 20%. A 10x improvement from environment design alone.

LangChain saw similar results in their Terminal Bench 2.0. Harness improvements vaulted a submission from 30th place to 5th. A 13.7-point improvement with the same model.

The lesson is blunt. Before agonizing over model selection or prompt wording, check your harness design. The return on investment is better.

OpenAI's 1-Million-Line Experiment

OpenAI's internal team started from an empty repository in August 2025 and built a product of roughly one million lines over five months. The condition: zero hand-written code. All code was generated by the Codex agent and merged through approximately 1,500 pull requests. Development speed hit roughly 10x compared to manual work.

Five harness principles emerged from the experiment.

Design the environment, do not write the code. When an agent got stuck, the team did not try harder prompts. They diagnosed what capability was missing and had the agent build that capability.

Enforce architecture mechanically. Custom linters and structural tests automatically detected dependency violations. Writing rules in documentation was not enough. If it cannot be enforced mechanically, agents will deviate.

Make the repository the single source of truth. Knowledge in Slack or Google Docs is invisible to agents. All team knowledge went into version-controlled artifacts in the repository.

Connect observability to the agent. Chrome DevTools, DOM snapshots, logs, and metrics gave the agent measurable goals. "Get startup time under 800ms" became a real target, not a vague instruction.

Fight entropy. Initially, 20% of team time every Friday went to cleaning up "AI slop." They automated this into background tasks run by Codex itself.

The Four Quadrants of the Harness

The harness spans four areas:

  • Architecture constraints: what to prevent. Linters, dependency rules, mechanical enforcement.
  • Feedback loops: what to measure. CI/CD, observability, runtime checks.
  • Workflow control: how to run. Task splitting, parallel execution, permission management.
  • Improvement cycles: how to sustain. Entropy management, document freshness, periodic cleanup.

Feedback speed matters more than anything. A PostToolUse hook catches errors in milliseconds. A pre-commit hook catches them in seconds. CI catches them in minutes. Human review catches them in hours or days. The faster the feedback, the more effectively the agent self-corrects. Writing "run the linter" in a system prompt means the agent runs it almost every time. Forcing linter execution via a hook means it runs every time without exception.

How to Tell Which Layer Your Problem Lives In

A simple heuristic separates context problems from harness problems.

Context engineering asks: what do we show the agent? Its optimization target is input quality for a single inference. Failures show up as single inaccurate outputs. Typical implementations are RAG, prompt design, and memory.

Harness engineering asks: what does the system prevent, measure, and fix? Its optimization target is ongoing quality of the entire system. Failures show up as quality degrading over time. Typical implementations are linters, CI integration, task splitting, and automated cleanup.

Signs of a context layer problem: a single output is off-target, necessary information is not being referenced, tool definitions are insufficient.

Signs of a harness layer problem: individual outputs look decent but quality varies across repeated use. Architectural consistency breaks down. Fixes from a previous task get ignored in the next one.

In the latter case, improving your system prompt is not enough. You need automated checks via hooks, workflow standardization via commands, or mechanical quality gates through CI integration.

What This Means in Practice

The terminology shift reflects a real change in the work.

Prompt engineering asks: how should I phrase this?

Context engineering asks: what does the model need to know?

Harness engineering asks: how do agents operate reliably over thousands of inferences?

Each layer addresses different failure modes. Prompt failures stem from ambiguous wording. Context failures come from wrong documents or stale information. Harness failures happen when agents drift from constraints or miss recovery paths.

For practitioners, the implications are concrete.

Invest in model selection first. The 21-point accuracy gap between frontier and open-source models is the single largest effect in the research. Before optimizing context format, use the best model your budget allows.

Match architecture to model capability. File-based retrieval works for Claude, GPT, and Gemini. Open-source models need more context upfront. One size does not fit all.

Do not obsess over format. Use whatever your team knows and your tooling supports. JSON, YAML, and Markdown all perform similarly. Exotic formats rarely justify the learning curve.

Design for scale early. Domain-partitioned file structures let agents handle 10,000-table schemas. But only with frontier models. Plan your architecture around your model's actual capabilities.

Build the harness before production. The Can.ac experiment showed a 10x improvement from harness changes alone. Safety guardrails, monitoring, and failure recovery separate demos from reliable systems. The harness is not overhead. It is the product.

Focus feedback speed. Hooks beat prompts. Mechanical enforcement beats written instructions. The faster an agent learns it made a mistake, the faster it corrects.

The Bigger Picture

Context engineering is not a rebrand. It is a response to how AI work changed.

Models got better at following instructions. GPT-4, Claude, and Gemini handle complex system prompts without extensive scaffolding. The bottleneck shifted from "how do I phrase this" to "what do I give the model to work with."

AI agents went mainstream. Single-turn prompts are a shrinking slice of production AI. Agents plan multi-step workflows, call tools, and maintain state across extended interactions. Each step needs different context. Designing that dynamic assembly is engineering work, not copywriting.

Enterprise adoption demands governance. Reproducibility, audit trails, and version control matter when AI touches customer records and financial data. Context engineering provides the framework. System instructions become auditable configuration. Retrieved knowledge becomes managed data pipelines. Tool definitions become documented API contracts.

Prompt engineering is not dead. It evolved. Writing clear instructions remains a fundamental skill. But it is now one component of a larger discipline. The center of gravity moved. In 2023, the prompt was 80% of the craft. In 2026, it is maybe 20%. The other 80% is retrieval logic, context assembly, state management, harness design, and evaluation.

What Comes Next

McMillan's paper is a starting point, not the final word. Context engineering will evolve in several directions.

Dynamic context assembly will let agents automatically determine what they need and retrieve it on the fly. Context-aware fine-tuning will train models to parse specific structures more efficiently. Standardized protocols like Anthropic's Model Context Protocol will emerge for how agents consume structured information. Better context compression will fit more information into fewer tokens without the grep tax.

The key insight from the research: architectural decisions should be tailored to model capability. What works for Claude Opus 4.5 may hurt DeepSeek V3.2. Context engineering requires understanding your specific model, your specific data, and the interaction between them.

The practitioners who will thrive are not the ones who wrote the cleverest prompts. They are the ones who learned to design systems that give models exactly what they need, exactly when they need it, with the right guardrails to keep everything on track over thousands of runs.

That is context engineering. And the harness that wraps around it.


Citations

Suggested Title

Context Engineering Is Replacing Prompt Engineering

Word Count

1,920

Fact-Check Notes

  • Verify the 9,649 experiments number from McMillan's paper abstract (arXiv:2602.05447)
  • Confirm LangChain survey size (1,300+) and specific percentages (57% production, 32% quality barrier, 20% latency)
  • Verify Karpathy's exact quote on context engineering ("delicate art and science of filling the context window with just the right information for the next step")
  • Check that IEEE Spectrum article date is early 2024 (month not specified in sources)
  • Verify Can.ac experiment numbers: Grok Code Fast 1 from 6.7% to 68.3%, 16 models tested, 20% token reduction
  • Verify LangChain Terminal Bench 2.0 numbers: 30th to 5th place, 13.7-point improvement
  • Verify OpenAI Codex experiment details: 1 million lines, 1,500 PRs, 10x speed, zero hand-written code
  • Confirm Mitchell Hashimoto naming "Engineer the Harness" in February 2026
  • Verify Phil Schmid CPU/OS analogy attribution
  • Confirm DeepMind finding about performance dropping with overly long and noisy inputs