Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Explainer

What is context engineering?

Context engineering is deciding what a model sees at each step. Why the term replaced prompt engineering for people building agents, and what the work involves.

By 6 min readUpdated
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark
On this page

Context engineering is the practice of deciding what information a language model has in front of it each time it generates a response: which instructions, which documents, which tool definitions and results, how much of the conversation so far. The term spread through 2025 as people building agents found that their hardest problems were not about wording a prompt but about managing everything around it.

Anthropic’s engineering team put it this way in September 2025: context engineering is about finding “the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome” (Anthropic). The rest of this article unpacks that sentence.

Why a new term?

“Prompt engineering” made sense when the main way to use a model was a single message in a chat box. You wrote a prompt, you got an answer, you improved the prompt.

Agents broke that model. A coding agent working on a task for twenty minutes might make a hundred model calls. Each one includes a system prompt, project instruction files, the definitions of every tool it can use, the results of earlier tool calls (file contents, test output, search results), and a growing conversation. The prompt you typed is a few lines in a context that may run to hundreds of thousands of tokens. Most of what the model sees, you did not write by hand in that moment.

So the useful question changed from “how do I phrase this?” to “what should be in the window at this step, and what should not?” That is context engineering. Prompt writing is still part of it; it is just no longer most of it.

Why not include everything?

Context windows are large now. Several current models accept a million tokens. It is tempting to treat that as permission to include everything that might help. In practice this goes wrong in three ways:

  • Recall degrades as context grows. Models are less reliable at finding and using a specific detail in a very long input than in a short one. Anthropic calls the effect context rot. An instruction can be present and still be overlooked.
  • Irrelevant material misleads. A model will use what it is given. An outdated document or a nearly-relevant search result pulls answers in the wrong direction.
  • Cost and latency scale with tokens, and in a multi-step agent the whole context is sent on every step.

Treat the context window as a budget with a quality cost, not a bucket.

What context engineering involves

In practice it covers a handful of recurring decisions.

Instructions that persist. System prompts and instruction files such as CLAUDE.md and AGENTS.md. They should hold what the model cannot discover on its own (commands, conventions, boundaries) and little else, because they are loaded every time.

Retrieval: pre-load or fetch on demand. You can put documents in the context up front, or give the model tools to search and read what it needs as it goes. Coding agents mostly do the latter: they keep file paths and search results light and open files only when needed. Retrieval-augmented generation is the same idea for document collections.

Tool design. Tool definitions sit in context on every call, and tool results flow into it. Fewer, well-described tools and results trimmed to what matters keep the context focused. Twenty connected MCP servers with a hundred tools between them cost a lot of attention before the user has said anything.

Progressive disclosure. Load a short description first and the details only when relevant. Agent Skills work this way: the agent sees each skill’s name and description, and reads the full SKILL.md only when a task calls for it.

Memory and compaction. Long tasks outgrow any window. Compaction summarises the conversation so far and starts fresh from the summary. Agents can also keep notes in files (a to-do list, a progress log) and re-read them, which survives compaction better than conversation history.

Isolation. Hand a large, self-contained sub-task to a sub-agent with its own context, and bring back only the result. The main context stays clean.

What changed in 2026

Three developments, checked on 25 November 2026, have made the discipline more concrete.

Bigger windows, same advice. Every current Claude model now has a 1M-token context window, which Anthropic puts at roughly 555,000 words on its current tokenizer (models overview). Research published since says size does not remove the problem. A study submitted in October 2025 found performance fell by 13.9% to 85% as input grew, even when the model could retrieve all the relevant information perfectly (Du et al., arXiv 2510.05381). Context rot covers that evidence.

Instruction files as maps. OpenAI’s report on building a product with Codex, published on 11 February 2026, says a single large instruction file failed: it crowded out the task and went stale. What worked was a short AGENTS.md of about 100 lines that points to deeper documents, “a map, not a 1,000-page instruction manual” (OpenAI). The same post’s line that anything the agent “can’t access in-context while running effectively doesn’t exist” is a fair summary of this whole page. Harness engineering covers the rest of that report.

Progressive disclosure became a standard. On 22 October 2026 Anthropic donated Agent Skills, the format that loads a skill’s name and description first and the body only when needed, to the Agentic AI Foundation under the Linux Foundation. Anthropic says more than 70 agent platforms have adopted it (Anthropic). Writing skills is now one of the main ways to keep specialist instructions out of the context until they are needed.

A simple test

When an AI system gives a bad answer, look at the full context it received for that step before changing anything. Ask:

  1. Was the information it needed actually there?
  2. Was there anything misleading or stale?
  3. Was the key instruction buried, contradicted, or far from where it mattered?

Most fixes follow from those answers: add the missing document, remove the stale one, move or reword the instruction. Rewriting the prompt without looking at the context is guesswork.

What it means for different people

If you build LLM features, context engineering is most of the job. Log the exact context of each call so you can inspect failures, keep stable content at the start of the prompt (it is also what prompt caching rewards), and measure changes with evals.

If you use coding agents, you are doing context engineering when you write an AGENTS.md, choose which MCP servers to connect, clear the conversation between tasks, or ask the agent to plan before coding. Small habits here change results more than clever prompts.

If you use chat assistants at work, projects and saved instructions are your context tools. Attaching the right document and saying who the output is for matters more than any phrasing trick.

Next steps

Covers

Back to top