Solutions
Implementation Org Review Org Monitoring Managed Services
Agents
Discovery Agent Metadata Agent Design Agent Build Agent Test Agent Governance Agent Support Agent
Industry Solutions
Financial Services
Healthcare & Life Sciences
NDIS & Disability Services
Nonprofit
Not-for-Profit
Other Industries
Recruitment & Staffing Real Estate Cosmetic Procedures
Agentforce Claudeforce Blogs Pricing Docs
Blogs This article

Context Engineering: The Discipline That Decides What AI Can Build

context-engineering
AC Written by Amit Choudhary November 24, 2026
Summarize with AI ChatGPT Claude Perplexity

Context engineering is the practice of curating what a model sees during inference, and it governs output quality more than prompt wording does. Teams getting disappointing results from an AI assistant almost always diagnose a model problem, try a bigger model, then try a bigger context window. Both moves make it worse.

Both moves make the problem worse, and there is now vendor documentation explaining why.

Anthropic renamed the problem, and the rename carries the insight

Start with the terminology, because it marks a shift in what the work actually is.

Anthropic published Effective context engineering for AI agents on 29 September 2025, updated 18 October 2026, written by its Applied AI team. Its opening move is to separate two things most organizations still treat as one.

Prompt engineering, in that document, covers methods for writing and organizing instructions. Context engineering is defined as the set of strategies for curating and maintaining the optimal set of tokens during inference, including all the other information that may land there outside the prompts.

Anthropic enumerates what that state contains, and the list is the scope of the discipline: system instructions, tools, Model Context Protocol connections, external data and message history. Naming MCP there matters for anyone buying a platform, because a protocol that brings external systems into the context window is a context decision rather than an integration decision, and it is usually owned by whoever bought the integration. Anthropic frames building with language models as becoming less about finding the right words and more about answering what configuration of context is most likely to generate the desired behavior.

Read the difference in terms of who owns it. Prompt wording is an author’s craft, and it sits with whoever writes the instruction. Context configuration is an architecture decision about what the system retrieves, how fresh it must be, and what it costs per call. That belongs to whoever owns the platform, which means it has arrived on a different desk than the one prompt engineering landed on.

Context rot means recall falls as tokens accumulate

Here is the finding that invalidates the bigger-window instinct.

Anthropic describes context rot directly: as the number of tokens in the context window increases, the model’s ability to accurately recall information from that context decreases. It notes some models degrade more gently than others, and that the characteristic emerges across all models.

Two qualifiers matter for anyone repeating this to a steering committee. Anthropic describes the result as a performance gradient rather than a hard cliff, and says models remain highly capable at longer contexts while showing reduced precision for retrieval and long-range reasoning. So this is not a claim that long context fails. It is a claim that long context costs accuracy, which makes it a trade rather than a free upgrade.

Procurement finds the practical consequence uncomfortable. A larger context window is sold as more capability. What it supplies is more room to make a decision you were already making badly, and Anthropic’s own position is that context windows of all sizes will stay subject to context pollution and relevance concerns for the foreseeable future.

An attention budget depletes with every token you add

Underneath sits an architectural explanation, and it is worth carrying because it tells you the shape of the cost.

Anthropic describes language models as having an attention budget drawn on when parsing large volumes of context, where every new token introduced depletes that budget by some amount. Transformer architecture is the cause: every token can attend to every other token, which produces n squared pairwise relationships for n tokens. As context length rises, the model’s ability to capture those relationships gets stretched thin, creating what the document calls a natural tension between context size and attention focus.

There is a second reason given, and it is less often quoted. Models develop attention patterns from training distributions where shorter sequences are more common, so they have less experience and fewer specialized parameters for context-wide dependencies.

Treat context as a finite resource with diminishing marginal returns, which is Anthropic’s own instruction, and the budgeting question becomes obvious. The question stops being what can we fit and becomes what earns its place.

The smallest set of high-signal tokens outperforms the largest set

That reframing produces a design rule you can hold teams to.

Anthropic states the goal as finding the smallest possible set of high-signal tokens that maximize the likelihood of a desired outcome. It adds a clarification that prevents the rule being misapplied: minimal does not necessarily mean short, because the agent still needs sufficient information up front to behave as expected.

So the discipline is subtraction with a floor, not compression for its own sake. In review terms, the question stops being whether anything is missing and becomes whether anything present is unearned. Those are different reviews, and almost no organization runs the second one.

System prompts have a right altitude, and both extremes fail

Anthropic gives the failure modes at each end, and most teams will recognize themselves in one of them.

