10 The New Rules of Context Engineering for Claude 5 Generation Models
10.1 The Counterintuitive Discovery
On July 24, 2026, Anthropic published what may have been the most surprising engineering finding of the year: they had removed more than 80% of Claude Code’s system prompt for the Claude 5 generation of models (Opus 5 and Fable 5), and there was no measurable loss in performance.
This was not a minor optimization. The system prompt — the set of instructions, rules, examples, and constraints that shaped Claude Code’s behavior — had been carefully built up over months. It contained detailed procedures for how to read files, when to run tests, how to format output, how to handle edge cases, and much more. Removing 80% of it should, by conventional reasoning, have degraded behavior significantly.
It didn’t. And the reason it didn’t revealed a fundamental insight about how to instruct powerful models: overconstraining was the problem, not the solution.
This chapter covers the new rules of context engineering that emerged from this finding — rules that invert much of the conventional wisdom about prompt design.
10.2 The Problem: Overconstraining
The old system prompt was built on an understandable assumption: to get reliable behavior from a model, you specify the behavior in detail. If the model sometimes forgot to run tests, you add a rule: “Always run tests after making changes.” If it sometimes produced overly verbose output, you add: “Be concise.” Over time, the prompt accumulated hundreds of such rules.
The problem is that each rule, while solving a specific observed problem, adds constraint and noise to the context. A model processing a long list of rules must:
- Read and understand every rule (consuming attention).
- Decide which rules apply to the current task (more attention).
- Reconcile conflicting rules when they contradict each other (yet more attention).
- Avoid over-applying rules to cases they weren’t meant for (the “when you have a hammer” problem).
The net effect was that the rules intended to improve behavior were, at the margin, degrading it. The model was spending attention on rule-following rather than on the actual task. Removing most of the rules freed the model to reason about the task directly — and a sufficiently capable model (like Opus 5 or Fable 5) reasons well enough that explicit rules are often unnecessary.
The finding generalizes: for sufficiently capable models, less instruction often produces better behavior. This is the opposite of the intuition that drove earlier prompt design, which assumed more specification was always safer. The Claude 5 generation crossed a threshold where the model’s own judgment became more reliable than external rules.
10.3 Rule 1: Write Code That Reads Like Surrounding Code
The first new rule of context engineering is about code style and conventions. The old approach was to specify conventions explicitly: “Use 2-space indentation,” “Name variables in camelCase,” “Put imports at the top.”
The new approach: write code that reads like the surrounding code. Instead of specifying rules, let the existing codebase be the specification. A model reading a codebase where everything uses 2-space indentation will naturally produce 2-space-indented code — not because of a rule, but because that’s what the context shows.
This works because capable models are excellent at pattern matching. They infer conventions from examples far more reliably than they follow explicit rules, because examples carry implicit information (when to apply the convention, when to make exceptions) that rules don’t capture.
The practical implication: don’t write style rules in your CLAUDE.md or system prompt. Instead, ensure your codebase is consistent (so the pattern is clear), and let the model infer.
10.4 Rule 2: Use Parameter Design Instead of Examples for Tools
When designing tools (the functions an agent can call), the old approach was to provide examples of correct usage: “Here’s how to call this tool; here’s an example of the output.”
The new approach is parameter design: design the tool’s parameters so that correct usage is obvious from the parameter names and types, without examples.
| Old Approach | New Approach |
|---|---|
| Tool with vague parameters + usage examples | Tool with well-named, well-typed parameters |
| Model learns from examples (may overfit to them) | Model infers correct usage from design |
| Examples needed for every tool | Examples rarely needed |
# Old: vague tool, needs examples
def search(query, options):
"""Search the codebase. See examples for usage."""
pass
# New: parameter design makes usage obvious
def search_codebase(
pattern: str,
file_glob: str = "**/*",
regex: bool = False,
case_sensitive: bool = False
):
"""Search for a pattern in files matching file_glob."""
passThe well-designed tool is self-documenting. A capable model reading the parameter names and types can infer correct usage without examples — and won’t be biased by examples that may not cover its specific use case.
10.5 Rule 3: Progressive Disclosure
The old system prompt loaded everything upfront — every procedure, every verification step, every review checklist. This ensured everything was “available” but filled the context with information that was relevant only sometimes.
The new approach is progressive disclosure: load information on demand, only when it’s relevant to the current task.
| Component | Old Approach | New Approach |
|---|---|---|
| Verification procedures | Always in system prompt | Loaded as a skill when needed |
| Review checklists | Always available | Loaded when reviewing |
| Domain-specific guidance | Always present | Loaded for relevant tasks |
This is implemented through skills (Chapter 9) — lightweight guides that are loaded into context only when the task calls for them. The main context stays lean; specialized knowledge arrives when needed and departs when done.
10.6 Rule 4: Deferred Tool Loading via ToolSearch
A related change is deferred tool loading. An agent may have access to dozens or hundreds of tools, but loading all of their definitions into context consumes tokens and attention. The new approach uses a ToolSearch mechanism: the agent can search for and load tool definitions on demand, rather than having all tools available upfront.
This is analogous to progressive disclosure for tools. The agent starts with a core set of always-available tools (read, write, edit, search). When it needs a specialized tool, it searches for it, loads the definition, and uses it. The main context carries only the tools currently in use.
10.7 Rule 5: Keep CLAUDE.md Lightweight
CLAUDE.md is the project-level configuration file that Claude Code reads at the start of every session (Chapter 9). In the old approach, it was a comprehensive document — project structure, coding conventions, procedures, gotchas.
The new guidance: keep CLAUDE.md lightweight. Focus it on gotchas — the non-obvious things a model needs to know that it can’t infer from the codebase:
- “The
legacy/directory uses a different framework; don’t apply patterns from the main codebase there.” - “Tests must pass in both Python 3.11 and 3.12; we support both.”
- “The
config.yamlis generated fromconfig.template.yaml; edit the template, not the output.”
A good CLAUDE.md answers the question: “What will trip up someone who is smart but new to this project?” It captures the non-obvious — the traps, the exceptions, the things that look one way but are actually another. It does not restate what the code already says.
10.8 Rule 6: Skills Should Be Lightweight Guides, Not Over-Constraining Rules
Skills (on-demand procedure guides) should follow the same philosophy. A skill should be a lightweight guide that helps the model approach a task, not a rigid set of rules that constrains every step. Over-constrained skills have the same problem as over-constrained system prompts: they consume attention and prevent the model from adapting to the specific situation.
10.9 Rule 7: Use @ Mentions for References
Instead of embedding large reference documents in context, use @ mentions to bring in specific files, documentation, or resources only when needed. @filename loads that file’s content; @url fetches a web resource. This keeps the base context lean and lets the model pull in exactly what it needs for the current task.
10.10 Rule 8: Rubrics for Taste Verification
For subjective quality — “is this code well-written?”, “is this design elegant?”, “is this explanation clear?” — explicit rules are particularly ineffective. You cannot write a rule that produces good taste.
The new approach uses rubrics: structured criteria that a model can evaluate, even for subjective qualities. A rubric for code quality might include:
- Readability: Can a new team member understand this in under 5 minutes?
- Consistency: Does it follow the patterns in the surrounding code?
- Simplicity: Is there a simpler approach that achieves the same result?
- Testability: Can the behavior be verified with clear tests?
Rubrics work because they decompose subjective judgment into checkable criteria, giving the model a structured way to self-evaluate. This is the same principle behind the outcomes feature in Managed Agents (Chapter 13).
10.11 The Meta-Lesson: Trust Capable Models
The overarching lesson from the 80% removal is about trust. The old approach assumed the model needed to be told what to do at every step. The new approach recognizes that a sufficiently capable model can be trusted to figure it out — given clean context, good tools, and lightweight guidance.
This doesn’t mean no instruction. It means the right amount of instruction: enough to orient the model (what’s the project, what are the gotchas, what are the tools), but not so much that you’re doing the model’s thinking for it.
| Old Mindset | New Mindset |
|---|---|
| Specify behavior in detail | Orient, then trust the model |
| More rules = safer | More rules = more noise |
| Examples teach tool usage | Design teaches tool usage |
| Load everything upfront | Load on demand |
| Comprehensive CLAUDE.md | Lightweight CLAUDE.md (gotchas only) |
10.12 The Experiment: Removing the System Prompt
The finding that 80%+ of the system prompt could be removed with no measurable loss was not accidental — it was a deliberate experiment, and understanding how it was conducted clarifies the lesson.
10.12.1 How the Removal Was Tested
Anthropic didn’t simply delete the system prompt and hope for the best. The process was:
- Identify all components of the system prompt (rules, examples, procedures, constraints).
- Remove components incrementally, testing performance after each removal.
- Measure whether each removal caused any degradation in quality, using benchmarks and real-world tasks.
- Keep components that measurably helped; remove those that didn’t.
The result: more than 80% of the prompt’s content could be removed without measurable loss. The remaining ~20% was the essential core — orientation that the model genuinely needed and couldn’t infer.
10.12.2 What Was Removed vs. Kept
| Removed (no loss) | Kept (essential) |
|---|---|
| Detailed coding style rules | Tool definitions and parameter designs |
| Step-by-step procedures (moved to skills) | Core orientation (what Claude Code is, what it can do) |
| Example tool usage | Essential constraints (safety, permissions) |
| Redundant instructions | Critical gotchas that can’t be inferred |
| Over-specific formatting rules |
The components that survived were those that provided information the model couldn’t get elsewhere — tool designs, safety constraints, and critical gotchas. The components that were removed were those that duplicated information available in the context — style rules that the codebase already demonstrates, procedures that the model could figure out.
10.13 Applying the Lessons: A Practical Framework
The new rules of context engineering can be summarized as a framework for deciding what goes in context.
10.13.1 The “Can the Model Infer It?” Test
Before adding anything to the system prompt, CLAUDE.md, or a skill, ask: can the model infer this from the available context?
- Can it infer coding style from the codebase? Yes → don’t specify style rules.
- Can it infer tool usage from parameter design? Yes → don’t add examples.
- Can it infer the project structure from exploring files? Yes → don’t over-describe structure.
- Can it infer the gotcha about the
legacy/directory? No → put it in CLAUDE.md.
If the model can infer it, don’t specify it. If it can’t, do. This simple test eliminates most over-constraining.
10.13.2 The “When Is This Relevant?” Test
For procedures and checklists, ask: when is this relevant?
- Always relevant (e.g., “always run tests before committing”) → consider a hook instead of context.
- Sometimes relevant (e.g., “how to do a security review”) → put it in a skill, loaded on demand.
- Rarely relevant → don’t put it anywhere; let the model ask if it needs it.
10.13.3 The “What If I Remove It?” Test
For existing context, periodically ask: what happens if I remove this? If the answer is “probably nothing” or “the model would figure it out,” remove it. If the answer is “the model would make a specific mistake,” keep it.
10.14 CLAUDE.md in Practice
Let’s make the “keep CLAUDE.md lightweight” guidance concrete with examples.
10.14.1 A Bad CLAUDE.md (Over-Specified)
# Project Guidelines
## Coding Style
- Use 2-space indentation
- Use camelCase for variables
- Use PascalCase for classes
- Maximum line length: 80 characters
- Always add type annotations
- Imports at the top of the file
- One import per line
## Testing
- Always write tests for new functions
- Use pytest
- Name test files test_*.py
- Aim for 90% coverage
- Run tests before committing
## Git
- Commit messages should use conventional commits format
- Branch from main
- Open a PR for reviewThe problem: all of this is inferable from the codebase. A model reading a Python codebase with 2-space indentation, camelCase variables, and pytest test files will naturally follow these conventions. Specifying them in CLAUDE.md wastes context.
10.14.2 A Good CLAUDE.md (Gotchas Only)
# Project Notes
## Gotchas
- The `config.yaml` is generated from `config.template.yaml`.
Edit the template, not the output. The output is in .gitignore.
- The `legacy/` directory uses Django, not FastAPI. Don't apply
FastAPI patterns there.
- Tests run on both Python 3.11 and 3.12. Changes must work on both.
- The `migrations/` directory has a custom migration runner.
Don't use standard Alembic commands; use `python -m migrations.run`.
## Architecture
- This is a monorepo. Services are in `services/`, shared libs in `libs/`.
- Service-to-service communication is via gRPC, not HTTP.
See `proto/` for definitions.This CLAUDE.md is short, focused on non-obvious information, and doesn’t waste context on what the model can infer.
10.15 Implications for Skill Design
The same principles apply to skills. A skill should be a lightweight guide, not a comprehensive rulebook.
10.15.1 Designing a Good Skill
A good skill:
- Orients the model to the task type and approach.
- Highlights key considerations the model might not think of.
- References resources (files, documentation) rather than embedding them.
- Stays short — a few paragraphs, not pages.
A bad skill:
- Specifies every step in exhaustive detail.
- Embeds large reference documents.
- Tries to cover every edge case preemptively.
- Is so long it defeats the purpose of on-demand loading.
Test your skills the same way Anthropic tested the system prompt: try removing parts and see if performance degrades. If a skill works just as well with half its content removed, you’ve over-specified it. The goal is the minimum effective guide.
10.16 The Broader Lesson: Calibrating Trust
The deepest lesson from the context engineering findings is about trust calibration. The old approach assumed models needed to be told everything. The new approach recognizes that capable models can be trusted to figure things out — given clean context, good tools, and lightweight guidance.
This doesn’t mean no guidance. It means the right amount: enough to orient and highlight non-obvious risks, but not so much that you’re doing the model’s thinking for it. As models continue to improve, the optimal level of guidance decreases. The context engineering practices of today — lightweight CLAUDE.md, on-demand skills, parameter-designed tools — are calibrated for the Claude 5 generation. They’ll need to be recalibrated for each generation that follows.
10.17 Key Takeaways
- Anthropic removed 80%+ of Claude Code’s system prompt for Opus 5/Fable 5 with no measurable loss — overconstraining was the problem, not the solution.
- Write code that reads like surrounding code — let the codebase be the style guide; models infer conventions from patterns better than from rules.
- Use parameter design instead of examples for tools — well-named, well-typed parameters are self-documenting.
- Progressive disclosure — load procedures, checklists, and domain guidance on demand via skills, not upfront.
- Deferred tool loading via
ToolSearch— agents search for and load tool definitions when needed, keeping context lean. - Keep CLAUDE.md lightweight — focus on gotchas and non-obvious traps, not restating what the code says.
- Skills should be lightweight guides, not rigid rule sets — over-constrained skills degrade behavior.
- Use
@mentions to pull in references on demand rather than embedding them. - Use rubrics for taste verification — decompose subjective quality into checkable criteria.
- The meta-lesson: trust capable models — orient them with lightweight guidance, then let them reason.