Context Window Tracker
Track and report OpenClaw context window usage with a detailed breakdown of what's consuming tokens. Use when: user asks about context usage, token usage, "h... Skill: Context Window Tracker Owner: 99rebels Summary: Track and report OpenClaw context window usage with a detailed breakdown of what's consuming tokens. Use when: user asks about context usage, token usage, "h... Tags: latest:1.4.0 Version history: v1.1.4 | 2026-04-30T17:21:11.387Z | user Revert to stable — undo formatting changes that increased security score v1.1.3 | 2026-04-30T16:56:52.077Z | user Script no lon
Rank
62
Safety
84
Downloads
999
Updated
Oct 11, 2026
Version
1.1.4
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 999 downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 999 downloadsadoption · observed Oct 11, 2026
- Latest release
- 1.1.4release · observed Apr 30, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.1.4release
Revert to stable — undo formatting changes that increased security score
Observed Apr 30, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s17b17x5vmnh2q27ane7sj7an5843qs4:context-window-tracker- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-99rebels-context-window-tracker/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
85,844 characters of source documentation, loaded on request.
Extracted files
4 files captured from the source.
SKILL.md
---
name: context-window-tracker
description: >
Track and report OpenClaw context window usage with a detailed breakdown of what's
consuming tokens. Use when: user asks about context usage, token usage,
"how much context am I using", "how full is my context window", "tokens remaining",
"am I close to the limit", thinking/reasoning token costs, what's eating context
(session setup vs conversation vs overhead), or how many turns are left.
NOT for: estimating tokens for arbitrary text, managing context (compact/prune),
or cross-session cost aggregation.
homepage: https://github.com/99rebels/context-window-tracker
---
# Context Window Tracker
Shows how much context window is left, without opening the terminal.
## When to Use
- "Check my context"
- "How much context am I using?"
- "How full is my context window?"
- "Tokens remaining"
- "Am I close to the limit?"
- Any question about context usage
## Two Modes
### Compact (default)
One line, glanceable. Good for quick checks.
```bash
python3 scripts/context_report.py
```
### Detailed
Full breakdown with per-file system prompt, conversation split, trends, and thinking status. Use when the user asks for specifics.
```bash
python3 scripts/context_report.py --detailed
```
Both modes auto-detect the most recently updated session. Options:
```
--session <key> Target a specific session
--agent <name> Target a specific agent (default: main)
--detailed Full breakdown instead of compact one-liner
```
## Output Format
### Compact
```
🟢 [███░░░░░░░░░░░░░░░░░] 29.8K / 202.8K tokens (15% used) | ~736 turns left | Cache: 99%
```
### Detailed
```
🟢 [███░░░░░░░░░░░░░░░░░] Context Usage: 29.8K / 202.8K (15%)
────────────────────
**Token Breakdown**
System Prompt: ~10.2K tokens (5%)
AGENTS.md: ~2.0K
SOUL.md: ~416
TOOLS.md: ~717
MEMORY.md: ~2.3K
📦 Framework overhead: ~5.3K (tool schemas, skill list, runtime)
Conversation: ~19.6K tokens (10%)
📊 Total Used: 29.8K (15%)
Remaining: 173.0K (85%)
────────────────────
**Trends**
Avg tokens per turn: ~1.2K tokens
⏳ Estimated turns remaining: ~144
────────────────────
**Session Stats**
📥 Total input: 25K | 📤 Total output: 1.8K | Cache hit rate: 99%
Thinking: active (3/12 responses)
────────────────────
```
The bar uses `█` (filled) and `░` (empty) across 20 segments (each = 5%). The indicator shifts: 🟢 under 60%, 🟡 60-80%, 🔴 over 80%.
## Guidance
When the user asks about context usage, you may optionally include a brief note about remaining capacity based on the script output and the current conversation. Only do this at 75%+ usage. Skip for fresh sessions.
Rules:
- One line max. Reference the actual task, not generic categories.
- Don't prescribe actions, describe what fits.
- Never suggest deleting workspace files or changing system config.
## What's Exact vs Estimated
```
✅ Exact (from provider):
• Total tokens used (from transcript)
• Context window limit (from session store)
•_meta.json
{
"ownerId": "kn7efp7pm24p8pa49yfxqqwd7d843jwe",
"slug": "context-window-tracker",
"version": "1.1.4",
"publishedAt": 1777569671387
}references/data-sources.md
# Data Sources
Where the script reads from and what each source provides.
## Transcript (source of truth)
```
~/.openclaw/agents/<agent>/sessions/<sessionId>.jsonl
```
Each line is JSON. The script reads `type: "message"` entries with `role: "assistant"` and extracts `message.usage`.
Usage fields (already normalized by OpenClaw from any provider):
- `input` — non-cached input tokens
- `output` — generated tokens (includes thinking/reasoning tokens for most providers)
- `cacheRead` — tokens served from cache
- `cacheWrite` — new tokens written to cache
- `totalTokens` — the authoritative total (always accurate regardless of provider)
- `cost` — per-response cost breakdown
**Prefer transcript over session store** — the store can lag behind by several thousand tokens.
## Session Store
```
~/.openclaw/agents/<agent>/sessions/sessions.json
```
Provides data the transcript doesn't have:
- `contextTokens` — the context window limit for this model
- `systemPromptReport` — per-file character breakdown of the system prompt
- `inputTokens`, `outputTokens` — cumulative totals (may lag behind transcript)
- `sessionFile` — path to the transcript file
### System Prompt Report Structure
```json
{
"systemPrompt": {
"chars": 45511,
"projectContextChars": 23013,
"nonProjectContextChars": 22498
},
"injectedWorkspaceFiles": [
{"name": "AGENTS.md", "rawChars": 7809, "injectedChars": 7809, "truncated": false}
]
}
```
- `projectContextChars` — workspace files (AGENTS.md, SOUL.md, MEMORY.md, etc.)
- `nonProjectContextChars` — framework overhead (tool schemas, skill list, runtime config)
## How OpenClaw Normalizes Provider Responses
```
Provider raw response → OpenClaw normalized format
────────────────────────────────────────────────────
prompt_tokens → input (minus cached_tokens)
completion_tokens → output (plus reasoning_tokens if present)
prompt_tokens_details → cacheRead
.completion_tokens_details
.reasoning_tokens → added to output
```
`totalTokens = input + output + cacheRead` is always the real total regardless of provider.references/thinking-tokens.md
# Thinking / Reasoning Tokens How each provider handles extended thinking and how it affects token counts. Thinking tokens always cost money and always count against the context window. But providers report them differently: ``` Anthropic → Bundled into input_tokens (same billing rate) OpenAI → Separate field: completion_tokens_details.reasoning_tokens z.ai → Varies by model, may bundle into input or output ``` OpenClaw's `totalTokens` always includes thinking tokens — it's the authoritative count for "how full is my window." ## Detection The script can't detect thinking tokens from usage fields alone (they're bundled for most providers). It notes the provider's behavior in the report output: ``` Thinking: bundled into input (Anthropic) Thinking: separate reasoning_tokens field (OpenAI) Thinking: varies by model (z.ai) ``` For definitive detection, scan the transcript JSONL for content blocks with `"type": "thinking"`.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/99rebels/skills/context-window-tracker",
"sourceUrl": "https://clawhub.ai/99rebels/skills/context-window-tracker",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T20:11:17.377Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-99rebels-context-window-tracker/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-99rebels-context-window-tracker/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T20:11:17.377Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "999 downloads",
"href": "https://clawhub.ai/99rebels/context-window-tracker",
"sourceUrl": "https://clawhub.ai/99rebels/context-window-tracker",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T20:11:17.377Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.1.4",
"href": "https://clawhub.ai/99rebels/context-window-tracker",
"sourceUrl": "https://clawhub.ai/99rebels/context-window-tracker",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-30T17:21:11.387Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-99rebels-context-window-tracker/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-99rebels-context-window-tracker/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.1.4",
"description": "Revert to stable — undo formatting changes that increased security score",
"href": "https://clawhub.ai/99rebels/context-window-tracker",
"sourceUrl": "https://clawhub.ai/99rebels/context-window-tracker",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-30T17:21:11.387Z",
"isPublic": true
}
]
}Record generated Oct 12, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-99rebels-context-window-tracker/run-check
