Visualize and diagnose your OpenClaw context window usage.
One command to see what's eating your tokens, which files are healthy, and how much room you have left for actual conversation.
clawhub install context-doctorOr clone this repo into your workspace skills directory:
git clone https://github.com/jzOcb/context-doctor.git ~/.openclaw/workspace/skills/context-doctorpython3 scripts/context-doctor.pypython3 scripts/context-doctor.py --png /tmp/context-doctor.pngRequires: rich (pip3 install rich) + rsvg-convert (brew install librsvg) or cairosvg (pip3 install cairosvg)
python3 scripts/context-doctor.py --json| Flag | Description |
|---|---|
--workspace PATH |
Custom workspace path (default: auto-detect) |
--ctx-size N |
Context window size in tokens (default: 200000) |
--png PATH |
Output as PNG image |
--json |
Output structured JSON |
--no-color |
Disable ANSI colors |
Each bootstrap file with status, character count, and token estimate:
- β OK β file loaded normally
- β TRUNCATED β file exceeds limit, instructions silently cut
- β MISSING β file not found or broken symlink
All discovered skills from system, workspace, and global directories. Skills are loaded on-demand (not in bootstrap), shown for awareness.
How your context window is split:
- System Prompt (framework)
- Workspace Files
- Skills List (metadata)
- Tool Schemas + Summaries
- Free for conversation
| Signal | Meaning |
|---|---|
| π’ <10% | Healthy β plenty of room |
| π‘ 10-15% | Moderate β consider trimming |
| π΄ >15% | Heavy β agent loses context early |
When installed as a skill, your OpenClaw agent can automatically run context-doctor when you ask about context window health. With --png, the agent generates and sends the visualization directly in chat β no terminal needed.
MIT
