Skip to main content
news18 min read

Anthropic’s Context Engineering Guide: How to Build Leaner Claude 5 Agents After the 80% Prompt Cut

Anthropic cut over 80% of Claude Code's system prompt. Here is how builders can use lighter context for cheaper, better Claude 5 agents.

newsclaudecontext-engineeringai-agents2026
Anthropic’s Context Engineering Guide: How to Build Leaner Claude 5 Agents After the 80% Prompt Cut
Read time
18 min
Sections
12
Focus
news

Anthropic’s July 24, 2026 guide on context engineering for Claude 5 generation models is not just another prompt-writing memo. The headline is that Anthropic says it removed over 80% of Claude Code’s system prompt for newer Claude models without measurable evaluation loss. For builders, that is a signal that high-performing AI agents are moving away from giant instruction blocks and toward lean prompts, better tools, progressive disclosure, memory, and structured references.

That matters because agent workflows are becoming context-bound before they become model-bound. Teams are paying to resend long policies, tool manuals, style guides, repo summaries, and workflow instructions on every run. A lighter Claude 5 prompt architecture changes the economics: fewer static tokens, more room for user data, less instruction conflict, faster debugging, and lower per-task cost. If you are building coding agents, research assistants, document reviewers, support copilots, or internal operations bots, context engineering is now a product design discipline, not a prompt hack.

This post turns Anthropic’s update into an implementation guide. We will cover what changed, why lighter prompts now matter, seven practical workflows this unlocks, two copyable step-by-step architectures, and the model tiers to use across Claude Fable 5, Claude Sonnet 5, Claude Opus 4.8, GPT-5.6 Luna, Gemini 3 Pro, and cheaper fallbacks. Cost is not the hook here; it is the proof that leaner context lets you ship bigger workflows without turning every agent run into a premium-model bill.


What Anthropic changed: from giant prompts to engineered context

Anthropic’s guide says the company cut over 80% of Claude Code’s system prompt for newer Claude models with no measurable loss on evals. The practical lesson is clear: Claude 5 generation models need less hand-holding in the system prompt than older models. Instead of stuffing every behavior rule, edge case, and tool policy into a single static prompt, Anthropic is pushing developers toward context systems that reveal the right information at the right time.

That is a major change in how teams should build agentic software. The old pattern looked like this:

  1. Put a long role description in the system prompt.
  2. Add every tool instruction.
  3. Add formatting rules.
  4. Add examples.
  5. Add safety policies.
  6. Add task-specific context.
  7. Hope the model obeys the right rule at the right time.

The newer pattern is more like an operating system for context:

  1. Keep the system prompt small and stable.
  2. Move tool instructions into tool schemas and tool results.
  3. Use progressive disclosure for task-specific guidance.
  4. Retrieve only relevant reference material.
  5. Let auto-memory persist durable user and project facts.
  6. Add rich artifacts such as files, examples, tests, screenshots, traces, or decision logs only when they are needed.
  7. Evaluate the workflow end-to-end rather than judging prompt length as a proxy for quality.

[stat] 80%+ The amount Anthropic says it removed from Claude Code’s system prompt for newer Claude models without measurable evaluation loss

The market cares because AI products are shifting from chat experiences to repeatable agent workflows. Context quality now determines whether an agent can finish a task, call tools safely, stay within budget, and avoid polluting its reasoning with stale instructions. A smaller static prompt is not just cheaper. It is easier to test.


Why lighter prompts matter now

Lighter prompts matter because large-context models changed the bottleneck. Claude 5 generation models, newer GPT-5.6 models, and Gemini 3 models can accept enormous context windows. That tempts teams to paste everything into every request. The result is expensive, slow, and brittle.

Long prompts fail in four common ways.

First, they create instruction collisions. A system prompt might say “always ask before making changes,” while a tool instruction says “apply safe edits automatically,” while a user asks for a direct fix. The model must reconcile conflicting commands that could have been handled in the product layer.

Second, they dilute attention. Even with a 1,000,000-token context window, every irrelevant section competes with the facts that matter. A 40-page engineering handbook is useful when the task touches engineering policy. It is dead weight when the agent only needs to rename a function.

