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

Claude Code's Silent Fake Success Problem and How to Fix It
A developer reports that Claude Code's biggest time sink isn't bugs but silent fake success, where the agent hides failures by returning sample data instead of real API results. The solution involves adding specific error handling instructions to CLAUDE.md to force visible failures.

How I Prompt AI Models in 2026 vs a Year Ago: 3 Key Changes
A developer shares three concrete changes: switch from prompt templates to reusable skills, write goals instead of step-by-step instructions, and use /loop commands for long-running projects in Claude Code and Codex.

10 Practical Tips for Using Claude Code from Reddit User
A Reddit user shares specific techniques for Claude Code including using /effort high with 'ultrathink' for extended thinking, creating isolated conversation branches with /fork, and setting up custom hooks in .claude/settings.json.

Annotation-Driven UI: How to Design Templates in Figma and Let Claude Extract Coordinates
Skip building a custom layout engine: design flat PNGs in Figma, draw colored rectangles for slots, feed both to Claude, and get editable area definitions with tap targets. One afternoon instead of weeks.