CCA Domain 5 Study Guide: Context Management and Production Reliability
Research-verified study guide for Domain 5 — context as a design budget, context hygiene and retrieval, compaction and conversation state, reliability controls, observability, human review, scenario traps, and a seven-day plan.
Purpose and accuracy note
This guide treats context as a limited attention and cost budget, not merely a model maximum. It also covers the operational controls needed for dependable production systems. Anthropic’s public certification announcement does not publish domain percentages; rely on the current candidate guide or partner portal for authoritative weighting.
1. Context is a design budget
A large context window does not mean every available token should be filled. Extra content increases cost and latency and can reduce focus. Model limits also change over time, so architecture should query current model documentation and count tokens rather than rely on a memorized table.
Budget for:
- system instructions and tool definitions;
- conversation history;
- retrieved documents;
- tool results;
- thinking or reasoning configuration where applicable;
- the maximum expected output.
Reserve headroom for the answer and unexpected tool interactions. A request that technically fits can still fail its business objective if no output budget remains.
2. Context hygiene
Include information that is relevant, authoritative, and current. Remove duplicates, obsolete instructions, verbose logs, repeated schemas, and irrelevant conversation turns. Clearly label source, date, access scope, and trust level when those affect interpretation.
For large knowledge bases, use retrieval rather than inserting everything. Good retrieval combines:
- chunking aligned to semantic units;
- metadata filters for tenant, date, product, or jurisdiction;
- ranking or reranking;
- a small set of relevant passages;
- source identifiers for verification.
Chunk size is a trade-off. Tiny chunks lose surrounding meaning; enormous chunks waste context. Evaluate retrieval on realistic questions and measure answer correctness, source coverage, and irrelevant-token rate.
For long documents, structure content and instructions clearly and test where important evidence appears. Do not depend on simplistic folklore such as “always repeat instructions at both ends.” The robust solution is relevant retrieval, explicit organization, and evaluation across document positions.
3. Conversation state and compaction
Long-running agents accumulate tool results, intermediate reasoning, and stale plans. Use compaction or summarization to preserve durable facts while discarding expendable detail.
A useful compacted state records:
- user goal and acceptance criteria;
- decisions and their rationale;
- completed work and verification;
- unresolved blockers;
- stable identifiers and file paths;
- next safe action.
Do not summarize away exact values that will be needed later. Store durable state in files or databases when future sessions must recover it. Conversation history is not a substitute for a source of truth.
Tool results deserve the same discipline. Return small structured summaries, stable IDs, pagination cursors, or artifact references. Programmatic tool calling can filter and aggregate raw results before they enter Claude’s context.
4. Prompt caching
Prompt caching reduces repeated processing of a shared prompt prefix. Structure requests from stable to dynamic:
- stable system instructions;
- stable tool definitions;
- large shared reference content;
- request-specific conversation and user query.
Mark cache breakpoints according to the current API. Exact minimum cacheable lengths and model support vary, so confirm them in the current documentation. Anthropic currently documents a default five-minute cache lifetime and an optional one-hour lifetime. The five-minute lifetime refreshes when reused; use the longer option when request spacing or asynchronous batch work would otherwise miss the cache.
Caching improves latency and cost for repeated prefixes; it does not expand the context window and does not make dynamic or irrelevant content useful. A changed prefix can invalidate reuse, so avoid injecting request-specific timestamps or IDs before the cached section.
For batch processing, Anthropic notes that batches may take longer than five minutes and recommends the one-hour cache duration when requests share context. Measure cache reads and writes rather than assuming the layout is effective.
5. Reliability taxonomy
Classify failures before responding:
- client/request errors: invalid parameters or oversized requests; fix the request;
- authentication/authorization errors: correct credentials or access; do not blindly retry;
- not found/conflict: resolve identity or state;
- rate limits (429): honor Retry-After and retry with bounded backoff and jitter;
- overloaded/transient server errors, including 529: retry within a budget;
- timeout/network errors: retry only if the operation is idempotent or protected by a key;
- refusal or content-policy outcome: handle according to product policy, not as a transient outage;
- malformed or semantically invalid output: validate, then repair or retry with a bounded strategy.
Every retry consumes latency and capacity. Set maximum attempts, total deadline, per-attempt timeout, and a retry budget. Add jitter to avoid synchronized retry storms. Respect request IDs and retain them in diagnostics.
6. Stop reasons and response completeness
Inspect the API stop_reason. A response may end because it completed normally, reached max tokens, requested tool use, paused a server-tool turn, or refused. Do not treat every HTTP 200 response as a finished answer.
If output is truncated, continuation may be possible, but the application should protect against duplicated or corrupted structured content. For tool use, execute only validated complete inputs. For paused turns, follow the documented continuation flow. For refusals, present a safe product-level response.
7. Fallbacks and graceful degradation
Fallbacks should preserve the user’s core objective:
- live retrieval unavailable → use a labeled stale snapshot if policy permits;
- preferred model unavailable → use an approved alternate after compatibility testing;
- enrichment service unavailable → return the base result with an explicit limitation;
- long document exceeds a limit → retrieve/chunk and synthesize, not silently truncate;
- noncritical tool fails → continue without it and disclose reduced functionality.
Use circuit breakers when a dependency is repeatedly failing. Route to a fallback or fail fast during the open interval, then probe recovery. Queue asynchronous work when immediate completion is unnecessary. For side effects, pair retries with idempotency.
8. Validation and observability
Validate at several layers:
- transport: status, timeout, and complete stream;
- syntax: JSON/schema and field types;
- semantics: ranges, cross-field rules, source grounding;
- safety: policy and data-access controls;
- task quality: whether the user’s acceptance criteria were met.
Monitor request rate, input/output tokens, latency percentiles, timeouts, 429/5xx rates, retry counts, cache hit/read/write behavior, tool error rates, refusal rates, validation failures, cost per successful task, and end-to-end quality. Token efficiency without task success is not optimization.
Use structured logs and distributed traces with correlation IDs. Redact prompts, tool results, and personal data according to policy. Alerts should target user impact and sustained anomalies, not every isolated retry.
9. Deployment and data governance
Claude may be accessed through the direct API or supported cloud platforms. The architectural choice depends on identity integration, networking, procurement, regional availability, observability, feature parity, quotas, and data-governance requirements—not on a blanket claim that one route is always superior.
Verify feature availability per platform. New models, caching modes, tools, and retention terms may not appear everywhere simultaneously. Treat data retention and zero-data-retention eligibility as feature- and agreement-specific. Never put sensitive information in schema definitions; Anthropic notes that compiled schemas for structured outputs or strict tools have distinct caching considerations.
Document data flows: what is sent, where it is processed, what tools receive it, what is logged, how long it is retained, and who can access it. Apply data minimization before sending context.
10. High-frequency scenario traps
- Filling the entire context window because it exists. Relevance and output headroom matter.
- Memorizing one model-limit table as permanent. Verify current documentation and count tokens.
- Sending the whole knowledge base every time. Retrieve relevant passages.
- Caching dynamic prefixes. Put stable content first and dynamic content last.
- Assuming caching expands context. It only reuses processing of matching content.
- Using a five-minute cache for long asynchronous batches. Consider the documented one-hour option.
- Retrying every 4xx response. Most client/auth errors require correction.
- Ignoring Retry-After on 429 responses.
- Retrying non-idempotent writes without protection.
- Treating HTTP success as task success. Inspect stop_reason and validate output.
- Logging full prompts and secrets for observability. Redact and minimize.
- Choosing a deployment provider without checking feature parity and governance.
11. Rapid decision framework
- What information is necessary for this turn?
- What can be retrieved, summarized, filtered, or stored externally?
- Is there a stable shared prefix worth caching?
- What output headroom is required?
- What failure class occurred, and is retry safe?
- What fallback still meets the core objective?
- How will task success and data handling be measured?
12. Seven-day revision plan
- Day 1: Build token budgets for chat, RAG, and tool-using workflows.
- Day 2: Design a retrieval pipeline and evaluate chunk size, ranking, and citations.
- Day 3: Practice conversation compaction and durable-state handoff.
- Day 4: Refactor prompts for stable-prefix caching; compare five-minute and one-hour use cases.
- Day 5: Classify API failures and write bounded retry/idempotency policies.
- Day 6: Design fallbacks, circuit breakers, validation, metrics, and redacted tracing.
- Day 7: Compare deployment/data-governance scenarios and solve 20 mixed questions.
Final checklist
- I budget system, tools, history, retrieval, and output tokens.
- I can choose retrieval, compaction, external state, or caching appropriately.
- I know caching does not expand context and why prefix order matters.
- I distinguish retryable from non-retryable failures and honor Retry-After.
- I inspect stop_reason and validate syntax, semantics, safety, and task quality.
- I design idempotent fallbacks and graceful degradation.
- I evaluate provider feature parity, retention, identity, networking, and compliance.
Official sources
- Claude certification announcement: https://www.anthropic.com/news/claude-partner-network
- Prompt caching: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
- Context windows and model information: https://docs.anthropic.com/en/docs/build-with-claude/context-windows
- Batch processing: https://docs.anthropic.com/en/docs/build-with-claude/batch-processing
- Programmatic tool calling: https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/programmatic-tool-calling
- Rate limits: https://docs.anthropic.com/en/api/rate-limits
- API errors: https://docs.anthropic.com/en/api/errors
- Stop reasons and fallback: https://docs.anthropic.com/en/api/handling-stop-reasons
- API and data retention: https://docs.anthropic.com/en/docs/build-with-claude/zero-data-retention