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

Practical Strategies to Avoid Claude Rate Limits on $200 Max Plan
A developer shares specific techniques that have prevented throttling on Claude's $200 max plan for over a month, including SQLite database queries, context handoff systems, and strategic hardware deployment.

Claude Isn't Bad at Coding — Your Context Setup Is
After months of using Claude, one developer argues failures stem from how you structure context, not the model itself. Key improvements: separate instructions from logic, cut context noise, and use stable patterns.

Reddit user shares common Claude Code prompting mistakes with fixes
A developer using Claude for Node.js backend work identified 10 common prompting mistakes after months of use, including missing validation requirements and treating Claude as one-shot tool. They created a visual guide with fixes for each issue.

Llama.cpp prompt processing speed fix using --ubatch-size parameter
A user found that setting --ubatch-size to match GPU L3 cache size (64MB for Radeon 9070XT) dramatically improved prompt processing speed for larger models like Qwen 27B in Llama.cpp, making Claude code invocation usable.