Original Reddit post

Two Anthropic lines that frame the whole problem: “Long sessions with irrelevant context can reduce performance.” ( source ) “If you’ve corrected Claude more than twice on the same issue in one session, the context is cluttered with failed approaches.” ( source ) Most “manage your context” advice stops at two tools: /clear (nuke everything) and /compact (summarize everything). Anthropic’s own Best Practices doc gives you four finer instruments between those extremes. Most users never try them. 1. /btw — the question that never enters context For quick side questions that don’t need to stay in history. Anthropic’s exact wording: “The answer appears in a dismissible overlay and never enters conversation history, so you can check a detail without growing context.” Use it for: “what does this flag do”, “is X function deprecated”, “is this idiom standard Python”. The kind of question you’d Google in a separate tab. Asking inline costs you context every time you don’t /btw . 2. /rewind with “Summarize from here” vs “Summarize up to here” Press Esc + Esc or run /rewind . Select a message checkpoint. Then choose direction: Summarize from here : condenses everything after that point. Keep early context (architecture decision, spec) intact, compress the messy debugging that followed. Summarize up to here : condenses everything before that point. Drop the setup noise, keep the recent precise state where you’re actually working. Surgical, not blunt. /compact always compresses all messages. Selective rewind keeps the half that’s still earning its tokens. 3. /compact <instructions> — direct the summary Default /compact lets Claude guess what’s important. You usually know better. Example straight from Anthropic’s docs: /compact Focus on the API changes, drop debugging history Anthropic’s stated reason: a manual /compact with focus “often beats passive auto-compact because you know the next direction and the AI doesn’t.” The compactor is doing inference under uncertainty. Telling it what’s next collapses the uncertainty. 4. Customize compaction in CLAUDE.md Most users don’t know /compact 's behavior is configurable via CLAUDE.md. Anthropic’s example: “When compacting, always preserve the full list of modified files and any test commands.” Drop that line in CLAUDE.md and every compaction respects it. Set the invariants once, stop re-typing them inside every /compact <instructions> call. When to reach for which Side question, won’t reuse → /btw Long debugging tail you want to forget → /rewind → Summarize from here Long setup you no longer need → /rewind → Summarize up to here You know exactly what the next step needs → /compact <instructions> Same preservation rule every session → CLAUDE.md compaction note All of the above failed, fresh start → /clear The pattern: /clear is admission you waited too long. The earlier tools you reach for, the cheaper your session stays. One anti-pattern Anthropic calls out by name “The kitchen sink session. You start with one task, then ask Claude something unrelated, then go back to the first task. Context is full of irrelevant information. Fix: /clear between unrelated tasks.” If you find yourself in this loop and the only tool you know is /compact , you’ll compact the same noise twice. The four tools above exist so the noise never accumulates in the first place. Sources Best practices for Claude Code — Anthropic Effective context engineering for AI agents — Anthropic Engineering How Claude remembers your project — Anthropic docs Explore the context window — Anthropic docs submitted by /u/lawnguyen123

Originally posted by u/lawnguyen123 on r/ClaudeCode