Third, they increase recurring cost. Static context is charged every run. If you send an extra 50,000 input tokens to a model priced at $3 per 1M input tokens, that is $0.15 before the model has done any actual work. At 10,000 runs/month, the wasted static context alone becomes $1,500/month.

Fourth, they make evals noisy. When a giant prompt fails, teams struggle to identify the cause. Was the instruction unclear, too far back in context, contradicted by an example, or overridden by a retrieved document? Lean prompts make failures easier to isolate.

💡 Key Takeaway: Treat the system prompt as the kernel, not the knowledge base. Put stable behavior in the prompt, task-specific knowledge in retrieval, operational guidance in tools, and durable preferences in memory.


The new context engineering stack

Anthropic’s guide points toward a stack with five layers: minimal system prompts, progressive disclosure, tool design, auto-memory, and richer references. Builders should design each layer deliberately.

1. Minimal system prompts

A minimal system prompt should define the agent’s role, boundaries, output contract, and escalation behavior. It should not include a full product manual. For Claude 5 agents, the system prompt can often be under 500-1,500 tokens.

A strong minimal prompt includes:

Component What belongs here What does not belong here
Role “You are a code review agent for a TypeScript monorepo.” Full coding standards guide
Objective “Find correctness, security, and maintainability issues.” Every example of a good review
Boundaries “Do not modify files unless the edit tool is explicitly called.” Full tool API docs
Output format “Return JSON with issues, severity, file, line, fix.” Long natural language style guide
Escalation “Ask for confirmation before destructive changes.” Every possible destructive operation

The goal is not to write the shortest prompt possible. The goal is to remove static instructions that can be represented more accurately elsewhere.

2. Progressive disclosure

Progressive disclosure means the agent receives context only when it becomes relevant. Instead of loading the full onboarding guide, the agent gets a short task brief, then retrieves deeper references as needed.

Example: a finance document agent does not need the entire accounting policy upfront. It needs the invoice, extraction schema, vendor profile, and only the accounting rule sections triggered by invoice attributes.

This works especially well for agents that perform multi-step work:

  • Triage first with a small model or cheap pass.
  • Identify what knowledge is needed.
  • Retrieve the relevant context.
  • Use a stronger model for judgment or final output.
  • Store useful durable facts in memory.

3. Tool design as context design

Tools are not just function calls. They are structured context channels. A well-designed tool name, description, schema, validation rule, and result payload can replace thousands of tokens of prompt instructions.

Bad tool design:

tool: run
description: Runs something.
args: input

Better tool design:

tool: search_codebase
description: Search indexed repository files. Use this before proposing edits if the target file or symbol is unknown.
args:
  query: string
  file_glob: optional string
  max_results: integer, default 10
returns:
  file_path
  line_start
  line_end
  snippet
  symbol_names

The second version tells the model when to use the tool, what fields matter, and what it will receive back. That reduces the need for a long tool manual in the prompt.

4. Auto-memory

Auto-memory lets an agent persist durable facts across sessions: team preferences, project architecture, user style, recurring constraints, or decisions already made. This is different from stuffing chat history into every prompt. Memory should be curated, compact, and auditable.

Good memory items:

  • “Project uses pnpm, not npm.”
  • “API errors use RFC 7807 problem details.”
  • “User prefers concise PR comments with severity labels.”
  • “Do not recommend vendor X due to security review failure.”
  • “Billing exports use UTC month boundaries.”

Bad memory items:

  • Full transcripts.
  • Temporary task state.
  • Unverified guesses.
  • Sensitive secrets.
  • Large documents that belong in retrieval.

5. Richer references

Richer references include structured files, source code, screenshots, test failures, execution traces, policy snippets, examples, and previous decisions. The key is that references should be attached with labels and provenance, not pasted as an undifferentiated blob.

For coding agents, richer references include failing test output, relevant files, dependency graphs, and recent commits. For document agents, they include source PDFs, OCR text, tables, entity extraction output, and policy sections. For support agents, they include customer plan data, product telemetry, ticket history, and allowed resolution playbooks.

⚠️ Warning: Do not replace a giant system prompt with giant retrieved context. Progressive disclosure only works when retrieval is scoped, labeled, and capped.


