Proactive context management to prevent overflow and improve session quality.
Every N turns, create a concise summary of recent work and update SESSION-STATE.md. This keeps the session lean while preserving important context.
ConditionActionEvery 15 turnsCreate rolling summaryAfter 10 consecutive tool callsForce summary (tool loop guard)Context >70% estimatedProactive summary + flush to memory
Update SESSION-STATE.md with a condensed view:
markdown
## Rolling Summary (as of HH:MM)
- Completed: [what was done]
- In progress: [what's being worked on]
- Decisions: [key decisions made]
- Blockers: [anything blocking]
- Next: [what to do next]
text
After completing a task or every 15 turns:
1. Read SESSION-STATE.md
2. Update the Rolling Summary section with current state
3. Keep it concise (under 500 chars total)
4. This prevents context overflow and preserves continuity
MetricBeforeAfter (target)Context overflow/week1-20Compaction timeout rate50%<20%Context lost per sessionHighLowAdditional LLM cost$0~$0.02/week
1.0.0 — Initial implementation