← Back to Skills Marketplace
furukama

Context Visualization

by Benedikt Koehler · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
649
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install context-viz
Description
Visualize the current context window usage — token estimates per component (system prompt, tools, workspace files, messages, free space). Use when the user a...
README (SKILL.md)

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

  1. Run session_status to get: model, context used/total, compactions
  2. Run scripts/estimate_tokens.py \x3Cworkspace_path> to estimate file token sizes
  3. Estimate message tokens: context_used - system_overhead - file_tokens
  4. 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
Usage Guidance
This skill appears to do what it says: it will read the workspace files you point it at and the memory/ directory to estimate token usage and produce a local breakdown. Before running, make sure you pass a workspace path that does not contain sensitive secrets or unrelated system files (avoid pointing it at / or your home directory). The script outputs filenames, sizes, and token estimates locally — it does not contact external endpoints — but you should still review its output before sharing it. If you want extra safety, run the script on a copy of the workspace or a limited test directory first. Additionally, note that token counts are estimates (uses ~4 chars/token and a fixed system overhead value).
Capability Analysis
Type: OpenClaw Skill Name: context-viz Version: 1.0.0 The skill 'context-viz' and its associated script `scripts/estimate_tokens.py` are designed to visualize the OpenClaw agent's context window usage and memory inventory. The `SKILL.md` provides clear, non-malicious instructions for the agent to run the local Python script and process its output. The Python script reads files from the specified workspace path and its 'memory' subdirectory to estimate token counts and file sizes, outputting this data as JSON to stdout. There is no evidence of data exfiltration, unauthorized network communication, persistence mechanisms, or execution of arbitrary commands. The file access is directly aligned with the stated purpose of analyzing workspace and memory files for token estimation, and there are no prompt injection attempts against the agent in `SKILL.md`.
Capability Assessment
Purpose & Capability
Name and description match the actual behavior: the included script estimates token counts for named workspace files and the SKILL.md instructs calling session_status to get model/context usage. No unrelated binaries, env vars, or external services are requested.
Instruction Scope
Instructions are narrowly focused on running the bundled estimator and calling session_status. The estimator reads workspace files and the memory/ directory to produce counts and an inventory — this is necessary for the stated task but means the skill will read and report filenames, sizes, and token estimates for any files under the provided workspace path. That could expose sensitive filenames or content if you point it at a directory containing secrets; the SKILL.md does not instruct any external transmission of the data.
Install Mechanism
No install spec or external downloads. The skill is delivered with a small local Python script (no network activity or third-party packages). Risk from installation is minimal.
Credentials
No environment variables, credentials, or config paths are requested. The only required capability is read access to the workspace path you provide (and to memory/ beneath it), which is proportionate to estimating context usage.
Persistence & Privilege
The skill is not always-enabled and does not request persistent/system-level privileges or modify other skills. It runs on-demand and only reads local files when invoked.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install context-viz
  3. After installation, invoke the skill by name or use /context-viz
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release – visualize and break down current context window usage. - Estimates token usage per component: system prompt, tools, workspace files, messages, and free space. - Provides a visual, proportional bar chart in monospace format. - Includes script to estimate tokens for workspace files. - Details a "Memory on Disk" inventory, showing files not loaded into context. - Designed for user questions about context size, usage breakdown, or context fullness.
Metadata
Slug context-viz
Version 1.0.0
License
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 649 downloads so far.

How do I install Context Visualization?

Run "/install context-viz" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Context Visualization free?

Yes, Context Visualization is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Context Visualization support?

Context Visualization is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Context Visualization?

It is built and maintained by Benedikt Koehler (@furukama); the current version is v1.0.0.

💬 Comments