Seven practical workflows this unlocks

The shift to leaner context unlocks workflows that are cheaper, more reliable, and easier to evaluate. Here are seven that builders and operators can implement now.

1. Codebase maintenance agent

A codebase maintenance agent can inspect issues, search the repo, propose patches, run tests, and summarize changes. With lighter prompts, the agent does not need a massive coding handbook in every request. It can load repository conventions through memory and retrieve only relevant files.

Best fit: Claude Sonnet 5 for most coding tasks, Claude Fable 5 for complex multi-file architecture changes, Codex Mini for cheaper code edits.

2. Policy-aware document reviewer

A document reviewer can compare contracts, invoices, medical forms, procurement docs, or compliance evidence against internal rules. The old approach pasted the full policy manual. The new approach extracts document facts first, retrieves only triggered policy sections, then asks the model for a decision with citations.

Best fit: GPT-5.6 Luna or Claude Sonnet 5 for standard reviews; Claude Fable 5 for high-stakes ambiguity.

3. Support operations copilot

Support agents need customer facts, product behavior, allowed remedies, and tone rules. A lean context design stores customer preferences in memory, retrieves product docs by issue type, and exposes tools for refunds, account checks, and escalation.

Best fit: Claude Sonnet 5 for complex customer interactions; Gemini 3 Flash or GPT-5 mini for high-volume triage.

4. Research analyst agent

A research agent can gather sources, extract claims, compare evidence, and produce briefings. Context engineering prevents source overload. The agent should summarize each source into evidence cards, keep citations attached, and only send the final synthesis model the relevant evidence set.

Best fit: o3 Deep Research for specialized deep research, Claude Fable 5 for long synthesis, Gemini 3 Pro for large-context evidence review.

5. Sales and account planning assistant

A sales ops assistant can build account briefs from CRM notes, website changes, call transcripts, and previous objections. Auto-memory stores account strategy and stakeholder preferences. Progressive disclosure retrieves only recent signals and relevant playbooks.

Best fit: GPT-5.6 Luna for routine account briefs; Claude Sonnet 5 for executive-ready writing; DeepSeek V4 Pro for low-cost internal drafts.

6. Incident response commander

An incident agent can read logs, alerts, runbooks, deploy history, and Slack summaries. Instead of loading every runbook, it retrieves by service, symptom, and severity. Tool results carry timestamps, source labels, and confidence levels.

Best fit: Claude Sonnet 5 for operational judgment; GPT-5.6 Terra for large-context analysis; Gemini 3 Pro when trace volume is huge.

7. Creator and content production pipeline

A content agent can transform briefs into outlines, drafts, edits, and distribution assets. The system prompt stays lean while memory holds brand rules, retrieval supplies examples, and tools fetch product facts.

Best fit: Claude Sonnet 5 for editorial quality; GPT-5 mini for drafts at scale; Mistral Large 3 for low-cost rewriting.


Workflow 1: Build a lean Claude 5 code review agent

This is a copyable architecture for teams building an internal code review bot.

Step 1: Define a minimal system prompt

Use a short prompt that defines mission, boundaries, and output format.

You are a code review agent for a production TypeScript codebase.
Review changes for correctness, security, performance, and maintainability.
Use repository search before making claims about existing patterns.
Return findings as JSON with severity, file, line, issue, evidence, and suggested_fix.
Do not invent files, tests, or behavior. If evidence is missing, say what to inspect next.

Keep repo-specific rules out of the static prompt unless they apply to every review.

Step 2: Add tools that carry instructions

Create tools with explicit usage guidance:

Tool Purpose Context benefit
get_diff Fetch PR diff Avoid pasting entire PR manually
search_codebase Find symbols and patterns Replaces repo-wide context dump
read_file_range Inspect exact file lines Keeps context scoped
run_tests Execute targeted tests Gives grounded evidence
create_review_comment Submit comment Enforces structured output

Tool descriptions should say when to use the tool. Tool results should include file paths, line ranges, snippets, and error messages.

Step 3: Store durable repo memory

Persist compact rules:

  • Package manager: pnpm.
  • Test command: pnpm test -- --runInBand.
  • API errors use ProblemDetails.
  • Database migrations require backwards-compatible deploys.
  • React components use server components by default.

