Context Visualization (context-viz) for Openclaw

A diagnostic utility that generates visual token breakdowns and memory inventory reports to manage context window health.

furukama
v1.0.0
Feb 17, 2026
0
1.5k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install context-viz

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install context-viz using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Context Visualization (context-viz)?

Context-Viz is a specialized technical tool designed to provide transparency into how an AI agent utilizes its available token space. By analyzing the current session state and workspace files, it produces a clear, formatted breakdown of token consumption across system prompts, core files, and message history. This is particularly valuable for developers who need to optimize their Openclaw Skills and prevent unexpected context overflows or excessive compactions.

Beyond active context tracking, the skill also audits the agent's long-term memory stored on disk. It categorizes files in the memory directory that are not currently loaded into the context window, allowing users to see the full scope of their agent's knowledge base without overwhelming the current model session.

Context Visualization (context-viz) Use Cases

  • Diagnosing why an agent is reaching its context limit during complex tasks.
  • Identifying which specific core files, such as SOUL.md or AGENTS.md, are taking up the most space.
  • Calculating the exact percentage of the context window dedicated to message history versus system overhead.
  • Auditing the total size and token count of archived memory stored on disk for Openclaw Skills.

How Context Visualization (context-viz) Works

  1. The skill triggers a bundled Python script to scan the workspace and estimate token counts for files using a standard character-to-token ratio.
  2. It executes the session_status command to fetch live metadata from the core environment, including model limits and current total usage.
  3. The tool subtracts the file and system overhead from the total usage to isolate the token count attributed to the current conversation messages.
  4. It calculates proportional percentages for each component and generates a monospace ASCII bar chart for visual feedback.
  5. Finally, it scans the local memory directory to provide a categorized inventory of files that exist on disk but are not currently in the active context window.

Context Visualization (context-viz) Setup

To integrate this capability into your Openclaw Skills workflow, ensure the estimation script is available in your workspace. You can manually run the token estimator with the following command:

python3 scripts/estimate_tokens.py /path/to/workspace

The agent will automatically invoke this logic when asked about its context size, usage breakdown, or how full its memory is.

Context Visualization (context-viz) Data Schema & Taxonomy

The skill organizes its output into two primary sections: Context Usage and Memory on Disk. The data is structured as follows:

Data Point Metric Estimation Method
System + Tools Tokens / % Estimated at ~8-10k tokens overhead
Workspace Files Tokens / % ~4 characters per token average
Message History Tokens / % Total Used - (System + File tokens)
Free Space Tokens / % Total Model Limit - Total Used
Memory Categories Files / Size Grouped by directory name or file pattern

Context Visualization (context-viz) Advanced Features

  • Monospace bar chart generation using visual block characters for quick status checks at a glance.
  • Cross-platform formatting support, providing optimized layouts for Discord, WhatsApp, and standard CLI outputs.
  • Detailed memory inventory that provides a clear picture of the agent's offline knowledge base outside of Openclaw Skills active sessions.
  • Proportional scaling logic that adapts the visual chart based on the specific context limits of different LLM models.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*