At one extreme, engineers hardcode complex, brittle logic into prompts to force exact behavior, which the document says creates fragility and increases maintenance complexity over time. At the other, they supply vague, high-level guidance that gives the model no concrete signal, or that falsely assumes shared context. Anthropic calls the target the right altitude, a Goldilocks zone that is specific enough to guide behavior and flexible enough to leave the model strong heuristics.

Its structural advice is lighter than most style guides: organize prompts into distinct sections using XML tags or Markdown headers, while noting that exact formatting is likely becoming less important as models improve. Anthropic’s recommended starting method is to test a minimal prompt with the best available model, then add instructions and examples in response to observed failures.

Examples get a specific warning. Teams stuff a laundry list of edge cases into a prompt to articulate every possible rule, and Anthropic explicitly does not recommend this. Its alternative is a curated set of diverse, canonical examples. Instruction-level mechanics inside a specific agent platform are treated separately in the wording of the instruction itself.

Tool sets fail through bloat rather than through gaps

The most actionable line in the whole document concerns tools, and it doubles as a review test.

Anthropic names bloated tool sets covering too much functionality, or creating ambiguous decision points about which tool to use, as one of the most common failure modes it sees. Its test runs like this: if a human engineer cannot definitively say which tool should be used in a given situation, an AI agent cannot be expected to do better.

That sentence is usable in a design review tomorrow. Read your tool list, ask a senior engineer to pick the right tool for three real requests, and if they hesitate you have found the defect without running anything.

This is also where a delivery platform either helps or hurts. GetGenerative.ai routes seven agents across discovery, metadata, design, build, test, governance and support over one shared org context, with the Metadata Agent described on its own site as the context every other agent runs on. One design choice there is worth noticing, and it is singular rather than plural: one curated context asset, reused, instead of each stage assembling its own from whatever it can reach. That is context engineering expressed as architecture, and it is the difference between a curated set of tokens and a pile of them.

Just-in-time retrieval trades speed for freshness, and the trade is explicit

On how context should arrive, Anthropic describes a shift away from pre-processing everything.

Just-in-time retrieval keeps lightweight identifiers such as file paths, stored queries and web links, then loads data into context at runtime through tools. Claude Code is given as the example, writing targeted queries and using commands like head and tail to analyze large volumes without loading full objects. Anthropic compares it to human cognition, where we use file systems, inboxes and bookmarks rather than memorizing corpuses.

Two consequences are stated plainly rather than glossed. Runtime exploration is slower than retrieving pre-computed data. And opinionated engineering is required to give the model the right tools and heuristics, because without proper guidance an agent can waste context by misusing tools, chasing dead ends or failing to identify key information.

Anthropic also describes a hybrid in practice, where Claude Code drops CLAUDE.md files into context up front while primitives like glob and grep retrieve files just in time. It suggests the hybrid suits less dynamic content such as legal or finance work. For regulated delivery that is the useful signal: where the ground truth changes slowly, pre-loading is defensible, and where it changes under you, retrieval at the moment of use is the only honest option.

Long-horizon work needs compaction, notes or subagents

For tasks whose token count exceeds the window, Anthropic names three techniques. Choosing between them is a design decision with stated trade-offs, which makes this the most directly reusable part of the document.

TechniqueWhat it doesAnthropic’s stated fit
CompactionSummarizes a conversation near the limit and reinitializes with the summaryTasks needing extensive back and forth
Structured note-takingAgent writes notes persisted outside the window, pulled back laterIterative development with clear milestones
Subagent architecturesSpecialized subagents work in clean windows and return summariesComplex research and analysis with parallel exploration

Detail worth keeping from each. In compaction, Claude Code preserves architectural decisions, unresolved bugs and implementation details while discarding redundant tool outputs, then continues with the compressed context plus the five most recently accessed files. Anthropic calls tool result clearing one of the safest and lightest forms of compaction, with a pointed rationale: once a tool has been called deep in the message history, the agent does not need to see the raw result again.

Subagent numbers are the ones to quote when someone asks why a multi-agent design costs less rather than more. Each subagent may explore extensively using tens of thousands of tokens or more, and return a condensed summary often of 1,000 to 2,000 tokens. Where that pattern turns into a recursive structure, and where it should stop, is the subject of when agent loops earn their cost.

Anthropic’s warning on compaction is the one most teams need. Overly aggressive compaction loses subtle but critical context whose importance only becomes apparent later, and the recommended tuning order is to maximize recall first, then improve precision.

Context engineering is a cost decision before it is a quality decision

Commercial consequence rarely appears in engineering write-ups, and it is the part a budget holder will ask about first.

Salesforce reaches the same conclusion from the cost side. Its Resource and Cost Optimization guidance tells architects to minimize prompt length, to summarize conversation history rather than carrying full verbatim transcripts that grow without bound, to use the smallest model sufficient for a task rather than defaulting to the most capable, and to cache reference data. Its example of waste is precise: retrieving 50 vector-search results when only 5 are evaluated spends inference and retrieval resources with no added value, so retrieval limits should match actual usage.