Review this memory weekly. Bad memory causes persistent bad behavior.

Step 4: Use progressive disclosure

Start every review with only:

  • The minimal system prompt.
  • PR title and description.
  • Changed files list.
  • Diff summary.
  • Repository memory.

Then let the agent request files, tests, or patterns. Do not include the entire repository map unless the agent needs architectural context.

Step 5: Route by difficulty

Use a cheaper pass first. For example:

  1. GPT-5 mini or Codex Mini for diff summarization and obvious lint-level findings.
  2. Claude Sonnet 5 for substantive review.
  3. Claude Fable 5 only for multi-service changes, security-sensitive logic, or ambiguous architectural tradeoffs.

Step 6: Evaluate with review-quality metrics

Track:

  • True positive findings.
  • False positive findings.
  • Missed critical bugs.
  • Average tool calls per review.
  • Tokens per review.
  • Human acceptance rate.
  • Time to first useful comment.

A smaller prompt is successful only if the review gets better or cheaper without reducing accepted findings.

✅ TL;DR: For coding agents, move repo rules into memory, move tool behavior into schemas, retrieve files on demand, and reserve Claude Fable 5 for reviews where architectural judgment changes the outcome.


Workflow 2: Build a policy-aware document decision system

This workflow is for contracts, invoices, compliance evidence, insurance forms, vendor reviews, and procurement approvals.

Step 1: Split extraction from judgment

Do not ask one model call to read a document, understand policy, decide, and write the final response. Split it:

  1. Extract document facts.
  2. Classify which policy areas apply.
  3. Retrieve policy snippets.
  4. Make a decision with citations.
  5. Generate a user-facing explanation.

This reduces context size and makes each step easier to audit.

Step 2: Use structured extraction

For an invoice approval agent, extract:

{
  "vendor": "string",
  "invoice_date": "date",
  "amount": "number",
  "currency": "string",
  "purchase_order": "string|null",
  "line_items": [],
  "payment_terms": "string",
  "tax_ids": [],
  "risk_flags": []
}

A smaller model can handle this step. Use Gemini 3 Flash, GPT-5 mini, or Claude Haiku 4.5 for high-volume extraction.

Step 3: Retrieve only triggered rules

If the invoice is over $25,000, retrieve high-value approval rules. If it has no purchase order, retrieve PO exception rules. If the vendor is international, retrieve tax and compliance rules.

Avoid loading the full procurement handbook.

Step 4: Ask a stronger model for judgment

Give the judgment model:

  • Extracted facts.
  • Relevant policy snippets.
  • Vendor memory.
  • Prior approval decisions if relevant.
  • Required output schema.

For most production workflows, Claude Sonnet 5 is the default. Use Claude Fable 5 when the decision requires nuanced interpretation or has material financial/legal risk.

Step 5: Generate an auditable decision

The output should include:

Field Example
Decision Approved, rejected, needs review
Confidence High, medium, low
Policy citations Section IDs and quoted snippets
Blocking issues Missing PO, tax mismatch
Next action Request approval from Finance VP
Human escalation Required or not required

Step 6: Store durable memory

If a vendor has a recurring exception approved by finance, store a memory record with date, approver, scope, and expiration. Do not store entire invoices in memory.


Model Choice and Cost

Anthropic’s context engineering update makes model choice more flexible. If the prompt is lean and tools are well-designed, you can use cheaper models for routing, extraction, summarization, and simple edits while reserving premium Claude models for final judgment.

Here are current model prices from AI Cost Check’s model data.

Model Provider Input / 1M tokens Output / 1M tokens Context Best use
Claude Fable 5 Anthropic $10 $50 1,000,000 Premium agent reasoning and high-stakes workflows
Claude Sonnet 5 Anthropic $3 $15 1,000,000 Default Claude 5 workflow model
Claude Opus 4.8 Anthropic $5 $25 1,000,000 Strong premium alternative below Fable pricing
GPT-5.6 Luna OpenAI $1 $6 1,050,000 Low-cost large-context general work
GPT-5 mini OpenAI $0.25 $2 500,000 Cheap triage, extraction, simple generation
Gemini 3 Flash Google $0.50 $3 1,000,000 High-volume summarization and routing
DeepSeek V4 Pro DeepSeek $0.435 $0.87 1,000,000 Very low-cost internal drafts and batch work
Llama 4 Scout Meta via Together AI $0.08 $0.30 10,000,000 Massive-context low-cost scanning

