AI Insights

Context engineering after Claude 5

What Anthropic's Claude 5 context guidance changes for prompts, tools, memory, progressive disclosure, and the parts still worth measuring yourself.

  • Older prompt guardrails can become recurring cost and model friction
  • Long context still degrades attention, even as models improve
  • Tool definitions are often the biggest always-loaded token line item
  • Progressive disclosure works only when files and tools are truly deferred
  • Must-happen controls belong in hooks, not prose instructions
By Pradeep Chandran18 min read
Context engineering after Claude 5

Research report, v3, issued 3 August 2026. Written for engineering leaders tuning agent harnesses and Claude Code configuration. The attached source report is the basis for this post.

Over 80% of Claude Code's system prompt was removed for Claude Opus 5 and Claude Fable 5. Anthropic says it saw no measurable loss on its coding evaluations. That does not mean context stopped mattering. It means the work moved from adding more rules to deciding what belongs in the window, what should be deferred, and what must be enforced outside the model.

Executive summary

Five findings carry the report.

  • A prompt tuned for older models costs you on newer ones. Anthropic removed over 80% of Claude Code's system prompt for Claude Opus 5 and Claude Fable 5, with no measurable loss on its coding evaluations. The stated cause was overconstraint: conflicting instructions across the system prompt, skills, and user requests that the model had to resolve before starting work.
  • The case for spending context carefully is measured, not rhetorical. Chroma tested 18 models and found accuracy falls as input length grows even with task difficulty held constant. On a conversational benchmark, focused 300 token prompts beat the same questions inside 113,000 token histories across every model family tested.
  • The largest line item is usually tool definitions, and it is fixable. Anthropic reports having seen 134,000 tokens of tool definitions before optimization. Deferring them behind a search tool cut a reference setup from roughly 77,000 to 8,700 tokens, an 85% reduction, while raising MCP evaluation accuracy on the models tested.
  • Progressive disclosure is the mechanism, but the plumbing matters. Skill bodies and reference files cost nothing until read. Claude Code's own documentation is explicit that @path imports do not save context, because imported files load at launch. Path scoped rules and skills do.
  • Instructions are context, not configuration. Claude Code treats CLAUDE.md and auto memory as context the model weighs, not rules it enforces. Anything that must happen every time belongs in a hook, not a sentence.

Why the guidance changed

The July 2026 post The new rules of context engineering for Claude 5 generation models, by Thariq Shihipar of Anthropic, is the primary source for the six shifts examined here. Its central claim is specific and checkable: over 80% of Claude Code's system prompt was removed for Opus 5 and Fable 5 with no measurable loss on Anthropic's coding evaluations.

The reason given is not that context stopped mattering. It is that the old prompt encoded defenses against failure modes the newer models no longer exhibit. Reading internal transcripts, the team found single requests carrying contradictory instructions: "leave documentation as appropriate" from one layer, "DO NOT add comments" from another. Claude could usually infer intent, but had to reason about the conflict first.

The saving is not only tokens. Removing a conflict removes a decision the model would otherwise make on every turn.

The constraint that has not changed

Anthropic's September 2025 engineering post frames context as a finite attention budget: every token added depletes it, and transformer attention stretches thin as sequences lengthen. It cites Chroma's July 2025 Context Rot report, which evaluated 18 models across 8 input lengths and 11 needle positions and found degradation in every one, accelerating as the question and the target grew less lexically similar.

Two of those results cut against intuition. Distractors topically close to the answer hurt more than unrelated filler, and their effect compounds with length. Models also scored better on shuffled haystacks than on coherent ones, which suggests structure in the surrounding text influences attention in ways the field cannot yet explain.

Read together: capability changed enough to retire many guardrails, while the physics of long context did not change at all. The six shifts are about what to delete, not about relaxing discipline.

Where the tokens actually go

Tool definitions are sent on every request. Figures below come from Anthropic's November 2025 advanced tool use beta material and the report's cited secondary analysis.

Setup Approximate always-loaded context
GitHub MCP server, 35 tools 26K tokens
Slack MCP server, 11 tools 21K tokens
Jira MCP server, alone 17K tokens
Five-server setup, 58 tools 55K tokens
Anthropic's own agent, before optimization 134K tokens
Same 50+ tool library behind tool search 8.7K tokens

The 10% figure for when Claude Code switches to deferred loading comes from third party analysis, not from Anthropic. Treat it as indicative.

The six shifts

1. Rules become judgment

Anthropic published both sides of this change, which makes it the most concrete of the six. The old prompt carried an absolute rule about comments and intermediate files. The replacement states a relationship to the surrounding code instead of a prohibition.

Then Now
"In code: default to writing no comments. Never write multi-paragraph docstrings or multi-line comment blocks, one short line max. Don't create planning, decision, or analysis documents unless the user asks for them." "Write code that reads like the surrounding code: match its comment density, naming, and idiom."

