Context Visualization
/install context-viz
Context Visualization
Estimate and display a breakdown of the current context window usage.
How It Works
Run the bundled script to estimate token counts for workspace files:
python3 scripts/estimate_tokens.py /path/to/workspace
The script counts characters in known workspace files and estimates tokens (~4 chars/token).
Then call session_status to get the actual context usage from OpenClaw.
Generating the Visualization
- Run
session_statusto get: model, context used/total, compactions - Run
scripts/estimate_tokens.py \x3Cworkspace_path>to estimate file token sizes - Estimate message tokens:
context_used - system_overhead - file_tokens - Present the breakdown using the format below
Output Format
Use a monospace block with bar chart. Adapt the bar lengths proportionally.
📊 Context Usage
\x3Cmodel> • \x3Cused>k/\x3Ctotal>k tokens (\x3Cpct>%)
Component Tokens %
─────────────────────────────────────────────
⚙️ System prompt + tools ~Xk X% ░░
📋 AGENTS.md ~Xk X% ░
👻 SOUL.md ~Xk X%
👤 USER.md ~Xk X%
🔧 TOOLS.md ~Xk X% ░
💓 HEARTBEAT.md ~Xk X%
🧠 MEMORY.md ~Xk X% ░
🪪 IDENTITY.md ~Xk X%
💬 Messages ~Xk X% ░░░░░░░░░░░░
📭 Free space ~Xk X% ░░░░░
─────────────────────────────────────────────
Use ░ blocks: 1 block per ~2% of total context. Round to nearest block.
Memory Inventory (not in context)
Below the context chart, add a Memory on Disk section showing what's stored in memory/ — grouped by category. These files are NOT loaded into context but represent the agent's total knowledge base.
💾 Memory on Disk (not in context)
Category Files Tokens Size
──────────────────────────────────────────────────
📰 chinese-ai-digests 12 ~23k 92KB
📁 other 11 ~12k 46KB
📅 daily-notes 9 ~5k 17KB
🗃️ zettelkasten 8 ~4k 15KB
💼 linkedin 2 ~1k 5KB
──────────────────────────────────────────────────
Total: 42 ~44k 177KB
The script auto-categorizes files by directory or filename pattern.
Notes
- Token estimates use ~4 chars/token (rough average for English/mixed content)
- System prompt + tools overhead is estimated at ~8-10k tokens for a typical OpenClaw setup
- Message tokens are the remainder after subtracting files + system overhead
- Memory files are informational only — they show what the agent has accumulated
- For Discord/WhatsApp: skip markdown tables, use the block format above
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install context-viz - 安装完成后,直接呼叫该 Skill 的名称或使用
/context-viz触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Context Visualization 是什么?
Visualize the current context window usage — token estimates per component (system prompt, tools, workspace files, messages, free space). Use when the user a... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 649 次。
如何安装 Context Visualization?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install context-viz」即可一键安装,无需额外配置。
Context Visualization 是免费的吗?
是的,Context Visualization 完全免费(开源免费),可自由下载、安装和使用。
Context Visualization 支持哪些平台?
Context Visualization 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Context Visualization?
由 Benedikt Koehler(@furukama)开发并维护,当前版本 v1.0.0。