# Claude Context Full Content Guide
An independent, source-backed guide to Claude context windows, context engineering, compaction, prompt caching, Claude Code context, and MCP resources.
ClaudeContext.com is an independent educational publication. It is not affiliated with, endorsed by, or sponsored by Anthropic.
Last source check: 2026-09-20
## Signature Experience
### The Corridor
URL: https://claudecontext.com/corridor/
Description: A walkable map of Claude context windows. Start at Claude Haiku 4.5’s 200K door (64K max output) and step into the 1M hall used by Claude Fable 5.1, Claude Opus 5, and Claude Sonnet 5 (128K max output). Markers cover cache reads, compaction, what fits, and what falls off.
Key facts:
- Claude Fable 5.1, Claude Opus 5, and Claude Sonnet 5: 1M-token context window, 128K max output.
- Claude Haiku 4.5: 200K-token context window, 64K max output.
- Cache reads: 10 percent of base input on most models; 2.5 percent on Claude Fable 5.1 / Mythos 5.1 ($0.25 / MTok).
- Output tokens compete with input. A full window cannot answer.
- Compaction, tool-result clearing, MCP resources, and memory are different levers. Memory product coverage lives on claudememories.com.
FAQ:
- Q: How big is Claude’s context window? A: 1M tokens with 128K max output on Fable 5.1, Opus 5, and Sonnet 5; 200K with 64K max output on Haiku 4.5. Checked 2026-09-19.
- Q: Is a larger window always better? A: No. Curating what is in context is as important as how much space is available.
## Tools
### Tools Index
URL: https://claudecontext.com/tools/
Description: Free client-side Claude context tools.
### Claude Context Window Planner
URL: https://claudecontext.com/tools/context-planner/
Description: Allocate a Claude context window across instructions, tools, history, retrieval, working notes, and output reserve using current published model window sizes.
Updated: 2026-09-19
Features: Model-aware context budget math; Live segment visualization; Output reserve warnings; Copyable and downloadable context plan
Key facts:
- Current large-window models: 1M tokens. Claude Fable 5.1, Claude Opus 5, and Claude Sonnet 5 each carry a 1M-token context window with 128K max output. Claude Haiku 4.5 is 200K with 64K max output.
- Planning rule: Reserve output. The response itself counts toward the context window, so a useful plan leaves room for generated output.
How to use:
- Choose the Claude model you plan to use.
- Enter estimated token budgets for instructions, tools, history, retrieval, notes, and output reserve.
- Review the live window bar and warnings.
- Copy or download the resulting context plan.
FAQ:
- Q: Does this planner count tokens from raw text? A: No. It plans with token estimates you enter. For exact counts, use Anthropic token counting against the model you will call.
- Q: Is any prompt or document sent to a server? A: No. The planner runs entirely in your browser and stores nothing remotely.
- Q: Why is output reserve included in the window? A: Anthropic context-window docs describe the context window as including the response itself, so planned output needs budget.
Sources:
- Models overview (Claude Platform Docs): https://platform.claude.com/docs/en/about-claude/models/overview
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
- Token counting (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/token-counting
### Claude Compaction Simulator
URL: https://claudecontext.com/tools/compaction-simulator/
Description: See how long Claude conversations can be summarized: what survives compaction, what becomes a short note, and what should be re-fetched or discarded.
Updated: 2026-09-19
Features: Adjustable context trigger threshold; Editable turn token weights; Survives versus lost context report; Teaching model for compaction tradeoffs
Key facts:
- Compaction purpose: Compress state. Compaction is useful when the accumulated dialogue contains decisions and constraints that should continue as a smaller handoff.
- Main risk: Dropped nuance. Summaries can omit exact numbers, paths, or source details unless the compaction prompt preserves them.
How to use:
- Set the context window size and trigger threshold.
- Adjust the example turns or mark turns that must survive.
- Run the simulation to compare raw history with a compacted handoff.
- Use the survive/lost report to improve your own compaction prompt.
FAQ:
- Q: Is this the actual Claude server-side compaction API? A: No. This is an educational simulator that models the tradeoff between raw history and summarized state.
- Q: What should always survive compaction? A: Preserve user goals, hard constraints, decisions, exact IDs or paths, source provenance, and unresolved risks.
- Q: What can usually be dropped? A: Drop small talk, duplicate tool output, outdated plans, and bulky results that can be fetched again from their source.
Sources:
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
- Context engineering: memory, compaction, and tool clearing (Claude Cookbook): https://platform.claude.com/cookbook/tool-use-context-engineering-context-engineering-tools
- Effective context engineering for AI agents (Anthropic Engineering): https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
### Claude Prompt Caching Savings Calculator
URL: https://claudecontext.com/tools/caching-calculator/
Description: Estimate daily savings from Claude prompt caching using current dated cache write and cache read prices from the Claude Platform pricing docs.
Updated: 2026-09-19
Features: Current model cache pricing, including the Fable 5.1 $0.25 read tier; 5-minute versus 1-hour TTL comparison; Hit-rate and rewrite-frequency controls; Break-even and daily savings math
Key facts:
- Cache read price: $0.25 on Fable 5.1. Cache reads are 10 percent of base input on most Claude models. On Claude Fable 5.1 they are 2.5 percent, or $0.25 per million tokens.
- Write prices: 1.25x or 2x. 5-minute cache writes are 1.25x base input price; 1-hour writes are 2x base input price.
How to use:
- Choose the model and cache TTL you expect to use.
- Enter cached prefix size, daily calls, cache rewrites, and hit rate.
- Compare uncached cost with cache write, cache hit, and miss costs.
- Use the result as a planning estimate, then verify with actual usage metrics.
FAQ:
- Q: Does prompt caching reduce context-window usage? A: No. Cached tokens still count as context for the request. Caching reduces repeated processing cost and latency.
- Q: When does caching break even? A: The pricing docs state that 5-minute caching pays off after one cache read and 1-hour caching after two cache reads.
- Q: Why is the Fable 5.1 cache read so much cheaper than its base input price? A: Claude Fable 5.1 prices cache reads at 2.5 percent of base input rather than the usual 10 percent, which works out to $0.25 per million tokens. Anthropic described the change as a 75 percent cut at the September 1, 2026 launch, so a large stable prefix can be cheaper to re-read on Fable 5.1 than on a model with a lower base price.
- Q: Are the prices current? A: The embedded prices were checked against Claude Platform pricing on September 19, 2026. Recheck before using them for billing commitments.
Sources:
- Prompt caching (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-caching
- Pricing (Claude Platform Docs): https://platform.claude.com/docs/en/about-claude/pricing
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
## Pages
### Claude Context Window: What Counts and What Breaks
URL: https://claudecontext.com/context-window/
Description: A sourced guide to Claude context windows: what counts, why larger context is not automatically better, and how to measure tokens before you send.
Updated: 2026-09-19
Citation anchor: https://claudecontext.com/context-window/#cite-this-page
Sections:
- The context window is working memory, not training data: Claude has a trained model behind it, but the context window is the immediate information available for the next response. In API terms, it includes the conversation history that you pass back, the current input, tool definitions, tool-use records, tool results, relevant thinking blocks where applicable, and the output Claude is about to generate. That distinction matters because many failures blamed on "the model" are really context failures. The answer may be wrong because the needed fact was never included, because contradictory facts were included, because a stale tool result remained in the history, or because the task had grown past the point where raw accumulation was the right strategy.
- Current Claude context windows: As of the September 19, 2026 source check, the three frontier models Anthropic lists as generally available share the same window and output ceiling. Only Haiku is smaller, which makes model choice a context-budget decision as much as a cost or latency one.
- What counts toward the window: The official context-window docs describe context as accumulating across turns. Previous messages remain in the window unless your application summarizes, clears, or omits them. Tool use can add a lot of hidden weight: tool definitions, tool-use requests, tool results, and follow-up messages can all become part of the state the next turn must carry. Extended thinking changes accounting details, especially when a tool cycle requires preserving an unmodified thinking block. The practical rule is simple: if a block has to be supplied back to the API for continuity, treat it as part of your context budget unless the current model and API behavior explicitly strip or manage it for you.
- A bigger window is not a junk drawer: Long context is valuable when the task genuinely depends on many documents, a large codebase, or a multi-step history. It is harmful when it becomes an excuse to mix stale instructions, broad dumps, duplicate examples, and unfiltered logs. Anthropic's own context-engineering article frames context as finite because attention and recall degrade as irrelevant or conflicting tokens accumulate. The useful design question is not "Can this fit?" It is "Does this token improve the next model call enough to justify cost, latency, and distraction?" If the answer is no, store a reference, create a summary, move it to a retrieval system, or leave it out.
- Measure before you route: For production work, token estimation should be part of routing. Claude's token-counting endpoint accepts the same structured inputs used to create a message and returns an estimated total. That lets you choose a model, trim a prompt, decide whether to cache a prefix, or switch to a retrieval pattern before a request fails or becomes expensive. Do not reuse old counts blindly. Anthropic notes that newer model tokenizers can count the same text differently from earlier models, a caveat that first mattered widely in the Sonnet 5 generation and still applies across the Fable 5.1, Opus 5, and Sonnet 5 lineup. Recount prompts against the model that will actually handle the request.
FAQ:
- Q: Which Claude models have a 1M-token context window? A: Claude Fable 5.1, Claude Opus 5, and Claude Sonnet 5 are each listed with a 1M-token context window and 128K max output. Claude Haiku 4.5 has a 200K-token window and 64K max output. Checked September 19, 2026.
- Q: Does the Claude context window include the answer Claude writes? A: Yes. The context-window docs describe the window as including the response itself, so output tokens compete with input history for the total window.
- Q: Should I always choose the largest Claude context window? A: No. Use large context when the task needs it. Otherwise, smaller focused context can improve latency, cost, and recall.
Sources:
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
- Models overview (Claude Platform Docs): https://platform.claude.com/docs/en/about-claude/models/overview
- Claude Fable 5.1 overview (Claude Platform Docs): https://platform.claude.com/docs/en/models/fable-5-1/overview
- Claude Opus 5 overview (Claude Platform Docs): https://platform.claude.com/docs/en/models/opus-5/overview
- Token counting (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/token-counting
- Effective context engineering for AI agents (Anthropic Engineering): https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
### Context Engineering vs Prompt Engineering
URL: https://claudecontext.com/context-engineering/
Description: A practical boundary between Claude prompt engineering and context engineering, grounded in Anthropic source material.
Updated: 2026-07-06
Citation anchor: https://claudecontext.com/context-engineering/#cite-this-page
Sections:
- Prompt engineering writes the contract. Context engineering manages the workspace.: Prompt engineering is still real work: clear instructions, examples, roles, output formats, and XML or Markdown structure all help Claude understand what to do. Anthropic's prompting docs continue to recommend direct instructions, relevant examples, and explicit formatting guidance. Context engineering is broader. It asks what information should be present for this call, what should be retrieved later, what should be summarized, what should be cached, what should be hidden behind tools, and what should be kept out entirely. For agents, that choice repeats at every step.
- Why the term matters for Claude work: The term prevents a common mistake: trying to fix every failure by rewriting the prompt. If Claude misses a requirement, the issue might be an unclear instruction. But it might also be missing source material, too many irrelevant files, stale memory, unhelpful tool output, or a conversation that should have been compacted twenty turns ago. A context-engineering review therefore starts with the state, not just the words. Inspect the instruction hierarchy, source freshness, examples, active tool list, retrieval behavior, message history, and output constraints. Then change the smallest layer that explains the failure.
- Use the right lever: When the model misunderstands a task, improve the prompt. When it lacks facts, improve retrieval or source packets. When it forgets the middle of a long run, compact or write durable notes. When tool results dominate the window, clear old results or return smaller summaries. When the same giant prefix repeats, use prompt caching.
- Where this site stops: ClaudeContext.com focuses on the information architecture around Claude calls. For deeper Claude memory examples, the natural sibling is Claude Memories. For broad Claude Code workflow and CI practice, use Claude Ships Code. This site links those topics where they affect context, but does not duplicate their lane.
FAQ:
- Q: Is context engineering just RAG? A: No. Retrieval is one context-engineering tactic. Context engineering also covers instructions, examples, tools, memory, tool results, summaries, caches, and conversation history.
- Q: Is prompt engineering obsolete? A: No. Prompt engineering remains one layer of context engineering. Clear instructions and examples still matter.
Sources:
- Effective context engineering for AI agents (Anthropic Engineering): https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
- Prompting best practices (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
### The Claude Context Stack
URL: https://claudecontext.com/context-stack/
Description: A layered map of the information Claude can receive: instructions, examples, tools, retrieval, memory, history, and outputs.
Updated: 2026-07-06
Citation anchor: https://claudecontext.com/context-stack/#cite-this-page
Sections:
- Layer 1: Purpose and success criteria: Before adding documents or tools, define the decision Claude is supposed to make. A task like "review this PR" needs different context from "write a release note" even if both involve the same repository. Purpose decides which facts are relevant and which facts are distraction. Write success criteria in operational terms: expected output, audience, constraints, allowed actions, and evidence standard. This reduces the temptation to load every available source "just in case."
- Layer 2: System and developer instructions: System and developer instructions define behavior. For Claude, keep them specific enough to guide decisions but not so procedural that they become brittle. Anthropic recommends sectioning prompts when they mix background, instructions, examples, and output requirements. The altitude matters. "Be helpful" is too vague for a production agent. A 400-line decision tree can be too brittle. The useful middle is a small set of durable rules, clear boundaries, and examples that represent real work.
- Layer 3: Examples and rubrics: Examples are high-leverage context because they show the intended shape of the answer. Use a few canonical examples that cover real edge cases. Avoid turning examples into a dump of every previous failure. For review, evaluation, support, or extraction tasks, a compact rubric often beats more prose. The rubric tells Claude how to rank evidence and when to say that the answer is unknown.
- Layer 4: Source material: Source material includes files, docs, transcripts, API responses, database rows, screenshots, or research notes. It can be loaded directly, retrieved just in time, represented as MCP resources, or summarized into a source packet. The right shape depends on how often it changes and how precise the answer must be. The best source packet is not the longest one. It contains provenance, timestamp, relevance, and enough surrounding context for Claude to avoid quote-mining a single line.
- Layer 5: Tools and MCP servers: Tools expand what Claude can do, but every tool definition is context. Bloated, overlapping tools increase decision cost. MCP servers add another routing layer: resources expose context, tools execute actions, and prompts can standardize workflows. Audit tools by asking whether a human engineer could pick the right one from the name, description, and schema alone. If not, Claude is likely to hesitate, misuse a tool, or waste turns exploring.
- Layer 6: Memory and durable notes: Memory is not the same as the current context window. It is external state that can be loaded back into context. Claude Code uses `CLAUDE.md` and auto memory for project and preference continuity; API agents may use a memory tool or their own file-backed notes. Treat memory as an index and policy surface, not a pile of transcripts. If the memory itself grows without pruning, it becomes another context problem.
- Layer 7: Conversation history and generated output: Conversation history is easy to underestimate because it accumulates silently. A long chat can contain early assumptions, outdated plans, huge tool results, and partial conclusions. Compaction and clearing are ways to turn raw history back into useful working state.
FAQ:
- Q: What is the first layer to fix when Claude fails? A: Start with the smallest layer that explains the failure. If the fact was absent, fix source retrieval. If the action was unclear, fix instructions. If history is noisy, compact or clear it.
- Q: Should tools be part of context engineering? A: Yes. Tool names, descriptions, schemas, and results shape what Claude can infer and decide during a task.
Sources:
- Effective context engineering for AI agents (Anthropic Engineering): https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
- Prompting best practices (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
- Claude Code settings (Claude Code Docs): https://code.claude.com/docs/en/settings
- Resources (Model Context Protocol Specification): https://modelcontextprotocol.io/specification/2025-06-18/server/resources
### Compaction, Tool Clearing, and Memory
URL: https://claudecontext.com/compaction/
Description: How to choose between Claude compaction, tool-result clearing, and memory when long conversations or agents exceed useful context.
Updated: 2026-09-19
Citation anchor: https://claudecontext.com/compaction/#cite-this-page
Sections:
- The problem is not just hitting the limit: A conversation can fail before it reaches a hard context limit. Tool output can crowd out the task. Old assumptions can conflict with new decisions. The model can spend attention reconciling stale logs instead of solving the next step. Context management is about keeping the active state useful, not merely keeping the request under a number.
- Use compaction when dialogue is the valuable state: Compaction takes a long conversation, summarizes the important state, and continues from that compressed representation. It is best when the important material is not one re-fetchable blob but the outcome of many turns: decisions, unresolved questions, constraints, implementation notes, and user preferences. A good compaction summary preserves facts that are hard to reconstruct and discards raw material that can be retrieved again. The risk is over-summarizing. If a number, path, exception, or decision boundary will matter later, it belongs in the summary.
- Use tool clearing when results are bulky and re-fetchable: Tool-result clearing is different from compaction. It targets old tool outputs, especially file reads, search results, logs, and API responses that can be loaded again. The current run keeps recent context and replaces older tool results with placeholders or summaries. This works best when tools are deterministic or cheap enough to re-run. It is riskier when the raw output was volatile, expensive, or impossible to reproduce.
- Use memory when knowledge must survive the session: Memory is for continuity across context windows and sessions. It should contain stable preferences, architecture facts, project conventions, durable decisions, and pointers to where richer evidence lives. It should not become a transcript archive. Memory needs governance. Facts change. Preferences change. Security requirements may forbid storing some information. A useful memory system includes audit, editing, expiration, and source links. This site covers memory only as a context lever: what it removes from the window and what it loads back in. The product surface, including how Claude memory now works across chat and Cowork and who controls what it stores, is covered by Claude Memories.
- A simple choice rule: If you need the story of the conversation, compact. If you need to remove large old artifacts that can be fetched again, clear tool results. If you need future sessions to remember stable state, write memory. In real agents, all three can coexist, but each should solve a different problem.
FAQ:
- Q: Can compaction lose important context? A: Yes. Overly aggressive summaries can drop subtle facts. Tune compaction prompts on real traces and preserve precise decisions, paths, IDs, and unresolved risks.
- Q: Is memory a replacement for compaction? A: No. Memory persists selected knowledge across sessions. Compaction keeps a long current conversation usable.
Sources:
- Context engineering: memory, compaction, and tool clearing (Claude Cookbook): https://platform.claude.com/cookbook/tool-use-context-engineering-context-engineering-tools
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
- Effective context engineering for AI agents (Anthropic Engineering): https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
### Claude Code Context: CLAUDE.md, Auto Memory, and Subagents
URL: https://claudecontext.com/claude-code-context/
Description: How Claude Code manages context through fresh windows, CLAUDE.md, auto memory, settings, MCP servers, and subagents.
Updated: 2026-07-06
Citation anchor: https://claudecontext.com/claude-code-context/#cite-this-page
Sections:
- Every session starts fresh, then context is loaded: The most important Claude Code context fact is that a new session does not inherit the full transcript of every prior session. It starts with a fresh context window, then loads configured project guidance, user guidance, and memory. That is why durable instructions belong in files and settings, not in a one-off chat message you hope will be remembered. This also explains why short, specific project guidance is more reliable than a sprawling handbook. Whatever loads at startup competes with the current task for attention.
- Use CLAUDE.md for intentional project context: `CLAUDE.md` is best for instructions humans choose: build commands, repo layout, testing expectations, coding standards, release rules, and warnings about sharp edges. It is context, not a hard security boundary. If an action must be blocked, use settings, permissions, hooks, or policy mechanisms rather than relying on prose alone. Keep `CLAUDE.md` close to the work. Large teams often need scoped rules rather than one universal file. The point is to load the right local conventions, not every convention the organization has ever written.
- Use auto memory for discovered patterns: Auto memory is different. It captures learnings Claude derives from corrections and repeated patterns. That can be valuable for build quirks, debugging discoveries, and user preferences, but it should be audited. A stale memory can be worse than no memory because it looks authoritative while quietly sending the agent in the wrong direction.
- Settings, skills, and MCP servers are also context controls: Claude Code settings can configure permissions, environment variables, tool behavior, skills, and MCP servers. Those settings shape the action space Claude sees. A context review should therefore inspect not only the prompt files but also which tools, MCP servers, and skills are available. For deeper memory-specific patterns, use Claude Memories. For broader Claude Code engineering practice, use Claude Ships Code.
- Subagents preserve focus by isolating side work: Claude Code subagents run with their own context window, prompt, tool access, and permissions. Use them when research, log scanning, or file exploration would flood the main conversation with material you only need as a summary. The main risk is delegating work that should stay visible. Keep strategic decisions, user constraints, and final synthesis in the main thread. Send bounded exploration and repeatable specialist work to subagents.
FAQ:
- Q: Is CLAUDE.md enforced configuration? A: No. Claude Code docs describe it as context. Use hooks, settings, permissions, or managed policy for enforcement.
- Q: When should I use a Claude Code subagent? A: Use a subagent when side exploration would consume main-thread context but can return a compact summary.
Sources:
- How Claude remembers your project (Claude Code Docs): https://code.claude.com/docs/en/memory
- Claude Code settings (Claude Code Docs): https://code.claude.com/docs/en/settings
- Create custom subagents (Claude Code Docs): https://code.claude.com/docs/en/sub-agents
- Effective context engineering for AI agents (Anthropic Engineering): https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
### MCP Resources as Claude Context
URL: https://claudecontext.com/mcp-resources/
Description: What MCP resources are, how they provide structured context to Claude, and when to use resources instead of tools or prompt text.
Updated: 2026-07-06
Citation anchor: https://claudecontext.com/mcp-resources/#cite-this-page
Sections:
- A resource is context, not an action: In MCP, resources expose data that a client can read and present to a model. Examples include files, database schemas, documents, logs, images, and application-specific records. A resource is identified by a URI and can include metadata that helps the client decide when and how to show it. That makes resources a context-engineering primitive. Instead of pasting every relevant object into the prompt, a system can expose an inventory of addressable context and load only the item needed for the current step.
- Resources, tools, and prompts solve different problems: Use a resource when Claude needs to read state. Use a tool when Claude needs to perform an action or compute something. Use an MCP prompt when you want to standardize a reusable interaction pattern. Mixing these up creates context bloat and security confusion.
- Metadata is part of the context design: The MCP spec supports annotations such as audience, priority, and lastModified. Those fields are not decoration. They help clients and humans decide whether a resource belongs in context now. A low-priority historical file should not crowd out a high-priority current incident note. For source-heavy Claude workflows, lastModified and provenance are especially important. AI answers should prefer current, authoritative context over stale but conveniently loaded context.
- Claude MCP connector is not the whole protocol surface: Anthropic's MCP connector lets the Messages API connect to remote MCP servers for tool access without a separate client. The docs distinguish that path from client-side helpers, which are needed for local servers, prompts, resources, or more connection control. For context architecture, that distinction matters: "MCP support" does not automatically mean every MCP primitive is available through the same integration path.
- Keep a resource inventory: A useful MCP resource inventory names the resource, URI pattern, owner, freshness expectation, sensitivity level, and retrieval cost. It also states whether Claude should see full content, a summary, or a pointer first. This turns MCP from a pile of connectors into a managed context surface.
FAQ:
- Q: Are MCP resources the same as RAG? A: No. RAG is one retrieval pattern. MCP resources are a protocol primitive for exposing readable context by URI.
- Q: Should secrets be exposed as MCP resources? A: No. Treat MCP resources as context that may be shown to a model or user. Apply least privilege and avoid exposing secrets unless your security model explicitly permits it.
Sources:
- Resources (Model Context Protocol Specification): https://modelcontextprotocol.io/specification/2025-06-18/server/resources
- MCP connector (Claude Platform Docs): https://platform.claude.com/docs/en/agents-and-tools/mcp-connector
- Effective context engineering for AI agents (Anthropic Engineering): https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
### Prompt Caching for Large Claude Context
URL: https://claudecontext.com/prompt-caching/
Description: When Claude prompt caching helps, what it caches, what TTLs mean, and why caching is not a substitute for context selection.
Updated: 2026-09-19
Citation anchor: https://claudecontext.com/prompt-caching/#cite-this-page
Sections:
- Prompt caching helps repeated stable prefixes: Prompt caching is useful when multiple requests share a large stable prefix: long instructions, many examples, a large background document, or a multi-turn base state. Instead of paying the full processing cost every time, you mark cache breakpoints and let the platform reuse the cached prefix when possible. It is especially relevant for agents that repeatedly ask short questions against the same large source packet, evaluation harnesses that run many variants against a shared rubric, and workflows with expensive examples that rarely change.
- Cache reads are not priced the same on every model: The long-standing rule is that a cache read costs 10 percent of the base input price, a 5-minute cache write costs 1.25x base input, and a 1-hour write costs 2x. That still holds for Claude Opus 5, Claude Sonnet 5, and Claude Haiku 4.5. Claude Fable 5.1 is the exception. Its cache reads are 2.5 percent of base input, which is $0.25 per million tokens against a $10 base input price. Anthropic described this as a 75 percent cut relative to the previous Fable cache-read rate and estimated roughly 25 percent savings on a typical workload, rising to around 45 percent on highly agentic ones. This changes the arithmetic behind model choice. On Fable 5.1 a cached million-token prefix is read back for a quarter of a dollar, so an agent that re-reads a large stable packet on every step may be cheaper on the more expensive model than on a cheaper one with a 10 percent read rate. Run the comparison on your own hit rate rather than assuming the lower base price wins.
- Changing tools mid-conversation no longer has to cost the cache: Prompt caching works on prefixes, so anything near the front of the request has historically been expensive to touch. Tool definitions usually sit in that prefix, which meant adding, removing, or editing a tool part-way through a conversation invalidated the cache and forced a full rewrite on the next call. Claude Opus 5 ships a beta that allows mid-conversation tool changes without invalidating the prompt cache. For agent builders this removes a real design constraint: you can narrow the tool surface as a task progresses, load a specialist tool only when a step needs it, or drop tools that are no longer relevant, without paying to re-cache the whole prefix each time. Treat it as a beta and verify against your own usage metrics before planning around it. Confirm the behavior in the Opus 5 model documentation and watch `cache_creation_input_tokens` after a tool change to check that a rewrite did not silently happen anyway.
- Caching does not make bad context good: Caching lowers repeated work. It does not decide whether the context is relevant, current, non-duplicative, or safe. If your prefix contains stale docs, conflicting instructions, or 50 examples when five would do, caching just makes the bad prefix cheaper to reuse. The context-engineering order is selection first, caching second. Trim and structure the prefix, measure tokens, then cache the parts that are genuinely stable.
- TTL changes the operational model: The default cache lifetime is short, and Anthropic documents a longer 1-hour option with different cost implications. Short TTLs work for bursty tasks: a user asks several questions against the same packet, or an eval suite runs quickly. Longer TTLs are better when a large shared context is reused on a cadence over a longer session. Cache design should reflect how your workload actually repeats. If calls are parallel, note that cache availability can depend on the first response beginning before subsequent requests expect a cache hit.
- Track cache reads and writes: Prompt caching should be observable. Track cache read tokens, cache creation tokens, uncached input tokens, latency, and answer quality. A cache that rarely hits adds complexity without much value. A cache that hits frequently but serves stale context is a correctness risk.
FAQ:
- Q: How much does a Claude Fable 5.1 cache read cost? A: Cache reads on Claude Fable 5.1 are $0.25 per million tokens, which is 2.5 percent of its $10 base input price. Most other Claude models, including Opus 5, Sonnet 5, and Haiku 4.5, price cache reads at 10 percent of base input.
- Q: Can I change tools mid-conversation without invalidating the prompt cache? A: Claude Opus 5 has a beta that allows mid-conversation tool changes without invalidating the prompt cache. On other models, editing tool definitions changes the cached prefix and forces a cache write on the next call.
- Q: Does prompt caching reduce the context-window size? A: No. Cached content still represents context for the request. Caching can reduce repeated processing cost and latency, but it does not remove the need to fit and curate context.
- Q: What should I cache first? A: Cache large, stable prefixes that are reused frequently: instructions, examples, rubrics, durable background, and shared source packets.
Sources:
- Prompt caching (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-caching
- Pricing (Claude Platform Docs): https://platform.claude.com/docs/en/about-claude/pricing
- Claude Fable and Mythos 5.1 (Anthropic): https://www.anthropic.com/claude-fable-and-mythos-5-1
- Claude Opus 5 overview (Claude Platform Docs): https://platform.claude.com/docs/en/models/opus-5/overview
- Token counting (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/token-counting
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
### Long Context Prompt Patterns for Claude
URL: https://claudecontext.com/long-context-prompts/
Description: How to structure long Claude prompts with source packets, XML sections, query placement, quote extraction, and token budgets.
Updated: 2026-07-06
Citation anchor: https://claudecontext.com/long-context-prompts/#cite-this-page
Sections:
- Build a source packet, not a paste pile: A source packet is a deliberate bundle of context. It names each document, gives provenance, includes timestamps, and separates content from instructions. That structure helps Claude distinguish evidence from task rules and reduces the chance that source text is accidentally treated as an instruction. For long tasks, put the source packet near the top, then put the user's question and output requirements after it. This keeps the model grounded in the data while making the actual task clear at the end.
- Use semantic sections: Anthropic's prompt guidance recommends XML-style tags for complex prompts. The exact tag names are less important than consistency and clarity. Use names that reflect the role of each block: ``, ``, ``, ``, ``, and ``.
- Ask for evidence before synthesis: For long-document work, ask Claude to identify the relevant source lines or short quoted phrases before writing the final answer. This is not about exposing hidden reasoning. It is about grounding the response in visible evidence and making it easier to detect when the wrong section drove the answer.
- Reserve output budget: Do not fill the entire window with input. The response itself needs room. If you expect a detailed report, reserve enough output capacity and shorten the input accordingly. Token counting should happen before the final request, especially when the source packet is built automatically.
FAQ:
- Q: Are XML tags required for Claude? A: No. They are a useful structuring convention. Clear Markdown sections can also work, but XML tags are explicit when prompts mix sources, examples, instructions, and user input.
- Q: Should I quote entire source documents into Claude? A: Only when the task needs full-document reasoning. Otherwise, use summaries, excerpts, retrieval, or MCP resources with provenance.
Sources:
- Prompting best practices (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
- Token counting (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/token-counting
### Context Engineering Templates
URL: https://claudecontext.com/templates/
Description: Reusable templates for Claude context packets, source packets, compaction handoffs, MCP resource inventories, and token-budget reviews.
Updated: 2026-09-19
Citation anchor: https://claudecontext.com/templates/#cite-this-page
Sections:
- Template 1: Context packet: Use this when a human or orchestrator needs to hand Claude a bounded task with clear source boundaries.
- Template 2: Source packet: Use this when accuracy depends on verifiable evidence. The point is to separate source metadata from interpretation.
- Template 3: Compaction handoff: Use this when a session is about to be compacted or handed to another agent. Preserve exact facts, unresolved risks, and next actions.
- Template 4: MCP resource inventory: Use this before adding MCP resources to an agent. It makes resource priority, sensitivity, and freshness explicit.
FAQ:
- Q: Can I paste these templates directly into Claude? A: Yes, but adapt them. Remove unused fields, keep source metadata current, and avoid adding structure that the task does not need.
- Q: Do templates replace evals? A: No. Templates make context clearer. Evals still determine whether the structure improves outcomes.
Sources:
- Prompting best practices (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
- Token counting (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/token-counting
- Context engineering: memory, compaction, and tool clearing (Claude Cookbook): https://platform.claude.com/cookbook/tool-use-context-engineering-context-engineering-tools
- Resources (Model Context Protocol Specification): https://modelcontextprotocol.io/specification/2025-06-18/server/resources
### Claude Context Freshness Log
URL: https://claudecontext.com/freshness/
Description: A dated source-watch page for Claude context engineering facts, model context windows, Claude Code context behavior, and MCP resource docs.
Updated: 2026-09-19
Citation anchor: https://claudecontext.com/freshness/#cite-this-page
Sections:
- September 19, 2026 source check: Two launches since the last check moved the numbers on this site. Claude Opus 5 shipped on July 24, 2026 and replaced Opus 4.8 as the current Opus. Claude Fable 5.1 shipped on September 1, 2026 and replaced Fable 5 as the flagship. Both are listed with 1M-token context windows, as is Claude Sonnet 5. Claude Haiku 4.5 remains at 200K. Prompt-cache pricing changed in a way that matters for context design. Fable 5.1 reads a cached prefix at $0.25 per million tokens, 2.5 percent of base input rather than the usual 10 percent. Opus 5 added a beta that lets tools change mid-conversation without invalidating the prompt cache. Sonnet 5 pricing did not change. The $2 / $10 rate announced as introductory through August 31, 2026 did not rise to $3 / $15 on September 1, and the site no longer shows a scheduled increase.
- July 6, 2026 source check: The first version of ClaudeContext.com checked current official sources for model context-window claims, token-counting caveats, prompt-caching TTLs, Claude Code memory behavior, Claude Code subagents, MCP resources, and the Claude MCP connector. The model overview was treated as the source of truth for current model context limits. Context-window behavior came from the Claude Platform context-window docs. MCP resource structure came from the 2025-06-18 MCP specification.
- Weekly watchlist: This page is the freshness surface required for the Claude Network. Future weekly updates should check the sources below and record what changed, what did not change, and which site pages were updated.
- Change-log format: Use a simple changelog entry: date, checked sources, changed facts, affected pages, and verification notes. If a source has not changed, say so explicitly. If a claim is uncertain, keep it off high-traffic pages until verified.
FAQ:
- Q: Why does a context site need a freshness page? A: Claude model specs, API behavior, and Claude Code features change. A freshness page gives users and AI crawlers a dated audit trail.
- Q: Can old pages remain indexed? A: Yes, but they should show an updated date and link to this log when facts are likely to drift.
Sources:
- Models overview (Claude Platform Docs): https://platform.claude.com/docs/en/about-claude/models/overview
- Claude Fable 5.1 overview (Claude Platform Docs): https://platform.claude.com/docs/en/models/fable-5-1/overview
- Claude Opus 5 overview (Claude Platform Docs): https://platform.claude.com/docs/en/models/opus-5/overview
- Claude Fable and Mythos 5.1 (Anthropic): https://www.anthropic.com/claude-fable-and-mythos-5-1
- Pricing (Claude Platform Docs): https://platform.claude.com/docs/en/about-claude/pricing
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
### Primary Sources for Claude Context Engineering
URL: https://claudecontext.com/sources/
Description: An annotated source index for Claude context-window facts, context engineering, prompt caching, Claude Code memory, subagents, and MCP resources.
Updated: 2026-09-19
Citation anchor: https://claudecontext.com/sources/#cite-this-page
Sections:
- How to use this source index: Use this page to verify the factual base behind ClaudeContext.com. The source index is intentionally narrow: official Anthropic and MCP sources are preferred over commentary. Third-party writing can be useful for interpretation, but it should not override current primary docs for model limits, API behavior, or Claude Code behavior.
- Which source answers which question: Use the model overview for current model comparison and context-window rows, and the Fable 5.1 and Opus 5 model pages when a claim is specific to one of those models. Use the context-window docs for what counts in context and when compaction is the primary strategy. Use token counting for preflight estimates. Use prompt caching for cache mechanics and the pricing page for cache read and write multipliers. Use Claude Code memory and subagent docs for Code-specific behavior. Use the MCP resources spec for resource semantics.
- Citation policy: Every article page includes a stable "Cite this page" block and a source list. When a fact is current and likely to drift, the page should include an updated date and point to the exact source used. If a page cannot verify a claim from a primary source, it should present the claim as interpretation or omit it.
FAQ:
- Q: Why not cite more blog posts? A: The site is designed for durable factual answers. Official docs are more appropriate for changing Claude API, Claude Code, and MCP behavior.
- Q: Can this source list change? A: Yes. The freshness page should record new source checks and any factual changes.
Sources:
- Effective context engineering for AI agents (Anthropic Engineering): https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
- Context windows (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/context-windows
- Models overview (Claude Platform Docs): https://platform.claude.com/docs/en/about-claude/models/overview
- Claude Fable 5.1 overview (Claude Platform Docs): https://platform.claude.com/docs/en/models/fable-5-1/overview
- Claude Opus 5 overview (Claude Platform Docs): https://platform.claude.com/docs/en/models/opus-5/overview
- Claude Fable and Mythos 5.1 (Anthropic): https://www.anthropic.com/claude-fable-and-mythos-5-1
- Prompting best practices (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
- Token counting (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/token-counting
- Prompt caching (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-caching
- Pricing (Claude Platform Docs): https://platform.claude.com/docs/en/about-claude/pricing
- Context engineering: memory, compaction, and tool clearing (Claude Cookbook): https://platform.claude.com/cookbook/tool-use-context-engineering-context-engineering-tools
- How Claude remembers your project (Claude Code Docs): https://code.claude.com/docs/en/memory
- Claude Code settings (Claude Code Docs): https://code.claude.com/docs/en/settings
- Create custom subagents (Claude Code Docs): https://code.claude.com/docs/en/sub-agents
- Resources (Model Context Protocol Specification): https://modelcontextprotocol.io/specification/2025-06-18/server/resources
- MCP connector (Claude Platform Docs): https://platform.claude.com/docs/en/agents-and-tools/mcp-connector
## Complete Source Index
- Effective context engineering for AI agents. Anthropic Engineering. Accessed 2026-07-06. https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents. Primary explanation of context engineering, context pollution, compaction, note-taking, and sub-agent architectures.
- Context windows. Claude Platform Docs. Accessed 2026-09-19. https://platform.claude.com/docs/en/build-with-claude/context-windows. Official context-window behavior, token accumulation, extended thinking and tool-use accounting, and compaction guidance.
- Models overview. Claude Platform Docs. Accessed 2026-09-19. https://platform.claude.com/docs/en/about-claude/models/overview. Current model comparison, including context-window and output limits listed by Anthropic for Fable 5.1, Opus 5, Sonnet 5, and Haiku 4.5.
- Claude Fable 5.1 overview. Claude Platform Docs. Accessed 2026-09-19. https://platform.claude.com/docs/en/models/fable-5-1/overview. Fable 5.1 model card: 1M-token context window, cheaper cache reads, and the breaking and additive behaviors relative to Fable 5.
- Claude Fable and Mythos 5.1. Anthropic. Accessed 2026-09-19. https://www.anthropic.com/claude-fable-and-mythos-5-1. September 1, 2026 launch announcement, including the 75 percent cache-read price reduction and its expected effect on agentic workloads.
- Claude Opus 5 overview. Claude Platform Docs. Accessed 2026-09-19. https://platform.claude.com/docs/en/models/opus-5/overview. Opus 5 model card: 1M-token context window, adaptive thinking, and the beta allowing mid-conversation tool changes without invalidating the prompt cache.
- Prompting best practices. Claude Platform Docs. Accessed 2026-07-06. https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices. Official guidance on clear instructions, examples, XML sections, long-context prompting, and tool-use prompting.
- Token counting. Claude Platform Docs. Accessed 2026-09-19. https://platform.claude.com/docs/en/build-with-claude/token-counting. Official endpoint guidance for estimating input tokens, costs, rate limits, and model routing.
- Prompt caching. Claude Platform Docs. Accessed 2026-09-19. https://platform.claude.com/docs/en/build-with-claude/prompt-caching. Official prompt-caching behavior, cache lifetime, prefix caching, usage fields, and invalidation patterns.
- Pricing. Claude Platform Docs. Accessed 2026-09-19. https://platform.claude.com/docs/en/about-claude/pricing. Official model pricing and prompt-caching multipliers for base input, cache writes, cache reads, and output tokens.
- Context engineering: memory, compaction, and tool clearing. Claude Cookbook. Accessed 2026-07-06. https://platform.claude.com/cookbook/tool-use-context-engineering-context-engineering-tools. Cookbook comparison of server-side compaction, context editing, tool-result clearing, and memory.
- How Claude remembers your project. Claude Code Docs. Accessed 2026-07-06. https://code.claude.com/docs/en/memory. Official explanation of fresh Claude Code sessions, CLAUDE.md, auto memory, and load behavior.
- Claude Code settings. Claude Code Docs. Accessed 2026-07-06. https://code.claude.com/docs/en/settings. Configuration categories, including memory files, settings, skills, MCP servers, and precedence.
- Create custom subagents. Claude Code Docs. Accessed 2026-07-06. https://code.claude.com/docs/en/sub-agents. Official subagent context-window behavior, scoped prompts, tool access, and context preservation.
- Resources. Model Context Protocol Specification. Accessed 2026-07-06. https://modelcontextprotocol.io/specification/2025-06-18/server/resources. Protocol definition for resources, resource templates, subscriptions, contents, and annotations.
- MCP connector. Claude Platform Docs. Accessed 2026-07-06. https://platform.claude.com/docs/en/agents-and-tools/mcp-connector. Official Claude API MCP connector behavior for remote MCP servers, OAuth, multiple servers, and tool access.