Glossary

ConceptAgents & Tool Use

Context Engineering

At a glance

Choosing what tokens enter an LLM's context window on each turn so the model can do the next step well.

Who this is for
Engineers and technical readers learning the terms used in AI systems.
Topics
  • Agents & Tool Use
  • Concept

In short

Context engineering is choosing what tokens enter an LLM's context window on each turn so the model can do the next step well. Bigcircle treats prompt engineering as the instruction layer inside that job, uses context compaction and agent memory when history grows, and puts assembly and compaction in week 1-3 of a harness engineering engagement.

Key facts

Definition

Context engineering is choosing what the model is allowed to read on each call, including instructions, tools, retrieved facts, history and any summary that replaced older turns, so the next action has the facts it needs.

How Bigcircle does it

  1. Bigcircle treats context engineering as harness work rather than a longer system prompt, and builds context assembly and compaction so the window holds what matters instead of an ever-growing transcript.
  2. Bigcircle keeps recent turns verbatim, compacts older ones once they cross a threshold, and moves durable facts into agent memory instead of carrying the whole transcript.
  3. On harness engineering engagements, Bigcircle fixes context assembly and compaction in week 1-3 first, then schema-enforced tool output with a repair path, so failures that look like the model being unreliable are caught in the runtime.

Comparison

Prompt engineering writes the standing instructions and examples; context engineering decides which of those instructions still earn a slot on this turn, and what tools, retrieval and history sit beside them; context compaction shrinks history inside the live window; agent memory writes durable facts outside the window.

Key number

In week 1-3 of a harness engineering engagement, Bigcircle fixes context and tools first: assembly and compaction, then schema-enforced tool output with a repair path, because these two account for most of the failures that look like the model being unreliable.

Context engineering is deciding what sits in a model's context window before each call, so the next step has the right instructions, tools, retrieved facts and history. The point is not to stuff the window. Keep the signal the model needs for the next action, and leave the rest out before noise starts to win.

Prompt engineering still owns how you write the system prompt. This page is the wider runtime choice: what enters the window, what leaves, and what lives outside it in agent memory. The mid-2025 phrasing caught on because production agents already spent most of their failure budget on that choice. Tobi Lütke (@tobi, 19 June 2025) and Andrej Karpathy (@karpathy, 25 June 2025) both preferred "context engineering" to "prompt engineering" for that reason.

The context window page covers the token budget, and context rot covers the reliability drop as input grows. Context compaction covers how you shrink history mid-task. This page is the practice those three sit inside.

What is context engineering?#

Context engineering is the per-call choice of what the model is allowed to read: the standing instructions, the tools this step may use, the passages you retrieved, the recent history, and any summary that replaced older turns. Anthropic's Effective context engineering for AI agents, checked 18 November 2026, is the essay most teams now point to for that shift. They treat it as what you do after writing the system prompt, once a run lasts many turns and most of the window is no longer the prompt you typed.

The useful unit is not one clever sentence. It is the full state the model sees on this call: system instructions, tool definitions, retrieved passages, message history, and any summary that replaced older turns. For a team shipping an LLM feature, the definition is operational. On every turn, pick only the tokens that still help the next action. Leave a needed constraint out and the model invents. Paste spent tool dumps or a long repeated transcript and you pay for tokens the model starts to skip, which is the curve context rot already names. That is a per-call selection under a limited window, not a one-time rewrite of the system prompt.

What enters the window this turnInstructions are one slice. Tools, retrieval, history and memory fill the rest.instructionstools + RAGhistorythis callprompt layerselected incompactedhigh-signal onlyPrompt engineeringhow the standing instructions are writtenContext engineeringwhat the model is allowed to see next

Context engineering vs prompt engineering#

Prompt engineering is the craft of writing the standing instructions and examples. Context engineering is the later decision, made again every turn, of which of those instructions still earn a slot, and what tools, retrieval and history sit beside them. The same Anthropic essay is often cited for that split; send the reader there for their wording. The two stack. A clear system prompt still fails if the window is full of spent tool results and stale retrieval.

CriterionPrompt engineeringContext engineering
Main questionHow should the instructions be written?What should the model see on this turn?
Typical objectSystem prompt, examples, output formatInstructions plus tools, retrieval, history, memory
CadenceEdited when the product rules changeRe-chosen on every agent turn
Failure modeVague or brittle wordingNoise, missing facts, or a window the model no longer uses well
Neighbour pagesPrompt engineeringContext window, context rot, context compaction, agent memory, RAG

