Live on Product Hunt Intraface launched today. Less steering, more vacations. See the launch
Start for free

What is context engineering?

Context engineering is the practice of deciding what goes into a model's context window at every step of an agent's run: the system prompt, tool definitions, retrieved documents, message history and tool results. The aim is the smallest set of high-signal tokens that makes the right outcome likely, because attention is finite and more context is not automatically better.

Part of Glossary: the terms behind MCP, coding agents and shared pages, defined plainly.

How it works

At each turn the harness chooses which instructions, tools and knowledge go into the window; the model asks for more only when the task needs it.instructionssystem prompt, rulestoolsdefinitions, resultsknowledgefiles, docs, notesthe harnesspicks, trims, summarisescontext windowthis turn's inputthe modelalwaysa small, clear setjust in timethe chosen tokensasks to read more
  1. Start with the fixed part: a system prompt at the right altitude, specific enough to guide but general enough not to break, and a small, clear set of tools.

  2. Load knowledge just in time. Keep light references (a path, a query, a link) in context and fetch the content when the task calls for it.

  3. Watch the window as the agent works. Old tool results, long file reads and chatter all cost attention on every later turn.

  4. When a run gets long, compact: summarise the history, keep the decisions and open threads, drop the noise.

  5. For work that outgrows one window, write notes to a file the next session reads, or hand sub-tasks to subagents that return a short summary.

Source: Anthropic: Effective context engineering for AI agents

Context engineering versus prompt engineering

Prompt engineering is about the words: how to phrase a system prompt so the model does what you want. Context engineering is about the whole input, at every step of an agent's run. A prompt is written once. Context is assembled again on every turn: which instructions load, which tools are offered, which files are read in full and which are only named, how much of the history survives, what a subagent reports back. Anthropic's engineering team describes this as a shift from finding the perfect wording to curating what reaches the model's limited attention each time it is called.

The reason it is a separate discipline is that attention is finite. Each token in the window takes a share of it, and recall drops as the input grows. So more context is never free, and giving the model everything is usually the wrong default. The goal is the smallest set of tokens that still carries the signal the task needs.

Example: a coding agent reading a repository

Consider two ways to start a session on a large codebase. The first pre-loads: the harness embeds every file, picks the top matches for your request and pastes them in before the model has read a word. The second gives the agent a map and a shovel: a short instruction file with the layout and conventions, a file tree, and tools to read, search and run things. The agent then opens the three files it decides it needs.

Claude Code works the second way, with one exception: instruction files such as CLAUDE.md load at start, because they are short and apply every time. Everything else arrives just in time. On an Intraface board the same idea applies to the document itself: the board's collab.md travels with the page, so any agent that pulls it reads the house rules before editing. The trade-off is speed. Exploring at run time costs turns, and the agent needs good tools and good signposts, such as file names, folder names and timestamps, to explore well.

When to use it

Context engineering matters whenever a run is long or the inputs are large: multi-step coding tasks, research that reads many documents, anything that calls tools in a loop. For a single question with a short answer, write a good prompt and stop. For a long run, three techniques carry most of the weight:

  • Compaction. When the window nears its limit, summarise the history and continue from the summary. Keep decisions, unresolved problems and the files in play; drop the rest. Clearing stale tool results is the safest first step.
  • Notes outside the window. Have the agent write progress and decisions to a file it reads back later. This is what Claude Code's auto memory does between sessions.
  • Subagents. Give a focused sub-task its own clean window and take back only a short summary. The main agent keeps its attention for coordination.

Common mistakes

  • A bloated toolset. If a person could not say which of two tools to call, the model will not do better. Fewer tools, clearly separated, beat an overlapping set.
  • Exhaustive instructions. Listing every edge case teaches the model to pattern-match the list. A few diverse, canonical examples usually work better than more rules.
  • Treating instruction files as enforcement. An instruction in context is advice the model weighs. Something that must always happen belongs in a hook or a permission rule, not a sentence.

FAQ

Is context engineering just a new name for prompt engineering?
No. Prompt engineering is about wording an instruction well. Context engineering covers everything the model sees on each turn, including tools, retrieved files, tool results and how much history survives, and it is redone every step of an agent's run.
Does context engineering still matter with very large context windows?
Yes. A bigger window changes how much you can send, not how well the model attends to it. Recall still falls as the input grows, so a large window used carelessly produces worse answers than a small one used well.
Where does context engineering happen in a coding agent?
Mostly in the harness, not the prompt: which instruction files load at start, which tools are offered, whether files are read whole or on demand, when the conversation is compacted, and what a subagent is allowed to report back.

Stop sending HTMLover Slack.

Create an account in a minute, connect your coding agent, and make your first board.