From evanflow
Manages long-session context to prevent drift and degradation via proactive summarization, branch isolation, and compaction strategies. Invoke when context feels heavy, accuracy slips, or after a major phase boundary.
How this skill is triggered — by the user, by Claude, or both
Slash command
/evanflow:evanflow-compactThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Why this exists:** Context drift kills agents before context limits do. Industry research found ~65% of enterprise AI failures in 2025 traced to context drift or memory loss in multi-step reasoning, NOT raw token exhaustion. The agent's ability to reason degrades as context fills with stale, redundant, or contradictory information — long before the hard token limit.
Why this exists: Context drift kills agents before context limits do. Industry research found ~65% of enterprise AI failures in 2025 traced to context drift or memory loss in multi-step reasoning, NOT raw token exhaustion. The agent's ability to reason degrades as context fills with stale, redundant, or contradictory information — long before the hard token limit.
See evanflow meta-skill. Specific to this skill:
Trigger this skill when ANY of these are true:
SKIP when: the session is short, focused, and progressing without drift symptoms. Compaction has cost (loses fidelity); only invoke when the cost of NOT compacting is higher.
When a major phase just finished cleanly:
## Phase Summary (compaction anchor). Include:
/clear and re-orient from this summary + the saved memory."/clear, then start the next phase fresh with the summary in front of them./clearWhen the session is heavy and the next move is unclear:
~/.claude/projects/<project>/memory/*.md) as appropriate types (user / feedback / project / reference).<files>. Recommend /clear and re-engage fresh."When a side-quest emerges that's unrelated to the main thread:
<main thread>. Recommend handling it in a fresh session — your context will stay clean and the side-quest gets full attention."When drift symptoms appear and you can't reach a clean boundary:
This is less effective than proactive compaction — use only when needed.
Watch for these. Each is a signal to consider compaction:
If 2+ symptoms in the last few turns, invoke this skill.
/clear or summary swap. Lost context that was assumed-saved is the worst failure mode./clear./clear. Like commits, this is a user-controlled action. The skill recommends; the user does./clear → the user runs /clear, then re-engages from the saved anchor + memoryevanflow-improve-architectureevanflow-brainstorming or evanflow-writing-plans as appropriatenpx claudepluginhub evanklem/evanflow --plugin evanflowMonitors context window health during multi-step agent tasks to ride peak quality for high-fidelity output and prevent drift in long-running sessions or complex refactors.
Teaches the four operations of context engineering — Write, Select, Compress, Isolate — for managing token budgets, compaction strategies, and context partitioning to keep AI sessions sharp and efficient.
Suggests manual /compact at logical intervals (e.g., after research, before implementation) to preserve context through task phases. Activates when context pressure builds or after milestones, using a hook script to track tool calls.