Summary
Two complementary mechanisms to improve context survival across compaction events:
- Checkpoint: Before compaction, parse session transcript and extract structured state
- Steering prompt: Inject guidance text during PreCompact to bias what gets preserved
Key Features
Checkpoint
- PreCompact hook extracts structured markdown checkpoint from session state
- SessionStart hook (compact matcher) reinjects checkpoint post-compaction
- Sections: Active Task, Key Decisions, Modified Files, Open Questions, Error Context, Agent State
Steering Prompt
- Zero-LLM-cost echo in PreCompact hook
- Biases compaction: "Preserve code changes, key decisions, and file paths. Discard intermediate attempts."
- Dynamic project-aware
compactInstructions generation for settings.json
Competitive Reference
Ref: SIEVE — measure.py:11674-11815 (compact_capture/restore), hooks.json:36-39 (steering echo), measure.py:12026-12071 (generate_compact_instructions).
Implementation Notes
- Extends existing
pre-compact-memory hook which already saves git state
- Steering prompt is trivial: add echo line to existing hook
- Checkpoint extraction extends the WORKING-MEMORY.md pattern
- Consider dynamic
compactInstructions generation based on active orchestration intent
Milestone
post-v2
Summary
Two complementary mechanisms to improve context survival across compaction events:
Key Features
Checkpoint
Steering Prompt
compactInstructionsgeneration for settings.jsonCompetitive Reference
Ref: SIEVE —
measure.py:11674-11815(compact_capture/restore),hooks.json:36-39(steering echo),measure.py:12026-12071(generate_compact_instructions).Implementation Notes
pre-compact-memoryhook which already saves git statecompactInstructionsgeneration based on active orchestration intentMilestone
post-v2