The Correct Way to Handle Claude Code Context: Avoid the Longer the Session, the 'Dumber' the Model
Anthropic has introduced a new /usage command for Claude Code, coinciding with its expanded 1 million token context window. This update addresses a key challenge: context rot, where model performance degrades as the context grows, due to attention dilution across excessive tokens.
The article emphasizes strategic context management through five key actions: Continue, Rewind, Clear, Compact, and Subagents. It advises starting new sessions for new tasks but retaining relevant context for related work. The Rewind feature (double Esc or /rewind) is highlighted as a superior method for error correction, allowing users to revert and re-prompt from a specific point.
Compaction (/compact) summarizes conversation history into a concise summary, though it can fail if the model misjudges future task relevance. In contrast, /clear requires manual summarization for a fresh start. Subagents are recommended for tasks generating disposable intermediate outputs, as they operate in isolated contexts and return only final results.
The core recommendation is to proactively manage context—especially before model performance declines—to maintain high-quality outputs with Claude Code.
marsbit7 ч. назад