The stated rationale is that the absolute rule was wrong for a subset of prompts: some users want documentation, and some complex code needs a block comment. Older models produced bad comments often enough that the team accepted the tradeoff. Newer ones, per Anthropic, make the call without the rule.

Do not delete a rule that guards an irreversible action. Judgment replaces style rules, not safety rails.

2. Examples become interfaces

The 2026 post states that examples constrain the newest models to a particular exploration space, and recommends investing in the design of tools, scripts, and files instead: what parameters exist, and how expressive they are. Its worked example is the Todo tool, where a status enumeration of pending, in_progress, and completed communicates the intended usage, and one sentence about keeping a single item in progress defines the behavior.

This is the one shift with real tension in the record. Anthropic's September 2025 post says few-shot prompting is a practice it continues to strongly advise, while warning against stuffing a laundry list of edge cases into a prompt. Its November 2025 announcement reports internal accuracy on complex parameter handling improving from 72% to 90% when sample calls are added to tool definitions.

The reconciliation the sources support is a distinction between kinds of examples. Examples that demonstrate a format convention the schema cannot express, an ID shape, a date format, or which optional fields travel together still pay. Examples that enumerate how to approach a task narrow the model's search. The first is interface documentation. The second is a rule wearing a costume.

Test: if removing the example would make a valid call ambiguous, keep it. If it would only remove one way of doing the job, delete it.

3. Everything upfront becomes progressive disclosure

Claude Code's prompt carried detailed code review and verification procedure that was critical when needed and dead weight otherwise. Anthropic moved both into skills the agent calls selectively, and applied the same idea to tools: some are deferred, and the agent must search for their definitions before use, which lets the product ship more tools without paying for them every turn.

Anthropic's skill authoring guidance is precise about the mechanism: only the name and description of a skill sit in context, the body loads when the task calls for it, and reference files beside it consume zero tokens until read. It advises keeping a SKILL.md body under 500 lines and splitting longer material into referenced files.

Claude Code's memory documentation is explicit that splitting a CLAUDE.md into @path imports helps organization but does not reduce context, because imported files load at launch. Path scoped rules and skills are the mechanisms that defer.

That distinction is where most self-described progressive disclosure setups fail. Moving 400 lines into six files and importing all six changes nothing about the token bill. It only makes the bill harder to see.

Deferral has its own failure mode: a skill that does not trigger contributes nothing. Practitioner write-ups report skills not firing when expected, and one widely cited evaluation attributed to Vercel found a compressed documentation index embedded in an always-loaded instructions file outperforming skills, 100% against 79%. We could not reach the primary evaluation, so treat those numbers as unverified. The directional lesson is safe: measure whether your skills fire before assuming the deferral saved you anything.

4. Repetition becomes simple tool descriptions

Earlier models sometimes needed instructions repeated, and weighted material near the end of the window more heavily than material at the start. Teams compensated by stating tool guidance twice, once in the system prompt and once in the tool description. Anthropic reports deleting the duplicates and keeping usage guidance in the tool description alone.

Measure All definitions loaded Behind tool search
Tool definitions About 72,000 tokens About 500 tokens
Context before work About 77,000 tokens About 8,700 tokens
Accuracy, Opus 4 49% 74%
Accuracy, Opus 4.5 79.5% 88.1%

Figures assume a library of 50 or more MCP tools. Accuracy figures are Anthropic internal MCP evaluations, published November 2025. Model names are those tested at the time.

The documentation is unusually direct about the boundary. Defer when definitions exceed 10,000 tokens, when you aggregate multiple MCP servers, or when selection accuracy slips as the library grows. Do not defer with fewer than ten tools, when every tool is used in every request, or when the whole set is under 100 tokens: the search step then costs latency and buys nothing.

Deferred tools are excluded from the initial prompt entirely, so tool search does not invalidate prompt caching.

5. Manual memory becomes auto memory

Users were previously encouraged to write to CLAUDE.md with a hash hotkey. Claude Code now saves memories itself, from corrections and stated preferences. The documentation describes two complementary systems: CLAUDE.md files you author, and auto memory Claude writes. Both load at the start of every conversation, and both are plain markdown you can read, edit, or delete through the memory command.

Both systems are context, not enforced configuration. To block an action regardless of what the model decides, the documentation points to a PreToolUse hook.

Automatic memory relocates the maintenance job rather than removing it. Files over 200 lines consume more context and, per the same documentation, may reduce adherence. Auto memory accumulates, so the work becomes periodic review rather than authoring.

For teams building their own agents rather than using Claude Code, three primitives cover the same ground: a memory tool that stores files outside the window, context editing that clears stale tool results on the client, and server side compaction that summarizes the conversation as it approaches the limit. The documented recommendation for long-running agents is to combine compaction with memory, so summarization keeps the window small while memory holds what must survive it.