Use prompt engineering when the model misunderstands the task with a short, clean window. Move to context engineering when the instructions are fine and the failure is missing evidence, tool bloat, or a transcript past the length the model still reads carefully.

Context engineering for AI agents#

Agents make the practice unavoidable because each tool call adds tokens that might matter on the next turn. LangChain's Context Engineering for Agents post, checked 18 November 2026, groups the usual tactics as write, select, compress and isolate. For a team shipping agents, those four names are runtime jobs, not a reading list.

Write means parking facts outside the live window so a later turn can reload them, which is the scratchpad and agent memory pattern. Select means pulling only the tools, notes or RAG passages this step needs, instead of pasting the whole registry or corpus.

Compress means context compaction: summarize older turns, clear spent tool results, and keep recent work verbatim. Isolate means giving a sub-agent a clean window for a narrow job and returning a short summary to the parent, so deep search stays out of the lead agent's attention budget.

Skip none of those when a single run already spans many tool calls. Waiting for a larger advertised window does not cancel context rot. That page already cites Anthropic's "attention budget" framing: every extra token spends some of that budget, and recall gets worse as the input grows. Design the write, select, compress and isolate rules in code you can test, then tune them against real traces.

How Bigcircle does it#

We treat context engineering as harness work, not as a longer system prompt. Our harness engineering service builds context assembly and compaction so the window holds what matters instead of an ever-growing transcript. In week 1-3 of that engagement we fix context and tools first: assembly and compaction, then schema-enforced tool output with a repair path. These two account for most of the failures that look like the model being unreliable.

We recommend the same shape already on the context window and context compaction pages: keep recent turns verbatim, compact older ones once they cross a threshold, and move durable facts into agent memory.

We treat deliberate compaction as an active decision about what to keep, what to summarize, and what to drop, because hoping the model will ignore irrelevant content is not a plan. That practice is named on the AI agents roadmap: summarize and prune so the window holds the right facts, not all of them.

Prompt engineering stays the page for system prompts and instruction structure. This page owns the per-turn assembly job those instructions sit inside.

When a better prompt is not enough#

Stay on the prompt while the window is short and the model still misses the task. Rewrite instructions, add examples, and tighten the output contract before you build compaction or memory.

Add context engineering when history or tool output is crowding out the next answer, or when retrieval dumps mediocre passages into the prompt. Add it also when an early constraint still sits in the middle of a long transcript and the model has started skipping it. Fix RAG when the window is full of documents rather than conversation. Add context compaction when older turns can become a summary, and add agent memory when a fact has to survive every summary.

A sharper sentence helps when the model misunderstands you. It does not help when the model never saw the right evidence, or saw so much noise that the evidence no longer lands.

Common questions about context engineering

  • What is context engineering?

    Context engineering is choosing what tokens enter an LLM's context window on each turn so the model can do the next step well. It covers instructions, tools, retrieved facts, history and compaction, not only how you phrase a prompt.

  • How is context engineering different from prompt engineering?

    Prompt engineering is the craft of writing the standing instructions and examples. Context engineering is the later decision, made every turn, of which of those instructions still earn a slot, and what tools, retrieval and history sit beside them. A clear system prompt still fails if the window is full of spent tool results and stale passages.

  • What is context engineering for AI agents?

    For AI agents it is the runtime policy that writes notes outside the window, selects only the tools and passages this step needs, compresses older turns, and isolates deep work in sub-agents with clean windows. Each tool call adds tokens that might matter next, so the choice repeats every turn.

  • What does context engineering mean for an LLM?

    For an LLM it is the per-call choice of what to put in a limited window: enough useful tokens for the next action, and no more. Leave a needed fact out and the model invents. Fill the window with low-signal history and reliability falls even though the call still fits.

Let's build something that ships.

Tell us what you're building. We'll tell you whether it needs a fixed-scope build, a prototype taken to production, or a programme we run, what's achievable, and where the real bottlenecks are.

Reply within 2h

We store your name, email, company, and message, and email a copy to hello@bigcircle.ai. Read the privacy page and the terms.