Fifty retrieved against five evaluated is a ratio worth auditing in your own stack, because nobody notices it until the credit burn does.

Every token you supply is billed and every token degrades attention slightly. That means context discipline improves accuracy and reduces spend at the same time, which is unusual enough to be worth stating plainly in a business case. That runs in reverse too, which is how AI pilots quietly become expensive: stuffing the window is the easiest thing for a developer to do, is invisible in code review, and shows up only on an invoice.

There is also a hard platform ceiling worth knowing, because it is lower than the model’s own. Salesforce documents that when Einstein Trust Layer data masking is active, the context window is capped at 115K tokens regardless of the model’s native limit. Security controls consume context budget, which means the window you plan against is not the window the datasheet advertises.

Consumption pricing makes this sharper than it looks. Where platform usage is metered per interaction, the mechanics set out in how agent consumption gets metered and billed apply to every retrieval decision described above, including the ones nobody sees.

What a delivery organization should change first

Four moves, in the order they pay back.

Name an owner for context, because it currently has none. Where this sits in the wider delivery picture is covered in the pillar on AI-led Salesforce implementation. Prompt wording usually has an owner and retrieval design usually does not, which is why it drifts.

Audit the tool list against Anthropic’s test before touching any prompt. Ambiguous tools degrade every downstream decision and are cheaper to fix than instructions.

Decide per data source whether it is pre-loaded or retrieved at runtime, and record the staleness you accept for each. That record is what grounding actually means in practice: not that the model has access to your data, but that someone decided which data, how fresh, and retrieved how. This is the decision GetGenerative.ai makes once at the org-context layer rather than once per project stage. That record belongs with the design decisions that are already written down, which is the job of the document that holds design decisions and their rejected alternatives.

Then measure whether your curation works, because none of the above is self-evidently correct. Scoring output rather than inspecting it is covered in how generated output gets scored rather than read, and the runtime that enforces these decisions is the subject of the layer that constrains what an agent may attempt.

Anthropic’s closing advice is worth adopting as a standard: do the simplest thing that works. It is also the test to put to any vendor, GetGenerative.ai included, when they describe how much context their agents consume. In a field where every vendor sells more, a documented preference for less is a competitive position. If you want to see a shared-context delivery model running rather than described, the agents can be run against a live project.

Questions raised when context becomes a design decision

What is context engineering?

Anthropic defines it as the set of strategies for curating and maintaining the optimal set of tokens during model inference, including information that reaches the model outside the prompts. It covers system instructions, tools, external data, retrieved documents and message history, and Anthropic treats it as the natural progression of prompt engineering rather than a replacement for it.

How is context engineering different from prompt engineering?

Prompt engineering is writing and organizing the instruction. Context engineering is deciding the whole configuration of information the model sees at a given moment, which includes retrieval, tool definitions and history management. Ownership is the practical difference: instruction wording sits with an author, while context configuration is a platform architecture decision with a cost attached.

What is context rot?

The documented effect that as tokens in the context window increase, a model’s ability to accurately recall information from that context decreases. Anthropic reports it across all models, with some degrading more gently, and characterizes it as a performance gradient rather than a hard cliff.

Does a larger context window solve the problem?

No. Anthropic states that context windows of all sizes will remain subject to context pollution and information relevance concerns for the foreseeable future, which is why it recommends treating context as a finite resource with diminishing marginal returns rather than waiting for more room.

How do you know if your agent has too many tools?

Anthropic’s test is whether a human engineer can definitively say which tool should be used in a given situation. If they cannot, the agent cannot be expected to do better. Bloated tool sets covering too much functionality, or producing ambiguous decision points, are named as one of the most common failure modes.

What should we do for tasks longer than the context window?

Anthropic names three techniques with different fits. Compaction summarizes and reinitializes, suiting tasks with extensive back and forth. Structured note-taking persists notes outside the window, suiting iterative work with clear milestones. Subagent architectures give focused tasks clean windows, suiting complex research where parallel exploration pays, with each subagent returning a summary often of 1,000 to 2,000 tokens.

About the Author
Amit Choudhary
Amit is a tech entrepreneur and investor, currently the Co-founder & CEO of GetGenerative.ai, an AI-native Salesforce consulting platform. He previously co-founded saasguru, helping over 100,000 learners build careers in Salesforce, and SaaSfocus, APAC’s largest Salesforce boutique acquired by Cognizant. With a global background in sales leadership and $750M+ in TCV, he brings deep expertise in scaling tech ventures.