# OpenClaw Compaction Configuration Update **Date:** 2026-04-21 **Status:** ✅ Applied **Scope:** All three agents (main/Wadsworth, Daedalus, Socrates) --- ## Summary Successfully configured OpenClaw to increase compaction threshold from ~20K to ~100K tokens per your revised directive. This maximizes context utilization for cloud-hosted agents while acknowledging the Sovereign Constraint (local-first architecture). --- ## Configuration Changes (CORRECTED) ### 1. Global Defaults (`agents.defaults.compaction`) ```json { "compaction": { "mode": "safeguard", "reserveTokensFloor": 28000, "reserveTokens": 28000, "keepRecentTokens": 15000, "recentTurnsPreserve": 6, "maxHistoryShare": 0.8, "memoryFlush": { "enabled": true, "softThresholdTokens": 5000 }, "postIndexSync": "async", "qualityGuard": { "enabled": false } } } ``` **Key Settings:** | Setting | Value | Effect | |---------|-------|--------| | `reserveTokensFloor` | 28000 | Compaction triggers at ~100K tokens (128K - 28K reserve) | | `reserveTokens` | 28000 | Ensures 28K tokens reserved for prompt generation | | `keepRecentTokens` | 15000 | Preserves 15K of most recent context during compaction | | `recentTurnsPreserve` | 6 | Keeps last 6 turns verbatim | | `maxHistoryShare` | 0.8 | Allows 80% of context for history (vs 50% default) | | `mode` | `safeguard` | Stricter guardrails to preserve recent context | **Result:** Compaction now triggers at ~100K tokens instead of ~20K.