Agent skill

Context Doctor

by jzOcb in jzOcb/context-doctor

Visualize and diagnose OpenClaw context window usage. An agent skill from jzOcb/context-doctor.

MITAuto-check passedAgent Workflows

Install Context Doctor

skills CLI
$ npx skills add jzOcb/context-doctor --skill context-doctor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jzOcb/context-doctor context-doctor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
context-doctor
GitHub stars
119
Token cost
~642 tokens
SKILL.md length
240 words
Files
5 (incl. scripts, assets)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Visualize and diagnose OpenClaw context window usage. An agent skill from jzOcb/context-doctor.

  • Works in 3 steps: Workspace Files → Installed Skills → Token Budget
  • User asks about context window health
  • SKILL.md covers Quick Start, Output Sections, Diagnostic Signals and Image Output (for chat /…
  • Runs Python scripts from its folder; calls python3

What it does

Context Doctor is an agent skill from jzOcb/context-doctor. Visualize and diagnose OpenClaw context window usage. Generates a terminal-rendered breakdown showing workspace files (status, chars, tokens), installed skills inventory, and token budget allocation across bootstrap components. Use when: (1) user asks about context window health or token usage, (2) debugging agent quality degradation ("agent got dumber"), (3) after editing workspace files to verify impact, (4) auditing bootstrap overhead. NOT for: conversation history analysis, model selection, or cost tracking.

Its SKILL.md is about 640 tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and assets (for example `README.md` and `scripts/context-doctor.py`).

It sits in Agent Workflows, covering LLM cost and token optimization and Context engineering. The repository describes itself as: 🧠 Visualize and diagnose OpenClaw context window usage — terminal, PNG, or JSON. The licence is MIT.

When your agent uses it

  • User asks about context window health
  • Debugging agent quality degradation (agent got dumber)
  • After editing workspace files to verify impact
  • Auditing bootstrap overhead

Example prompts

  • “agent got dumber”
  • “/context-doctor”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Workspace Files
  2. Installed Skills
  3. Token Budget

What it can do on your machine

Read from SKILL.md and the folder at commit d622768. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Context Doctor loads about 642 tokens when it runs. Until then it costs about 133 tokens; SKILL.md has 240 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~133
When it runs · the whole SKILL.md, loaded when a task matches
~642

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jzOcb/context-doctor at commit d622768, republished under its MIT licence (© jzOcb). 240 words, ~642 tokens.

Download SKILL.mdSave it as .claude/skills/context-doctor/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
context-doctor
description
Visualize and diagnose OpenClaw context window usage. Generates a terminal-rendered breakdown showing workspace files (status, chars, tokens), installed skills inventory, and token budget allocation across bootstrap components. Use when: (1) user asks about context window health or token usage, (2) debugging agent quality degradation ("agent got dumber"), (3) after editing workspace files to verify impact, (4) auditing bootstrap overhead. NOT for: conversation history analysis, model selection, or cost tracking.

Context Doctor

Diagnose and visualize how the context window budget is allocated.

Quick Start

Run the visualization script:

bash
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:

bash
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.

© jzOcb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, assets) in the repository root of jzOcb/context-doctor.

  • SKILL.md
  • LICENSE
  • README.md
  • assets/screenshot.png
  • scripts/context-doctor.py

Open the folder on GitHubat commit d622768

Compare with similar skills

Context Doctor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Context Doctor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Context Doctor this skilljzOcb/context-doctor119—~642Automated safety check: PassMIT
Caveman Learn Token FixesJuliusBrussee/caveman111k—~2.8kAutomated safety check: PassApache-2.0
OmniRoute Context CLIdiegosouzapw/OmniRoute75k—~1.2kAutomated safety check: PassMIT
Subagent Brief DisciplineLichAmnesia/lich-skills234—~1.6kAutomated safety check: PassMIT
Compact Guidejh941213/my-cc-harness125—~621Automated safety check: PassNone
Omh Context Budget Reviewrlaope/oh-my-hermes3.2k—~2kAutomated safety check: PassMIT

Similar skills

  • Caveman Learn Token Fixes

    JuliusBrussee/caveman

    Acts on a Caveman learn report: reviews ranked token sinks, applies cost-lowering edits one at a time with your consent, and reports what each fix returned.

    111k GitHub stars~2.8k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • OmniRoute Context CLI

    diegosouzapw/OmniRoute

    Manage context engineering configurations, RTK filter sets, and conversation sessions from the CLI. Apply context-relay settings and inspect active context…

    75k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Subagent Brief Discipline

    LichAmnesia/lich-skills

    Checks every subagent prompt before spawning, swapping pasted files and context for paths and short summaries and trimming the brief, to avoid multiplied token cost.

    234 GitHub stars~1.6k tokensUpdated 4 mo ago
    Agent WorkflowsAuto-check passed
  • Compact Guide

    jh941213/my-cc-harness

    Context window management and token optimization guide. An agent skill from jh941213/my-cc-harness.

    125 GitHub stars~621 tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed
  • Omh Context Budget Review

    rlaope/oh-my-hermes

    [omh] Context window or token budget at risk: plan compact context, token/cost budgets, summarization checkpoints, and overflow recovery before long agent work.

    3.2k GitHub stars~2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Engine

    borghei/Claude-Skills

    Context management engine for AI coding agents. An agent skill from borghei/Claude-Skills.

    891 GitHub stars~2.2k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed

Questions about Context Doctor

What does Context Doctor do?

Visualize and diagnose OpenClaw context window usage. An agent skill from jzOcb/context-doctor. Context Doctor is an agent skill from jzOcb/context-doctor. Visualize and diagnose OpenClaw context window usage.

When should I use Context Doctor?

Context Doctor fits situations like: user asks about context window health; debugging agent quality degradation (agent got dumber); after editing workspace files to verify impact; auditing bootstrap overhead.

How do I install Context Doctor in Claude Code?

Run `npx skills add jzOcb/context-doctor --skill context-doctor -a claude-code`. Or copy the skill folder (the jzOcb/context-doctor repository) into .claude/skills/context-doctor in your project. Claude Code loads it when a task matches its description.

How do I install Context Doctor in Codex?

Run `npx skills add jzOcb/context-doctor --skill context-doctor -a codex`. Or copy the skill folder (the jzOcb/context-doctor repository) into .agents/skills/context-doctor in your project. Codex loads it when a task matches its description.

Can I use Context Doctor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jzOcb/context-doctor --skill context-doctor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/context-doctor, .gemini/skills/context-doctor, .github/skills/context-doctor and .opencode/skills/context-doctor in your project.

What does Context Doctor need to run?

Going by SKILL.md and its folder, Context Doctor needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Context Doctor access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Context Doctor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Context Doctor use?

Context Doctor is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Context Doctor use?

About 642 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Context Doctor?

Skills that share tags, products or a category with Context Doctor: Caveman Learn Token Fixes (JuliusBrussee/caveman, 111k stars), OmniRoute Context CLI (diegosouzapw/OmniRoute, 75k stars), Subagent Brief Discipline (LichAmnesia/lich-skills, 234 stars) and Compact Guide (jh941213/my-cc-harness, 125 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Context Doctor?

jzOcb (a GitHub user) maintains it in jzOcb/context-doctor, which has 119 GitHub stars. The repository was last updated on March 16, 2026.

Source: jzOcb/context-doctor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.