What to Do When Your Claude Code Context Window Is Full (Step-by-Step) A step-by-step guide recommends running /context to diagnose a full Claude Code context window, then /compact with instructions on what to keep for the same task or /clear for a new one. In the guide's test, one /compact cut a conversation from 282.1k tokens to 44.9k tokens while Claude continued the same bug, and a fresh session showed 32.6k tokens already used with only 10 tokens of messages. The guide notes current models (Fable, Sonnet 5 and later, Haiku 5.5, Opus 4.7 and later) have 1M-token windows, while Opus 4.6 and Sonnet 4.6 default to 200K unless the [1m] variant is selected, and that Anthropic's docs distinguish context warnings from usage limits. Quick answer: When the Claude Code context window is full, run /context to see what is filling it. If you’re staying on the same task, run /compact followed by what to keep, for example /compact keep the bug diagnosis and the planned fix. If you’re starting something unrelated, run /clear for a free, empty context. Fix a full context window in 5 steps: 1. Run /context to see how full the window is and what is filling it. 2. Still on the same task? Run /compact