Appearance
Text size
Typeface
Line spacing

Context and memory

The one budget that decides everything. CLAUDE.md, compaction, caching, and what a long session really costs.

6 chapters · 24 min

Start the course
  1. 1The context window is the one budgetEverything Claude knows in a session sits in one window, and most of it is read again on every turn. Managing what goes in is the main skill of long sessions.4 min
  2. 2What belongs in CLAUDE.mdCLAUDE.md is context that Claude reads, not configuration that Claude obeys. Write only what the code cannot tell it, keep it short, and move hard rules to hooks.4 min
  3. 3Rules that wait and memory that staysPath-scoped rules load only when a matching file is touched, and auto memory is notes Claude writes for itself. Each one has a different answer to the question of what survives.4 min
  4. 4What compaction keeps and what it losesCompaction swaps your history for a summary, then restores a few things by rule. Knowing which ones lets you steer it, and choose between /clear, /compact and rewind.4 min
  5. 5Prompt caching and what a long session costsClaude Code is fast and affordable in long sessions because the unchanged start of each request is cached. A few ordinary actions break that cache, and knowing them is most of cost control.4 min
  6. 6Choosing model, effort and fast modeModel, effort and fast mode are three separate dials. Each one changes what a turn costs and how long it takes, and two of them reset the cache if you turn them mid-task.4 min