Compaction and project memory
Long sessions need three records: the goal (when enabled), the recent transcript, and compacted history. Compaction compresses older history instead of truncating it, keeping task-critical context.
Context compaction
Compaction has exactly three settings (settings → Models → Compaction, or config.yml):
- Threshold (
compaction.thresholdPercent; docs aliascompaction.threshold) — percent of the context window at which auto-compaction runs. Also on demand with/compact. - Type (
compaction.strategy; docs aliascompaction.type) — how history is compressed:handoff— writes a structured handoff summary that preserves the task, pending questions, and recent decisions, then continues from it. Best for long task continuity.snap— archives history via the snapcompact engine (dense image snapshot path).
- Model (
compaction.model) — the model that performs LLM compaction / handoff. Unset uses your interactive model. See Models, roles, and profiles.
/compact <focus> steers a run with an “Additional focus:” directive. Recent user messages are
retained verbatim up to the type’s budget.
Memory backends (built)
When memory.backend is mnemopi or local, compaction can request pre-compaction context
from the active memory backend so summaries retain project facts. See Memory.
Goals (partial)
Goal cards and budgets are implemented (/goal, /guided-goal).
Spec — not shipped: the richer goal-card verification ledgers described in Goal state and long sessions. The shipped card is the bounded objective + budget + status model.