Compaction Can’t Fix Context That Was Never in the Transcript: Diagnosing OpenClaw Context Overflows

✍️ OpenClawRadar📅 Published: August 3, 2026🔗 Source
Compaction Can’t Fix Context That Was Never in the Transcript: Diagnosing OpenClaw Context Overflows
Ad

A recent r/openclaw report highlights a critical distinction: context and conversation history are not the same thing. The user's session hit a compaction loop—"Compacting context (0 messages)"—because the model prompt already exceeded its budget before any conversation began. With ~34,500 characters of system prompt and only an 8,000-token budget, preflight estimated ~10,700 tokens. Compaction found no conversation messages to summarize, so each retry returned to the exact same overflow condition.

OpenClaw's context includes more than just chat turns. The full prompt packs in the system prompt, injected workspace files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md), skill metadata, tool definitions and schemas, tool calls/results, and attachments. Compaction only summarizes older conversation turns—if the dominant cost lives in the always-loaded system prompt, compacting an empty transcript will never reduce it.

Diagnose with Built-in Commands

Before switching models or tweaking compaction settings, inspect the actual context contributors:

/status
/context list
/context detail
/context map

Run /context map after at least one normal model run so it has a captured report to visualize.

Ad

Find the Real Culprit

Once you have the breakdown, act on the dominant category:

  • Conversation history dominates → compaction or pruning old tool results helps.
  • Injected workspace files dominate → remove duplicated instructions and move background reference material out of always-loaded files. Full skill instructions are designed to load on demand—don't keep them in injected files.
  • Tool schemas dominate → audit which tools that agent genuinely needs. Schemas consume context even though they're not visible as prompt text.
  • Base system prompt + reserved output budget already exceed usable model budget → changing the transcript is the wrong layer. This becomes a model-window, reserve-budget, or tool-surface problem.

Make Repairs Reversible

The author recommends an iterative approach that preserves your current configuration:

  1. Save your current setup.
  2. Change one contributor category at a time.
  3. Start a fresh session and repeat the same small task.
  4. Compare /context detail, Gateway compaction logs, and the actual task result before/after.

A lower token count isn't a success if the agent loses required instructions or tools. Verification requires all three:

  • Prompt fits the available budget
  • Compaction loop does not recur
  • The same bounded task completes correctly

Have you run /context detail? What actually dominates your OpenClaw context: workspace files, tools/skills, or conversation history? Share your findings in the thread.

📖 Read the full source: r/openclaw

Ad

👀 See Also