rb-context-tokens

Analyzes Codex session JSONL files to extract and report token usage metrics.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/richardmbailey/rb-skills --skill rb-context-tokens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rb-context-tokens
Source: https://github.com/richardmbailey/rb-skills/tree/main/rb-context-tokens
Command: npx skills add https://github.com/richardmbailey/rb-skills --skill rb-context-tokens

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill solves the uncertainty regarding how much of the Codex context window is currently consumed, preventing unexpected model behavior or truncation due to token limits.

Core Features & Use Cases

  • Token Usage Reporting: Provides precise metrics on input, output, and cached token counts from the latest session events.
  • Session Analysis: Automatically identifies the most recent user session file to ensure reports are always relevant to the current workflow.
  • Use Case: When working on a large codebase, use this skill to verify if your current context is approaching the model's limit before initiating a complex refactoring task.

Quick Start

Ask the agent to report the current context token usage by invoking the rb-context-tokens skill.

Frequently Asked Questions about rb-context-tokens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I monitor Codex context window token usage during a session?

To monitor Codex context window token usage, this Skill parses local session JSONL files to extract real-time token consumption metrics from token_count events. It automatically identifies your most recent session log to report current input, output, and cached token counts.

What is the best way to check if my Codex context is approaching the token limit before a complex task?

Checking context token utilization before complex tasks is handled by analyzing session JSONL files to calculate percentage-based usage statistics. This reports how much of the context window is consumed, helping prevent unexpected model behavior or truncation.

Can I get a report of input and output token counts from my latest Codex session?

Yes, you can retrieve a report of input and output token counts by parsing your latest Codex session JSONL files. The Skill extracts these precise metrics from the most recent session events to provide an accurate token usage breakdown.

Do I need local session logs to analyze token consumption metrics?

Yes, you need local session logs to analyze token consumption metrics. The Skill requires access to local Codex session JSONL files to parse token_count events and calculate the percentage-based context-window utilization statistics.

Why does my Codex model experience unexpected behavior or truncation during development?

Unexpected model behavior or truncation occurs when context window token limits are reached. This Skill solves that uncertainty by monitoring real-time token consumption from session JSONL files so you can verify context utilization before initiating complex tasks.

Does this token monitoring Skill work with cached token counts from session events?

Yes, this token monitoring Skill works with cached token counts by extracting them from session JSONL files. It parses token_count events to provide precise metrics on input, output, and cached tokens from the latest development session.