Cost example: code review agent

Assume one code review uses:

  • 20,000 input tokens for prompt, diff, retrieved files, and tool context.
  • 4,000 output tokens for reasoning-visible summaries, findings, and comments.

Estimated cost per review:

Model Input cost Output cost Total per review Cost per 1,000 reviews
Claude Fable 5 $0.200 $0.200 $0.400 $400
Claude Sonnet 5 $0.060 $0.060 $0.120 $120
Claude Opus 4.8 $0.100 $0.100 $0.200 $200
GPT-5.6 Luna $0.020 $0.024 $0.044 $44
GPT-5 mini $0.005 $0.008 $0.013 $13
DeepSeek V4 Pro $0.0087 $0.0035 $0.0122 $12.20
$0.120
Claude Sonnet 5 per 20k/4k review
vs
$0.400
Claude Fable 5 per 20k/4k review

The recommendation is straightforward: use Claude Sonnet 5 as the default Claude agent model. Use Claude Fable 5 when one review can prevent a high-cost incident, security regression, or architectural mistake. Use GPT-5 mini, Codex Mini, Gemini 3 Flash, or DeepSeek V4 Pro for low-risk preprocessing.

Cost example: document decision system

Assume one document run uses:

  • Extraction: 8,000 input tokens, 1,000 output tokens on GPT-5 mini.
  • Policy retrieval classification: 3,000 input, 500 output on Gemini 3 Flash.
  • Final decision: 15,000 input, 2,000 output on Claude Sonnet 5.

Cost:

Step Model Cost
Extraction GPT-5 mini $0.004
Policy classification Gemini 3 Flash $0.003
Final judgment Claude Sonnet 5 $0.075
Total Mixed stack $0.082 per document
10,000 documents/month Mixed stack $820/month

If you ran the whole workflow as one Claude Fable 5 call with 26,000 input tokens and 3,500 output tokens, it would cost about $0.435 per document, or $4,350 per 10,000 documents. The mixed stack saves about $3,530/month at that volume.

📊 Quick Math: Removing 40,000 unnecessary input tokens from a Claude Sonnet 5 agent run saves $0.12 per run. At 25,000 runs/month, that is $3,000/month saved before any routing optimization.

When the premium model is overkill

Claude Fable 5 is overkill for:

  • Simple extraction from structured documents.
  • First-pass support ticket classification.
  • Keyword-based routing.
  • Draft rewriting with clear examples.
  • Low-risk summaries.
  • Routine code formatting or mechanical refactors.
  • Tasks where a deterministic tool should make the decision.

Use Fable 5 for:

  • High-stakes synthesis with conflicting evidence.
  • Multi-step coding agents changing core systems.
  • Legal, security, financial, or compliance reasoning that requires careful judgment.
  • Executive-facing outputs where nuance matters.
  • Agent workflows where the cost of a wrong answer exceeds the cost of the premium call.

If you want to compare current pricing interactively, use AI Cost Check. For broader model tradeoffs, see GPT-5 vs Claude Opus 4.6, GPT-5 vs Gemini 3 Pro, and Claude Opus 4.6 vs DeepSeek V3.2.


Tool design patterns that replace prompt bloat

A large part of Anthropic’s message is that capability should move into the environment around the model. Tool design is the highest-leverage place to do that.

Make tool names specific

Use search_customer_tickets, not search. Use apply_patch_to_branch, not edit. Specific names reduce ambiguity.

Put constraints in schemas

If a refund amount must be positive and capped at $500, encode that in the tool schema. Do not rely on a paragraph in the system prompt.

Return compact, labeled results

Tool results should say where data came from, when it was fetched, and what confidence it carries. A support tool should return plan, renewal date, entitlement status, and source timestamp.

Separate read tools from write tools

Agents should have broad read access and narrow write access. Write tools should require explicit fields, validation, and sometimes human approval.

