Domain 5 · 15% of the exam · 9 questions

Context Management & Reliability: CCAR-F Study Guide

Everything the 15% domain tests, with a printable cheat sheet and practice questions.

Updated , checked against Anthropic's docs.

Take the 10-question quiz

Domain 5 at a glance

Weight
15%
Questions
~9 of 60
Pass line
720/1000
Study time
~25 min

Context Management & Reliability is the smallest domain on the exam. Scenarios with a cost spike, a lost thread or an error burst, where you pick the technique that fixes the real cause.

  • Context window management and what counts toward it
  • Prompt caching: breakpoints, TTLs, and cost multipliers
  • Compaction and context editing
  • Handling long conversations with summarization and memory
  • Escalation patterns and error propagation
  • Rate limits, retries with backoff, and overloaded errors
  • Observability and graceful degradation

The context window

The context window is everything the model can see in one request: the system prompt, tool definitions, every message, every tool result, and the output it generates. Output counts too, so a request with a nearly full prompt has little room to answer.

Most current models have a 200K-token standard window; a 1M window is available on some models and tiers as an opt-in, priced at a premium above 200K input tokens. Use the token counting endpoint to measure a request before you send it.

Anthropic's context engineering advice is to find the smallest set of high-signal tokens that gets the job done. More context is not better context; irrelevant tokens dilute attention.

On the exam, watch for "cached tokens do not count toward the window". They do; caching changes price, not size.

Prompt caching

Caching reuses a byte-identical prefix across requests. You mark the end of the reusable part with cache_control, and the cache key covers everything before it in this order: tools, then system, then messages. Any change earlier in that order (a new tool, a timestamp in the system prompt, a different model) is a cache miss.

Breakpoints and limits
RuleValue
Breakpoints per requestUp to 4 cache_control markers
Prefix ordertools, then system, then messages
LookbackThe system checks about 20 blocks back from a breakpoint for a hit
Minimum cacheable lengthModel-dependent (1,024 to 4,096 tokens on recent models; check the docs)
Below the minimumNot cached, billed as normal input, no error
TTL and cost multipliers (relative to base input price)
Operation5-minute TTL1-hour TTL
Cache write1.25x2x
Cache read (hit)0.1x0.1x
Break-even2nd request3rd request
  • Put volatile content (timestamps, user IDs, the latest question) after the last breakpoint.
  • Reads refresh the TTL, so steady traffic keeps a 5-minute entry warm.
  • The usage block reports cache_creation_input_tokens and cache_read_input_tokens; watch them to confirm hits.

Cache savings estimator

Cache TTL
Without caching
$3.87/hr
With caching
$0.70/hr
Saving
82%

Break-even: caching pays off from the 2nd call that reuses the prefix within one 5 minutes window (write 1.25x + reads at 0.1x vs paying 1x every time).

Compaction and context editing

TechniqueWhat it doesTrade-off
/compact [instructions]Claude Code summarizes the conversation and continues from the summaryLossy: details not in the summary are gone
Auto-compactRuns when the window nears fullSame loss, at a time you did not pick
Server-side compactionThe API summarizes older turns for long-running agentsLossy; configure what to keep
Context editing (clear tool results)Drops old tool results past a threshold, keeping the call recordInvalidates the cache from the edit point on
  • Tell /compact what matters: /compact keep the failing test names and the migration plan.
  • Constraints that must survive compaction belong in CLAUDE.md or a memory file, not only in chat.

Long conversations and memory

  • Rolling summaries keep a long chat inside the window; refresh them at milestones, not every turn.
  • The memory tool lets an agent write and read files that persist across sessions; your app stores them.
  • Just-in-time retrieval (keep references, fetch content when needed) beats loading the whole corpus up front.
  • Subagents isolate context: each explores in its own window and returns a condensed summary to the coordinator.
  • Placement matters: put long documents first and the question last.

Escalation and error propagation

A subagent that fails should say so in a structured way (what failed, why, what it tried, partial results) instead of returning an empty or invented answer. The coordinator then decides whether to retry, route around the failure or escalate to a human. Swallowed errors are the anti-pattern: they turn a visible failure into a silent wrong answer.

Rate limits and retries

StatusMeaningRetry?How
400Invalid requestNoFix the request
401 / 403Auth or permissionNoFix credentials or access
429Your rate limitYesWait for retry-after, then retry
500API errorYes, brieflyBackoff with jitter
529Overloaded (server-side)YesExponential backoff with jitter; consider a fallback model
  • The official SDKs retry 429 and 5xx with backoff by default; tune max_retries rather than wrapping another loop around them.
  • Retries must be idempotent. A retried tool call that sends an email or charges a card needs an idempotency key.
  • A circuit breaker stops hammering a dependency that is clearly down and fails fast until it recovers.

