/session:context-checkfrom session
Checks context window usage via /context command and recommends actions (compact, clear, subagent, handoff) based on usage thresholds to prevent quality degradation.
Ships in session. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Purpose: proactively assess context and recommend the right action before quality degrades.
Claude cannot run /context itself because it is a built-in command only the user can invoke. Ask the user:
Need to run
/contextin the terminal and send back the output (% and breakdown).
After the user sends /context output, analyze it per the steps below.
Source for % thresholds (multi-author, verified):
<30/<40/60%+ "dumb zone": Dex Horthy at MLOps Community (2026-03-24)300-400k tokenscontext rot (1M model): Thariq Shihipar (Anthropic Claude Code team) via howborisusesclaudecode.com155k tokensauto-compact (200k window): Boris Cherny X tweet~95%auto-compact trigger (official): Claude Code sub-agents docs §Auto-compaction — "auto-compaction triggers at approximately 95% capacity"; lower it withCLAUDE_AUTOCOMPACT_PCT_OVERRIDE.- Full citations + nuance by task complexity: docs/REFERENCE.md §16. Apart from the ~95% auto-compact trigger, Anthropic does not publish official % thresholds for the zone/quality bands below.
| % context | State | Recommended action |
|---|---|---|
<30% | 🟢 Aggressive zone | Target for experienced users |
30-40% | 🟢 Sweet spot | Newcomer target — "shoot to keep it under 40%" (Dex) |
40-60% | 🟡 "Dumb zone" begins | Performance degrading — plan to wrap up current phase |
60-77% | 🟠 Wrap up actively | /compact OR /handoff → /clear + new brief |
~77% | 🔴 Critical zone (Boris claim 155k) | Compact proactively — official auto-compact triggers ~95% (CLAUDE_AUTOCOMPACT_PCT_OVERRIDE to lower), but quality degrades here |
>90% | ⛔ Hard limit | STOP large task immediately, brief + new session |
/context breaks output down by group (system, memory/CLAUDE.md, skills, MCP tools, conversation, file content). Find any group consuming unusually high context:
| High-consuming group | Cause | How to reduce |
|---|---|---|
| Memory (CLAUDE.md + rules) >10% | CLAUDE.md / rules too long | Prune them, move less-used sections to REFERENCE.md |
| MCP tools >15% | Too many MCP servers enabled, not used | claude mcp list then disable those not needed for this session |
| Skill descriptions >5% | Too many auto-discovered skills | Set disable-model-invocation: true for rarely used skills |
| Conversation history >40% | Lots of tool output / dead-end paths | /compact now |
| File content >25% | Too many large files @-referenced | /clear + only reference files that are needed |
Give 1 main recommendation with a reason — do NOT list 5 options for user to choose from:
Example output:
Context is at 73%. Conversation history occupies 45% — mostly from long tool output in a previous debug session. Recommendation: run
/handoffto capture key decisions in 5 lines, then/compact keep the brief, drop debug logs. Then continue the current task in this session. Estimated context after compact: ~25%.
/compact vs /clearWhen to use /compact | When to use /clear |
|---|---|
| In the middle of a task, need to keep thread | Finished a task, moving to a completely different one |
| Important decisions and file paths must survive | History is not needed |
| Context 40-60% ("dumb zone") | Context >77% (auto-compact zone) or session is muddled |
| Many dead-end debug paths to clean up | Committed and done, starting a new feature |
Golden rule: /compact = compress, /clear = wipe entirely. Confusing /clear with /compact = losing context that must be re-explained. Confusing /compact with /clear = carrying garbage into the new task.
Symptoms:
Internal server error / ECONNRESET / "Chat has reached its limit".→ Do NOT /compact (compacting dirty context = continuing dirty). Must:
/handoff --save (or copy-paste brief externally)./clear or exit and open a new session.~/.claude/CLAUDE.md periodically (monthly): remove lines no longer needed.use a subagent to investigate ...) to keep main context clean.npm test > /tmp/test.log 2>&1 && tail -50 /tmp/test.log.What SKILL.md sets; muted values are Claude Code's defaults
inheritnpx claudepluginhub minhthang1009/dotclaude --plugin session2 skills in this plugin
Other plugins' skills for the same job