Files
clawdbot/docs/compaction.md
2026-01-13 05:55:30 +00:00

1.1 KiB

summary, read_when
summary read_when
Compaction modes and configuration
You want to configure compaction summarization behavior
You are tuning compaction settings in clawdbot.json

Compaction

Compaction summarizes older session history so the conversation stays within the model context window. The summary is stored in the session JSONL history and combined with the most recent messages.

Modes

agents.defaults.compaction.mode controls how summaries are generated.

  • default (default): use the built-in compaction summarizer.
  • safeguard: uses a chunked summarization pass to avoid context overflow for very long histories. If chunked summarization fails, Clawdbot falls back to a minimal summary plus file-operation metadata.

Configuration

{
  agents: {
    defaults: {
      compaction: {
        mode: "safeguard",
        reserveTokensFloor: 20000,
        memoryFlush: {
          enabled: true,
          softThresholdTokens: 4000
        }
      }
    }
  }
}