This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Repository navigation
v1.2.10.55
Rewrite both the system prompt (compaction.txt) and the inline user message template (compaction.ts defaultPrompt) to produce compaction output that enables an AI agent to resume complex work after a full context wipe. ## System prompt (compaction.txt) Reframed from summarization to memory transfer. The model is told its context is about to be wiped and everything not written down will be lost. Preservation rules are direct commands, not conditionals: - PRESERVE resolved code verbatim — query patterns, state machines, auth flows, data model behaviors, correct field names, API response shapes. Do not describe code that you can show. - INCLUDE failed approaches numbered for cross-cycle reference - PRESERVE user directives as sacred, accumulating across cycles - PRESERVE credentials and operational details - RESOLVE implementation contradictions to settled state - DISCARD debugging noise, narration, superseded work, trivial code ## Inline template (compaction.ts defaultPrompt) Expanded from 5 sections to 8, structured around what an agent needs most when told to continue with no prior context: 1. Objective — immediate next action, current blockers 2. User Directives — separated from task instructions, accumulate 3. Plan — remaining steps, enough detail to pick up mid-step 4. Failed Approaches — exhaustive, numbered, highest-value section 5. Resolved Code & Discoveries — verbatim code blocks and patterns that would be painful to rediscover 6. How Things Work Now — settled system state as direct instructions 7. Accomplished — completed, in-progress, remaining as direct facts 8. Relevant files / environment — modification status, credentials, credential sync locations, endpoints, service ports ## Approach Developed through iterative testing against a long-running multi- compaction session, comparing output quality at each step. Key phrasings were refined based on measurable differences in what the model chose to preserve or discard — particularly around verbatim code inclusion, failed approach depth, and credential capture.