Secondary reporting of Anthropic's evaluations cites an 84% reduction in token consumption over a 100 turn web search task with context editing enabled, and a 39% performance gain from memory plus context editing against baseline. We could not reach the original write-up, so these are second hand.

6. Simple specs become rich references

Plan mode leaned on markdown plans, and the surrounding practice was to keep specs in the repository for long projects. The 2026 guidance is that the newest models handle more complicated references, and names four kinds worth preferring over prose.

Reference Why it helps
HTML artifacts A mockup in code carries layout, color, and hierarchy that a description cannot. The post states an HTML mockup generally beats both a written description and a screenshot.
Test suites A detailed test suite is a spec with an oracle attached: it states the requirement and verifies it in the same artifact.
Real code A function in another codebase to port is higher fidelity than any paraphrase of it, in a language the model knows well.
Rubrics A rubric encodes taste, what a good API looks like here, and can be handed to a verifier agent that checks work against it.

Prefer references that already exist in your repository over documents written for the agent. Anything authored separately can drift from the code.

The shifts, side by side

Then Now What actually changes in your repo
Give rules Let Claude use judgment Absolute style rules go. Safety rails stay.
Give examples Design interfaces Effort moves to parameter names, enums, and return shapes.
Put it all upfront Progressive disclosure A tree of files and deferred tools, loaded on demand.
Repeat yourself Simple tool descriptions One statement of a rule, placed where the model needs it.
Memory in CLAUDE.md Auto memory You curate notes rather than author them.
Simple specs Rich references HTML artifacts, test suites, real code, and rubrics.

The post's closing section assigns responsibilities. The system prompt describes the product and the job, and is where to invest if you build your own harness. CLAUDE.md briefly says what the repository is for and then spends its tokens on gotchas, the things a model cannot infer from the file tree. Skills encode opinions specific to you or your team, and stay lightweight. References carry the depth.

The single most repeated instruction across the sources: do not restate what Claude can determine by reading your repository.

Token economics

Trimming context changes the bill in two places: the recurring input cost of everything you send every turn, and the latency of processing it. Neither model prices nor context limits changed with the new guidance, which is what makes the saving attributable to the context work.

Model Input and output per million tokens Context Released
Opus 5 $5 and $25 1M in, 128K out 24 Jul 2026
Fable 5 $10 and $50 1M in, 128K out 9 Jun 2026
Sonnet 5 $2 and $10, promotional 1M in, 128K out 30 Jun 2026
Cache read One tenth of the input rate Reused prefixes Ongoing

Prices come from Anthropic's published rates as reported in July and August 2026. Confirm against the pricing page before budgeting: the Sonnet 5 rate is promotional with a stated end date.

Three effects dominate the arithmetic.

  • Everything in your always-loaded context is billed on every turn, so a 20,000 token instruction surface is a recurring charge, not a setup cost.
  • Prompt caching returns roughly 90% on reused prefixes, which is why deferred tools matter twice: they shrink the prompt and leave the cacheable part intact.
  • The tokenizer introduced with Opus 4.7 can produce noticeably more tokens for the same text than earlier models, reported at roughly 30% and up to 35% depending on content. Comparisons against older bills are not like for like.

A 1M token window billed at a flat rate is not permission to fill it. The context rot evidence says the accuracy cost of filling it arrives well before the budget cost does.

How the record accumulated

Date Event Why it matters
14 Jul 2025 Chroma publishes Context Rot 18 models, 8 input lengths, 11 needle positions. Establishes non-uniform degradation with length.
29 Sep 2025 Effective context engineering for AI agents Published with Sonnet 4.5. Covers attention budget, just-in-time retrieval, compaction, note taking, subagents, and the memory tool beta.
24 Nov 2025 Advanced tool use beta Tool search, programmatic tool calling, and tool use examples. Source of the tool definition token figures.
9 Jun 2026 Claude Fable 5 1M token context, 128K output, $10 and $50 per million tokens.
30 Jun 2026 Claude Sonnet 5 Positioned as the default price and performance option below Opus 5 and Fable 5.
24 Jul 2026 Claude Opus 5 and the new rules Opus 5 at $5 and $25 per million tokens. The context engineering post publishes the same day, and claude doctor ships to audit skills and CLAUDE.md files.

What to do, in order

