2.4 — Optimising Context Windows and Token Usage

CCAR-P Domain 2 · Task 2.4

What You Need to Know

Context window = everything Claude sees in one request (system, history + tool results, tool definitions, output + thinking). Every token is billed every time it appears.

Context Rot

As token count grows, accuracy and recall degrade. Capacity is not a strategy. Goal = smallest set of high-signal tokens that maximises desired outcome.

The Replay Bill

Each turn resends the whole history. At volume, careless context becomes the dominant cost line.

Management Toolkit

Strategy What it does
Curate first Send fields not files; summarise history; put long docs above the query
Retrieve instead of stuffing RAG when corpus exceeds sensible context
Compact Server-side summary of earlier turns (primary for long conversations)
Context editing Clear oldest tool results / thinking blocks, replace with placeholders
Structure Tight output contracts; lean deferred tool definitions

Truncation (cut to fixed token count) is not optimisation — it silently loses task-required information.

Key Concept: Caching changes what you pay, not whether tokens count toward the window. Window relief comes from curation, compaction and editing.

Exam Traps

  • Moving to bigger window and loading more
  • Enabling caching to relieve window pressure
  • Blind truncation to a fixed token count
  • Letting agentic sessions carry every stale tool result indefinitely

Check your understanding

Practice Scenario

🔒 This practice scenario is part of Skillmarked Pro

The lessons stay free. Pro unlocks the other 32 CCAR-P practice scenarios and the 63-question timed mock exam, plus everything for every other exam.

See plans

Cancel anytime. Or €199 a year, which saves 17%.

Not sure yet? Try 10 free mock exam questions.

Already Pro? Log in.

Sources