← 返回
效率工具 中文

Context Doctor

Visualize and diagnose OpenClaw context window usage. Generates a terminal-rendered breakdown showing workspace files (status, chars, tokens), installed skil...
可视化并诊断 OpenClaw 上下文窗口的使用情况,生成终端渲染的分解图,展示工作区文件(状态、字符、令牌)以及已安装的技能...
jzocb
效率工具 clawhub v1.2.0 1 版本 99681.2 Key: 无需
★ 1
Stars
📥 1,856
下载
💾 41
安装
1
版本
#latest

概述

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/workspace or OPENCLAW_WORKSPACE env)
  • 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

SignalMeaningAction
-------------------------
🔴 TRUNCATEDFile exceeded max chars, silently cutReduce file size or split content
🟡 MISSINGFile not found or broken symlinkCheck path, fix symlink target
🟢 Bootstrap <10%HealthyNo action needed
🟠 Bootstrap >15%HeavyReview 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.

版本历史

共 1 个版本

  • v1.2.0 当前
    2026-03-28 22:26 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 445 📥 226,132
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,747
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 438 📥 147,251