Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.
中文简介正在准备中。当前显示原文说明。
Token-range severity zones (Green/Yellow/Orange/Red/Critical) with detection checklist, early warning indicators, and corrective routing actions for context window degradation
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Detects context window degradation and prescribes corrective actions before accuracy drops.
Thresholds are expressed as a percentage of the context window budget. For a 200K window, Claude Code's auto-compact fires at ~187K (~93.5%, i.e., contextWindow - 13K).
| Zone | Usage % | ~Tokens (200K) | Status | Action |
|---|---|---|---|---|
| Green | < 65% | < 130K | Healthy | Normal operation |
| Yellow | 65–80% | 130K–160K | Caution | Begin selective compression |
| Orange/Red | 80–90% | 160K–180K | Warning | Compress aggressively; summarize completed phases; spawn fresh subagent if needed |
| Critical | 90–93% | 180K–186K | Severe | Halt complex reasoning; compress immediately; do not attempt multi-step tasks |
| Auto-compact | > 93% | > 186K | Imminent | Claude Code auto-compact will fire; initiate post-compact recovery (see below) |
Reference: Claude Code constant AUTOCOMPACT_BUFFER_TOKENS = 13,000. Auto-compact fires at contextWindow - 13K, so for a 200K window that is 187K (93.5%). "Lost in the middle" effect: middle tokens have 20–40% lower recall past ~100K.
Symptoms that context degradation is affecting output quality (regardless of token count):
If 2+ indicators are present, treat as one zone higher than token count suggests.
Yellow (65–80%):
Skill({ skill: 'context-compressor' }) at the current phase boundaryOrange/Red (80–90%):
Skill({ skill: 'context-compressor' }) — aggressive summarization.claude/context/tmp/phase-summary-{date}.mdCritical (90–93%):
Auto-compact (>93%):
session-handoff skillSkill({ skill: 'session-handoff' }) before context window forces truncation[ ] Usage < 65%? → Green, no action
[ ] Usage 65–80%? → Yellow, begin compression
[ ] Usage 80–90%? → Orange/Red, compress aggressively
[ ] Usage 90–93%? → Critical, spawn fresh agent
[ ] Usage > 93%? → Auto-compact imminent; initiate post-compact recovery
[ ] 2+ early warning indicators? → Upgrade one severity zone
[ ] Compression reminder file exists? → Invoke context-compressor immediately
When Claude Code's auto-compact fires (or a microcompact is detected), the context has been silently truncated. Follow these steps to restore working state:
activeFiles list (stored in .claude/context/runtime/pre-compact-snapshot.json). This restores the in-memory view of code you were editing..claude/context/runtime/edit-counter.json and current task files to confirm what was completed before compaction and what remains.microcompact-detected event in the flight recorder (.claude/context/runtime/flight-recorder.jsonl). If present, a silent compaction occurred without a PreCompact hook event; treat your current context as potentially incomplete..claude/context/runtime/pre-compact-snapshot.json to recover originalIntent, editCount, correctionCount, and the list of activeFiles written just before compaction.These steps ensure that after a compaction event (auto or silent), you resume with full knowledge of where you left off.
context-compressor, context-compressor, session-handoffplanner (at plan start), developer (after each phase), router (before large spawns)context-compressor at Yellow zone (65–80%) before context bloat becomes severe — prevention is cheaper than recovery.| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Waiting until output quality degrades before checking context | By the time quality drops, the context is already in Red/Critical zone | Run detection checklist at every phase boundary proactively |
| Continuing multi-step tasks past 90% usage (Critical zone) | "Lost in the middle" effect causes 20–40% recall drop; decisions made early are forgotten | Spawn fresh subagent at Critical zone (90%) with compressed context |
| Ignoring early warning indicators because token count looks fine | Indicators are more reliable than raw token counts; a 30K session with 3 indicators is already Yellow | Treat 2+ indicators as one zone higher regardless of token count |
| Spawning a subagent without a written handoff document | Subagent starts from scratch, duplicating work or missing constraints | Always write phase summary to .claude/context/tmp/ before spawning |
| Compressing context by deleting tool call results without summarizing | Compression without summarization loses critical findings from earlier phases | Summarize completed phase outputs before pruning raw tool results |
Before starting:
Read .claude/context/memory/learnings.md
After completing:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: If it's not in memory, it didn't happen.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.
中文简介正在准备中。当前显示原文说明。
Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.
中文简介正在准备中。当前显示原文说明。
N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.
中文简介正在准备中。当前显示原文说明。
Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze
中文简介正在准备中。当前显示原文说明。
Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.
中文简介正在准备中。当前显示原文说明。
LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations
中文简介正在准备中。当前显示原文说明。