Context & Reasoning
Manage what goes into the context window and get maximum reasoning out of it — the engineers who master both stop hitting walls.
Your context window is a finite resource that starts draining before you type a word. Understanding what loads at startup, what accumulates per turn, and how the 1M window changes the math is the foundation of every context engineering decision.
.claudeignore stops files from auto-loading into context during Claude's tool searches. One well-tuned file can cut your working context by 30–40% on the first search.
Compaction is a one-way door. Understanding exactly what survives — and what doesn't — determines whether you lose critical context or walk away clean.
Three commands for managing a degrading session — each with a different cost, a different loss profile, and a different use case. Choosing the wrong one compounds the problem.
The primary reason to use subagents isn't parallelism — it's keeping investigation noise out of your main context window. A subagent that reads 20 files returns a 200-token summary instead of 20,000 tokens inline.
Not every question needs to live in the main conversation thread. Side channels let you get answers, extract results, and inject background context without polluting the session that matters.
Claude Code's prompt cache keeps the stable portion of your context cheap to re-send. Two environment variables control the TTL — and choosing the wrong one can cost you significantly on long sessions.
Long sessions degrade. The file path assumptions get fuzzy, earlier instructions fade, and Claude starts contradicting decisions it made an hour ago. These practices prevent that — or help you recover when it happens anyway.
Extended thinking gives Claude a scratchpad to reason before responding. The thinking budget ladder goes from 'think' to 'ultrathink' — and knowing where on that ladder your problem lives is the difference between a great answer and an expensive one.
Extended reasoning is most valuable on a specific class of problems. Understanding which ones — and which ones don't benefit — prevents expensive waste and unlocks the cases where ultrathink genuinely changes the outcome.
Effort levels are a session-wide reasoning depth control — separate from ultrathink's per-prompt override. Opus 4.7 introduced xhigh as the new default, sitting between high and max. Understanding the five levels prevents both under-spending on hard problems and over-spending on easy ones.