Observability and graceful degradation

  • Log usage on every call (input, output, cache creation, cache read) to catch cost regressions and cache misses.
  • Fall back to a smaller model on sustained overload, and say so in the response or logs.
  • Return partial results with a clear note instead of failing the whole job.

Symptom to technique

SymptomUseTempting wrong answer
High cost on a repeated long prefixPrompt cachingA bigger context window
Cache hit rate dropped to zeroMove the timestamp out of the system promptSwitch to the 1-hour TTL
Agent loses the thread in a long sessionCompaction with instructions, or durable notesRaise max_tokens
Burst of 529 errorsBackoff with jitter, then a fallback modelRetry immediately in a tight loop
Stale fact keeps resurfacingContext editing or a fresh session with a summaryRepeat the correction louder
Tool outputs flood the windowTrim results, clear old tool results, use subagentsLoad more context

Exam traps

Output counts

Wrong: Only input fills the window

Right: Input and output share it

A full prompt leaves no room to answer.

Cached still counts

Wrong: Cached tokens are free space

Right: They are cheaper, not smaller

Caching changes price only.

1M is opt-in

Wrong: Every model has 1M by default

Right: 200K standard; 1M is opt-in on some models

Defaults are tested.

Timestamps break caches

Wrong: Put the current time at the top of the system prompt

Right: Put it after the last breakpoint

Any byte change before a breakpoint is a miss.

/compact is lossy

Wrong: Compaction keeps everything

Right: It summarizes; guide it and store what must survive

Details outside the summary are gone.

Do not retry a 400

Wrong: Retry every error

Right: Retry 429, 500 and 529; fix 4xx requests

A bad request fails the same way every time.

429 vs 529

Wrong: Both mean you are over your limit

Right: 429 is your limit, 529 is server overload

Different causes, different handling.

Below the cache minimum

Wrong: The API errors if a prefix is too short to cache

Right: It silently does not cache

Check cache_creation_input_tokens.

One-page cheat sheet

Save this sheet in Claude Prep for offline review before exam day.

Get Claude Prep

Practice quiz: 10 Context Management & Reliability questions

Original, exam-style questions, one per task statement. Pick an answer to see the explanation. Finish all 10 for your score and your weakest topics. No signup.

0/10 answeredScore: 0
  1. Q1Context window definitionfoundation

    Which statement best describes what the context window represents for a Claude model?

  2. Q2Context window contentsfoundation

    When the Claude API processes a Messages request, which of the following counts toward the model's context window?

  3. Q3Context window sizesfoundation

    What is the context window size for Claude Opus 5.5 on the Claude API?

  4. Q4Token counting endpointfoundation

    Which API capability lets a developer measure how many tokens a prompt will consume before actually creating a message?

  5. Q5Diagnosing cache missesintermediate

    Repeated requests with an identical-looking system prompt keep returning cache_read_input_tokens of 0. The prompt begins with a header line 'Current date and time: {now}'. What is the cause?

  6. Q6/compact in Claude Codefoundation

    During a long Claude Code session refactoring a large module, a developer runs /compact. What does this command do?

  7. Q7Context engineering principlefoundation

    According to Anthropic's guidance on effective context engineering for agents, what is the guiding principle for deciding what belongs in an agent's context window?

  8. Q8Just-in-time contextintermediate

    To keep an agent's context lean, Anthropic's context-engineering guidance recommends what over front-loading all possibly relevant data?

  9. Q9Subagent summary returnadvanced

    In a research system, a subagent reads and processes 50 sources. To protect the orchestrator's context, what should the subagent return?

  10. Q10429 vs 529intermediate

    How should a client distinguish HTTP 429 from HTTP 529, and does handling differ?

Answer all 10 to see your score

You will get a score and your weakest topics. No signup.

Official sources

Every table on this page was checked against these Anthropic pages in October 2026. When a number here and the docs disagree, trust the docs.

All exam domains

FAQ

Context Management & Reliability: FAQ

How much of the CCAR-F is context management?+
Context Management & Reliability is 15% of the exam, about 9 of the 60 questions.
Do I need to memorize prompt caching prices?+
Know the multipliers (writes 1.25x for 5 minutes and 2x for 1 hour, reads 0.1x) and the break-even points. Exact per-model prices are less likely than the reasoning about when caching pays off.
Is the 1M context window on the exam?+
Expect to know that the standard window is 200K, that 1M is an opt-in on some models, and that long-context pricing applies above 200K input tokens.
Which errors should be retried?+
429 (after retry-after), 500 and 529 (with exponential backoff and jitter). 400-level request errors should be fixed, not retried.
How long should I study this domain?+
About 25 minutes for this page and the quiz. It is the smallest domain, but caching and retry questions are easy points if you know the tables.