A restructuring sequence for one repository. Each step is measurable before you move to the next.

  1. Measure before you edit. Record what a fresh session costs before any user message: system prompt, CLAUDE.md, auto memory, skill descriptions, and tool definitions, separately. Claude Code exposes this with the context and usage commands, which attribute consumption to skills, subagents, plugins, and individual MCP servers. Without this baseline every later change is a guess.
  2. Cut the tool bill first. It is usually the largest line and the least contentious to change. Disconnect MCP servers nobody uses. Keep three to five tools always loaded and defer the rest. Namespace tool names by service so one search matches a whole group.
  3. Run the audit, then read it critically. The doctor command proposes trims for a checked-in CLAUDE.md: it removes content derivable from the codebase, directory layouts, dependency lists, and architecture overviews, and keeps pitfalls, rationale, and conventions that differ from tool defaults. It requires Claude Code v2.1.206 or later.
  4. Resolve contradictions, then delete style rules. Search your instruction surfaces for the same topic stated twice and reconcile it to one statement. Then remove absolute style rules and replace them with a relationship to the existing code. Keep every rule that guards an irreversible action.
  5. Move procedures into skills, and verify they fire. Anything you would resent paying for on a turn where it is irrelevant belongs in a skill. Keep the body under 500 lines and split the rest into referenced files. Then check it triggers on the phrasing your team actually uses, because a skill that never fires is a saving that never arrives.
  6. Make the must-happen things deterministic. Move any instruction whose violation is unacceptable out of prose and into a hook. This is what makes it safe to delete rules elsewhere: the guarantee moves to a layer that does not depend on the model weighing your sentence.
  7. Re-measure, and keep a rollback. Compare the new baseline against the old one, and hold your own evaluation set. Anthropic's claim is no measurable loss on its coding evaluations, on its codebase. Your gotchas are not theirs, and the only way to know a deletion was safe is to have measured the thing you care about.

How much to trust each claim

Every figure in this report is graded by how close we could get to the source that produced it.

Published by the vendor, first hand

  • Anthropic removed over 80% of Claude Code's system prompt for Opus 5 and Fable 5, and reports no measurable loss on its coding evaluations.
  • The before and after system prompt text for the comment rule is published verbatim.
  • Chroma's degradation results across 18 models, with task difficulty held constant and code released for replication.
  • Documented thresholds for when tool deferral helps and when it does not.
  • Claude Code's treatment of CLAUDE.md and auto memory as context rather than enforced configuration.

Vendor internal evaluations, method not published

  • The 85% token reduction and 95% context preservation figures for tool search.
  • MCP accuracy improvements of 49% to 74% and 79.5% to 88.1%.
  • Tool use examples improving complex parameter handling from 72% to 90%.
  • Programmatic tool calling reducing average usage from 43,588 to 27,297 tokens.

These are real measurements, but on Anthropic's own tasks and harnesses. The direction is credible. The magnitude will not transfer unchanged to your workload.

Second hand or unverified

  • The 10% of context window threshold at which Claude Code switches to deferred loading: third party analysis only.
  • The 84% token reduction and 39% performance gain attributed to context editing: reported second hand, original evaluation not reached.
  • The evaluation attributed to Vercel favoring an always-loaded documentation index over skills: not verified at source.
  • Guidance circulating as fixed limits, a 60 line CLAUDE.md, and a ceiling of about 150 instructions traces to practitioner write-ups rather than published measurement.

One gap is worth stating plainly: no source we found measures the effect of these six changes on a codebase other than Anthropic's. The mechanism claims are well evidenced. The transfer of the results is not.

Sources

Primary sources from Anthropic:

Independent research:

Secondary sources, used only where flagged:

  • Finisky Garden, Deferred Tool Loading in Claude Code, April 2026. Source of the 10% of context window deferral threshold.
  • Matsuoka, How Claude Code Got Better by Protecting More Context, December 2025. Source of the 84% and 39% context editing figures, quoted second hand.
  • A. Opdenacker, Stop Bloating Your CLAUDE.md, January 2026. Route to the practitioner counter-evidence on skill activation.
  • Model pricing and release dates were cross-checked across Anthropic's pricing documentation and three independent trackers in July and August 2026. Where trackers disagreed on promotional rates, the vendor figure is used.

Build grounded agents

Build agents that reason inside your business logic

See how lowtouch.ai turns enterprise rules, policies, and semantic context into governed agents running inside your appliance.

About the Author

Pradeep Chandran

Pradeep Chandran

Lead - Agentic AI & DevOps

Pradeep Chandran is a seasoned technology leader and a key contributor at lowtouch.ai, a platform dedicated to empowering enterprises with no-code AI solutions. With a strong background in software engineering, cloud architecture, and AI-driven automation, he is committed to helping businesses streamline operations and achieve scalability through innovative technology. At lowtouch.ai, Pradeep focuses on designing and implementing intelligent agents that automate workflows, enhance operational efficiency, and ensure data privacy. His expertise lies in bridging the gap between complex IT systems and user-friendly solutions, enabling organizations to adopt AI seamlessly. Passionate about driving digital transformation, Pradeep is dedicated to creating tools that are intuitive, secure, and tailored to meet the unique needs of enterprises.

LinkedIn →