Auto-Compact
When your conversation approaches the AI model’s context window limit, Kodik automatically summarizes it to free up space and continue working. You can also trigger summarization manually with the /compact command.
How It Works
Section titled “How It Works”Kodik tracks token usage throughout your conversation. Auto-summarization fires in two situations:
- Proactively — when the estimated token count exceeds ~70% of the model’s context window.
- After inactivity — when the Anthropic cache has expired (more than 5 minutes since the last message) and the conversation is long enough.
When triggered:
- Kodik summarizes the older portion of the conversation history, keeping the last user message and everything after it intact.
- Stale tool results in the retained messages are replaced with
[Old tool result content cleared]to reclaim additional space. - The history is replaced with a summary pair: a “What did we do so far?” question and an assistant response containing the summary.
What the Summary Preserves
Section titled “What the Summary Preserves”The summary is generated from a fixed template and always includes:
- Goal — single-sentence task description
- Constraints & Preferences — user requirements and preferences
- Progress — completed work, in-progress items, blockers
- Key Decisions — technical decisions and their rationale
- Next Steps — ordered next actions
- Critical Context — important technical facts, errors, open questions
- Relevant Files — file paths and why they matter
Summarization Provider
Section titled “Summarization Provider”Kodik attempts to generate the summary via the Kodik API. If that fails, it automatically falls back to the active model configured in the extension. When using Ollama, summarization is performed directly through the local instance.
Manual Summarization: /compact
Section titled “Manual Summarization: /compact”To compress the conversation at any time, use the /compact command. It immediately summarizes the full history without waiting for a token threshold. See the slash commands overview for details.
Checkpoints and Recovery
Section titled “Checkpoints and Recovery”Kodik saves checkpoints during its work. If summarization has occurred, you can roll back to the state before it through a checkpoint. This means you never truly lose context — you can always return to an earlier version of your conversation.