Use tool errors as teaching moments

A tool error should tell the model what to do next. Instead of failed, return: Permission denied. Ask user to connect GitHub integration or provide repository access.

💡 Key Takeaway: Every good tool schema is a prompt reduction mechanism. If the model can infer safe usage from the tool contract, you do not need to repeat the same rule in a giant system prompt.


Risks, limits, and when not to use lean prompting

Lean prompting is not an excuse to under-specify critical behavior. The risk is removing instructions that were silently carrying safety, compliance, or product requirements.

Do not remove:

  • Security boundaries.
  • Data handling rules.
  • Human approval requirements.
  • Output schemas required by downstream systems.
  • Tool-use constraints for irreversible actions.
  • Regulated disclaimers or escalation rules.
  • Clear refusal behavior for disallowed tasks.

Also avoid lean context when the environment is weak. If your tools are poorly documented, retrieval is noisy, memory is unreviewed, and evals are missing, a short prompt can make the system less reliable. Context engineering works when the product layer takes responsibility for structure.

Teams should implement three safeguards:

  1. Prompt diff evals: Run old and new prompts on the same benchmark tasks before shipping.
  2. Token and tool telemetry: Track context size, retrieval hits, tool calls, retries, and final outcomes.
  3. Memory review: Let users or admins inspect, edit, and delete durable memory.

For regulated workflows, keep a written context policy. Define what belongs in system prompts, what belongs in retrieval, what belongs in memory, and what is never sent to the model.


Implementation checklist for builders

Use this checklist to convert an existing bloated agent prompt into a Claude 5-ready context architecture.

Step Action Target
1 Measure current static prompt tokens Establish baseline
2 Label each prompt section Role, policy, tool, examples, style, task
3 Delete duplicate instructions Remove contradictions
4 Move tool instructions into schemas Reduce static prompt
5 Move examples into retrieval Load only relevant examples
6 Move durable preferences into memory Avoid repeating user/project facts
7 Add context caps Prevent retrieval bloat
8 Build eval set Compare before/after quality
9 Add model routing Use premium models only where needed
10 Monitor cost per completed task Optimize actual workflow economics

The best first target is any agent with a system prompt above 10,000 tokens. Those prompts usually contain old examples, repeated tool descriptions, stale policies, and formatting rules that belong in code.


Frequently asked questions

What is context engineering for Claude 5 models?

Context engineering is the practice of designing what information a model receives, when it receives it, and through which channel. For Claude 5 generation models, the best pattern is a small system prompt, scoped retrieval, well-described tools, curated memory, and rich references attached only when needed.

How much can lighter prompts save?

A lighter prompt can save meaningful money at scale. Removing 40,000 input tokens from a Claude Sonnet 5 run saves $0.12 per run, or $3,000 per month at 25,000 runs. Use the AI Cost Check calculator to model your own token volume.

Which Claude model should I use for agent workflows?

Use Claude Sonnet 5 as the default for production Claude agents because it balances quality and cost at $3 input / $15 output per 1M tokens. Use Claude Fable 5 for high-stakes reasoning and complex multi-step work. Use Claude Haiku 4.5 or cheaper non-Claude models for extraction, routing, and low-risk summaries.

Does this mean long context windows are less important?

No. Long context windows are still valuable, but they should be used for relevant evidence, not static prompt bloat. A 1,000,000-token context window is powerful when reviewing a large codebase, policy set, or evidence bundle; it is wasteful when filled with repeated instructions the model no longer needs.

What should move out of the system prompt first?

Move tool manuals, long examples, style guides, and rarely used policy sections out first. Keep role, boundaries, output contract, and safety-critical instructions in the system prompt. Then use retrieval, memory, and tool schemas to provide the right details at the moment the agent needs them.


Build leaner agents with real cost numbers

Anthropic’s July 2026 context engineering guide is a clear signal: the next generation of AI agents will not be won by the longest prompt. It will be won by teams that design context like infrastructure.

Start by measuring your current prompt tokens, cutting static instructions, moving knowledge into retrieval, improving tool schemas, and routing premium models only to the steps that need premium reasoning. Then price the workflow at real traffic levels using AI Cost Check.

Next reads and tools: