Context Management & Reliability

15% of the CCAR-F exam. Read each answer, then drill this domain.

Drill this domainAll study notes

Why does context need managing even with a very large window?

The context window holds everything the model sees, including tool outputs and files. As it grows, quality drops (context rot) and cost rises. Keep only what is load-bearing: rewind failed attempts, compact or clear when the session is stale, and send noisy side work to subagents.

Source: Anthropic: Session management and 1M context

When should you continue, rewind, compact, clear or use a subagent?

Continue when the context is still relevant. Rewind when Claude went down a wrong path. Compact mid-task when the session is bloated, steering what to keep. Clear for a genuinely new task, with a short brief you write. Use a subagent when you'll only need the conclusion.

Source: Anthropic: Session management and 1M context

How do you keep the prompt cache working?

Put stable content (tools, system prompt) first and the growing conversation after it. Keep timestamps and IDs out of the prefix, don't reorder tools or change effort mid-conversation, defer rarely used tools, and avoid waits longer than the cache lifetime. Watch the cache hit rate.

Source: Anthropic: Reducing cost and improving performance

How does an agent stay reliable over long tasks?

Externalise state: progress files, notes and decisions that each new window or run reads first. Make actions idempotent so retries can't cause duplicate effects, and back up transcripts before compaction for review.

Source: Anthropic: Building always-on agents

Drill this domain