Skip to content

Compaction checkpoint and steering prompt #186

@dean0x

Description

@dean0x

Summary

Two complementary mechanisms to improve context survival across compaction events:

  1. Checkpoint: Before compaction, parse session transcript and extract structured state
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions