/install context-doctor
Context Doctor
Diagnose and visualize how the context window budget is allocated.
Quick Start
Run the visualization script:
python3 scripts/context-doctor.py
The script auto-detects:
- Workspace path (
~/.openclaw/workspaceorOPENCLAW_WORKSPACEenv) - OpenClaw version (via
openclaw --version) - Installed skills (system + workspace)
- Bootstrap file sizes and status
Output Sections
1. Workspace Files
Shows each bootstrap file with:
- Status: ✓ OK / ✗ MISSING / ⚠ TRUNCATED (symlink target missing = MISSING)
- Characters & Tokens: Raw size and estimated token count (chars/4)
- Visual bar: Proportional to file size
2. Installed Skills
Lists all discovered SKILL.md files from system and workspace skill directories. Skills are loaded on-demand, not in bootstrap — shown for awareness only.
3. Token Budget
Breaks down bootstrap overhead:
- System Prompt (framework)
- Workspace Files (from scan)
- Skills List (metadata descriptions)
- Tool Schemas + Summaries
Shows total bootstrap % vs free conversation space.
Diagnostic Signals
| Signal | Meaning | Action |
|---|---|---|
| 🔴 TRUNCATED | File exceeded max chars, silently cut | Reduce file size or split content |
| 🟡 MISSING | File not found or broken symlink | Check path, fix symlink target |
| 🟢 Bootstrap \x3C10% | Healthy | No action needed |
| 🟠 Bootstrap >15% | Heavy | Review workspace files for bloat |
Image Output (for chat / sharing)
Generate a PNG image directly — no terminal screenshot needed:
python3 scripts/context-doctor.py --png /tmp/context-doctor.png
The script renders a colored terminal-style image via Rich SVG export.
Requires: rich (pip3 install rich) + one of: rsvg-convert (brew install librsvg) or cairosvg (pip3 install cairosvg).
Agent workflow: When a user asks about context health in chat, run with --png and send the image directly. The output path is printed to stdout on success.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install context-doctor - 安装完成后,直接呼叫该 Skill 的名称或使用
/context-doctor触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Context Doctor 是什么?
Visualize and diagnose OpenClaw context window usage. Generates a terminal-rendered breakdown showing workspace files (status, chars, tokens), installed skil... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1926 次。
如何安装 Context Doctor?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install context-doctor」即可一键安装,无需额外配置。
Context Doctor 是免费的吗?
是的,Context Doctor 完全免费(开源免费),可自由下载、安装和使用。
Context Doctor 支持哪些平台?
Context Doctor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Context Doctor?
由 jzOcb(@jzocb)开发并维护,当前版本 v1.2.0。