Context Window Tracker

Monitor and analyze real-time context window usage with visual bars and detailed token breakdowns.

Install
cmdop skills install agensi-context-window-tracker

Context Window Tracker is a skill for developers using OpenClaw who need visibility into token consumption during active sessions. It reads the underlying session .jsonl files to produce accurate usage reports rather than relying on estimates.

The skill operates in two modes. Compact mode outputs a single-line visual progress bar showing total token usage, percentage of context used, and estimated turns remaining. Detailed mode provides a deeper breakdown, attributing token consumption to specific system files such as SOUL.md or TOOLS.md, conversation history, and framework overhead — making it straightforward to identify what is consuming the context budget.

A Green/Yellow/Red health indicator signals whether the session has sufficient headroom to complete a current task or whether starting a fresh session is advisable. Trend analysis estimates remaining turns based on observed session velocity, giving a forward-looking view rather than just a snapshot. Cache hit rate tracking is also included, which can inform decisions about cost efficiency. An optional auto-check mode triggers a usage report automatically every 10 messages, reducing the need to invoke the skill manually.

This skill is specific to the OpenClaw environment and depends on access to session transcript files. It provides no tools that operate outside of monitoring and reporting on context usage within that environment.

Use cases

  • Monitor how much of the context window has been consumed before starting a large code generation task
  • Identify which system prompt files are consuming the most tokens in a session
  • Get an estimate of how many conversation turns remain before the context limit is reached
  • Track cache hit rates across a session to understand cost implications
  • Enable automatic token usage checks every 10 messages during a long coding session
  • Decide whether to continue in the current session or start fresh based on health indicator status

When to use it

  • When working in OpenClaw and needing accurate real-time token usage data from session .jsonl files
  • When complex coding sessions risk hitting context limits unexpectedly
  • When diagnosing which system files or conversation history segments are consuming disproportionate tokens
  • When auto-monitoring is preferred over manual checks during long multi-turn sessions

When not to use it

  • When not using the OpenClaw environment, as the skill is specific to that platform
  • When no session .jsonl transcript files are accessible, since the skill reads those directly
  • When looking for a general-purpose token counter that works across arbitrary LLM APIs or platforms
  • When the environment provides no tools list — this skill exposes no callable tools itself