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

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.
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:
- Save your current setup.
- Change one contributor category at a time.
- Start a fresh session and repeat the same small task.
- 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
👀 See Also

Using Project Narratives to Maintain OpenClaw Context on Long-Term Projects
A developer shares a technique for creating 'project narratives' where a separate OpenClaw worker analyzes the codebase after milestones to document system understanding, identify issues, and maintain context.

Practical Habits for Critical LLM Interaction
A Reddit post outlines specific techniques for avoiding confirmation bias when working with LLMs, including custom prompt modes like 'strawberry' for neutral explanation and 'socrates' for adversarial scrutiny, plus evaluating training data composition.

Agent Framework Token Bloat: A 500:1 Input-to-Output Ratio Is Normal
A self-hosted agent framework user reports ~21k input tokens per message and 500:1 input-to-output ratio from tool definitions, system prompt, and memory. Community confirms 15-25k baseline context is common for tool-using agents.

OpenClaw Debugs ESP32+CC1101 433 MHz Setup Using HackRF on Raspberry Pi 5
After failed attempts with direct GPIO and ESP32 flashing, OpenClaw used a HackRF to diagnose swapped Tx/Rx pins on the CC1101, finally getting autonomous 433 MHz signal capture and replay on a Pi 5.