Anthropic's 8x Efficiency Secret: It's Not the Model, It's the Context
Leaked Anthropic internal document: Context Engineering replaces Prompt Engineering. Five layers, three tiers, and an AGENTS.md file boost Claude's output 8x. The model didn't change—what changed is the information environment.
Anthropic engineers now merge 8 times more code per day than they did one year ago. No model swap, no new hardware, no team expansion. The only thing that changed is what Claude sees before it starts working.
This finding comes from a leaked $2.6 million Anthropic internal document titled *Context Engineering: The Anthropic Playbook for Designing AI Systems That Always Have the Right Information*.
While most developers are still figuring out how to write better prompts, Anthropic engineers are focused on building better context. That difference is exactly where the 8x productivity gap comes from.

## Why Your AI Agent Keeps Giving Wrong Answers
Most people blame the model. Wrong file edits, wrong assumptions, stupid mistakes any human developer would catch right away.
The model is almost never the problem. The problem is missing context.
A prompt is just a single sentence. Context is the entire information environment where Claude operates. The difference between a working agent and a broken one almost always comes down to what's in the environment—not which model you're running.
Anthropic puts it plainly: LLMs only see what's inside their context window. Context is the AI's operating system. Get it wrong, and even the strongest model is useless.
## What *Is* Context, Exactly?
Most people think context is just the block of text they paste before their question. That's only one layer. A properly engineered context has seven interconnected components working together:
```text
Memory | What the agent has learned from past conversations
Instructions | Rules, constraints, and coding standards
Examples | What good output looks like
Files | Relevant code, documentation, and architecture
Previous actions | What the agent has already tried
Tool results | What searches and function calls returned
State | Where the task stands right now
```
Every time Claude takes an action, context grows. Tool results come back, new files get read, the state updates. Claude sees the new context and decides its next move. This cycle is how agents actually work—not prompts, not the model, but a context that evolves with every step.
```text
User Request
↓
Build context from seven components
↓
Claude decides on an action
↓
Tool executes
↓
Result added to context
↓
Claude sees new context
↓
Next action
↓
Repeat until complete
```
A bad agent breaks at the second step. Incomplete context forces Claude to guess. Guesses lead to wrong output. Most developers fix this by rewriting prompts. The real fix is building context correctly.
## The Three-Layer Context Stack
Anthropic recommends organizing context into three distinct layers, each loaded at a different point in the workflow:
```text
Global Context | Persists across every single conversation
Project Context | Loaded once when starting work on a project
Task Context | Loaded specifically for the current task
```
**Global Context** is the permanent layer. It holds your agent's identity, core rules, coding standards, and hard prohibitions—things that never change across conversations, so you never need to re-explain them.
```text
Global context includes:
- Agent identity and role
- Coding standards and style rules
- Security constraints
- Hard prohibitions on files or changes
- How to handle uncertainty
```
**Project Context** is the knowledge layer. It holds everything Claude needs to understand the codebase: architecture, adopted patterns, reasoning behind past decisions, and pitfalls the team already ran into.
```text
Project context includes:
- README and architecture overview
- Project-specific rules in AGENTS.md
- Folder structure and naming conventions
- Testing requirements and patterns
- Key dependencies and why they were chosen
```
**Task Context** is the execution layer. It holds the file you're currently editing, the current ticket, immediate goals, and constraints specific to this exact task.
```text
Task context includes:
- Current and related files
- Specific goal for this conversation
- Recent changes and their results
- Current test results
- Constraints specific to this task
```
Most developers only give Claude task context. The agent starts from scratch every conversation, with no global or project context, so it has to guess everything it doesn't know. All those guesses are where errors come from.
## AGENTS.md — The File That Changes Everything
It's the single most important file in any serious Claude Code setup. Researchers have already recognized AGENTS.md as the new standard for AI coding agent context, and it's already used in thousands of production repositories because it simply works.
AGENTS.md is the permanent home for your project context. Claude automatically reads it at the start of every conversation. You never need to repeat that information again.
```markdown
# AGENTS.md
## Architecture
Monorepo with Next.js frontend + Express backend.
All API routes live under /api. Never modify /legacy directly.
## Coding Rules
Never use axios. Always use fetch.
Every component uses TypeScript, Tailwind, and Server Actions.
Don't use default exports anywhere except pages.
## Testing
Use Vitest for unit tests. Use Playwright for E2E.
Run npm test before every commit.
Never disable a failing test—fix it or escalate it.
## Git
Never commit directly to main.
Always open a PR with a clear description.
Link every PR to a Linear ticket.
## Never Touch
src/payments/ — any change requires manual approval
src/auth/tokens/ — requires security review
.env files — never read or modify
```
Every rule in this file eliminates one entire category of mistake Claude would otherwise make. The longer your project runs, the more specific and valuable AGENTS.md becomes—it accumulates every mistake the agent has made and every convention the team has established.
## The Context Stack That Powers Serious Agents
The best AI engineers don't write prompts when they start a task. They build a context stack: an ordered sequence of structured information loaded before Claude takes any action.
```text
Step 1 | Load global context — identity, rules, style
Step 2 | Load project context — AGENTS.md, architecture, docs
Step 3 | Search memory for relevant past experience
Step 4 | Load relevant files for the current task
Step 5 | Load current state — test results, recent changes
Step 6 | Define task goal with clear success criteria
Step 7 | Claude acts with complete information
```
Compare the bad default agent to a properly context-engineered agent:
```text
Bad Agent:
Question → Claude → Answer
Claude guesses everything it doesn't know
Good Agent:
Question
↓ Search documentation
↓ Search memory
↓ Read AGENTS.md
↓ Read relevant files
↓ Check current state
↓ Claude
↓ Answer built on complete information
```
The second agent isn't smarter. It's just better informed. The model is exactly the same. Only the context is different.
## Memory — Context That Survives Across Conversations
Anthropic clearly defines different types of memory that feed your context. Most agents only have one: the current conversation. That's why they start from scratch every time.
```text
Long-term Memory | Everything learned across all past conversations
Short-term Memory | What happened earlier in *this* conversation
Working Memory | What's currently in the context window
```
Long-term memory lets an agent's value compound over time. You add to it every conversation. Every mistake is logged. Every successful pattern is stored. After six months working on a codebase, an agent knows things about that project no prompt could ever replicate.
In practice, this is implemented as a memory file: a markdown document outside of your conversations that the agent reads at the start of every session and updates at the end.
```markdown
# Project Memory
## Architecture Decisions
- Chose Supabase over Firebase: low real-time requirements, needed SQL queries
- Migrated from REST to tRPC: full-stack type safety, June 2026
## What Works
- Increase test coverage before refactoring to prevent regressions
- Split large PRs into feature-flagged releases to cut down review time
## What Doesn't Work
- Auto-generated migrations: caused schema drift and a production outage
- Parallel agents writing to the same file: always use worktrees
## Recurring Patterns
- Authentication issues almost always trace back to middleware order
- Performance issues usually start with the database query layer
```
The agent reads this file every session, updates it every session, and never forgets.
## MCP — Pull Context From Anywhere
Context doesn't only come from files in your repository. Production-grade agents need context from every tool your team uses: issue trackers, error monitoring, documentation, databases, and communication tools.
The Model Context Protocol lets Claude pull context from external systems without needing custom integrations for each one.
```text
Filesystem | Local files, configs, and codebases
GitHub | issues, PRs, commit history, CI results
Linear / Jira | tickets, priorities, project status
Slack | decisions and discussion context
Postgres | live data, schema, query results
Google Drive | docs, specs, meeting notes
Sentry | live errors, frequency, affected users
```
An agent configured with MCP doesn't just see the code. It sees the ticket explaining why the feature is needed, the Slack conversation where the architecture was decided, the Sentry error showing how users encounter the bug, and the database schema it needs to respect for the fix.
That's complete context. Everything Claude needs to make the right decision, no guessing required.
## The Context Engineering Workflow

This is what a fully context-engineered task looks like from start to finish.
Instead of giving Claude this:
```text
Build an export feature.
```
You give Claude this:
```text
Goal
The export feature is blocking free-to-paid conversions.
See signal: /signals/export-too-hidden.md
Relevant Files
src/features/export/ — current implementation
src/components/ui/Button.md — button patterns to follow
tests/features/export.test.ts — existing test coverage
Architectural Constraints
Read the "Export Rules" section in AGENTS.md
Never modify billing integrations directly
Success Criteria
All existing tests pass
New tests cover all three export formats
PR opened and linked to Linear ticket EXP-47
No changes to src/payments/
```
Same task, completely different context. The output isn't just incrementally better—it's qualitatively different, because Claude is making decisions with complete information instead of educated guesswork.
## A Practical Setup You Can Build This Weekend
Day 1 — Build your three-layer context stack. Write a global context file with your agent's identity and core rules. Create AGENTS.md with your project architecture, coding conventions, and hard prohibitions. Set up a memory file that loads at the start of each session and updates at the end.
Day 2 — Connect external context via MCP. Install the GitHub connector so Claude can see your issue tracker and PR history. Install the filesystem connector to let it navigate your codebase efficiently. Add Slack or Linear if your team uses them to document decisions.
Day 3 — Test the difference. Run the same task with your old prompt-only approach and your new full context stack. The gap in output quality is exactly where that 8x productivity comes from.
## The Shift That's Already Happening
Prompt engineering is about finding the right words. Context engineering is about building the right information environment.

Anthropic's top AI engineers don't spend time crafting clever prompts. They spend time making sure Claude has the right knowledge, memory, files, rules, and state before it takes any action. Prompting is the last 1% of the work. Context is the other 99%.
An agent with a perfect prompt but bad context will make smart-sounding mistakes. An agent with an average prompt but complete context will make the right decisions. The model is the same. The information environment is different.
Context is the AI's operating system. Get it right, and that 8x productivity boost won't just be an Anthropic internal secret—it will happen in your codebase too.
Most developers will keep rewriting their prompts and wonder why their results don't improve. A small number will spend one weekend building a solid context stack, and they'll never go back.
发布时间: 2026-07-05 09:38