token-stats

token-stats is a skill for Claude Code, Codex from mahmoudimus/simba. It costs 24 tokens per session (1,056 once invoked), scanned A, original, MIT.

A report that compares token use when searching for relevant files first with token use when reading files without that search step.

In plain words
What is it for?
Use it to review session searches and file activity, estimate codebase size, and display token-savings statistics.
Why use it?
It shows how much work and context can be saved by locating relevant information before exploring a codebase.

Skill for Claude CodeCodex

Part of the simba plugin — 10 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mahmoudimus/simba/token-stats
Any agent
npx skills add mahmoudimus/simba --skill token-stats
Clone the repo
git clone --depth 1 https://github.com/mahmoudimus/simba

Made for: Claude Code, Codex.

Or install simba, the plugin that ships this one along with the rest of its 10 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for token-stats

README.md
[![agentmods](https://agentmods.dev/badge/skills/mahmoudimus/simba/token-stats.svg)](https://agentmods.dev/skills/mahmoudimus/simba/token-stats)
Your own site
<a href="https://agentmods.dev/skills/mahmoudimus/simba/token-stats"><img src="https://agentmods.dev/badge/skills/mahmoudimus/simba/token-stats.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,056 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.01056
Opus 5 $0.00012 $0.00528
Sonnet 5 $0.00005 $0.00211
Haiku 4.5 $0.00002 $0.00106

Measured 4d ago against content hash 369196e1b98f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

token-stats scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/simba/skills/token-stats/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/token-stats - Token Economics Dashboard

Show the token savings achieved by using search-first exploration vs blind file reading.

Instructions

When the user invokes /token-stats, analyze token usage and display savings.

1. Gather Activity Data

REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")
ACTIVITY_FILE="$REPO_ROOT/.simba/search/activity.log"

# Count files read this session
if [ -f "$ACTIVITY_FILE" ]; then
    echo "=== Session Activity ==="
    FILES_READ=$(grep -c "READ:" "$ACTIVITY_FILE" 2>/dev/null || echo "0")
    FILES_EDITED=$(grep -c "EDIT:" "$ACTIVITY_FILE" 2>/dev/null || echo "0")
    SEARCHES=$(grep -c "SEARCH:" "$ACTIVITY_FILE" 2>/dev/null || echo "0")
    echo "Files read: $FILES_READ"
    echo "Files edited: $FILES_EDITED"
    echo "Searches performed: $SEARCHES"
else
    echo "No activity log found for this session"
fi

2. Calculate Codebase Stats

REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")

# Total files in codebase
TOTAL_FILES=$(rg --files "$REPO_ROOT" 2>/dev/null | wc -l | tr -d ' ')

# Estimate total tokens (rough: ~1.33 tokens per word, ~3 words per line)
TOTAL_LINES=$(rg -c '' "$REPO_ROOT" 2>/dev/null | awk -F: '{s+=$2} END {print s}')
ESTIMATED_TOTAL_TOKENS=$((TOTAL_LINES * 4 / 3))

echo ""
echo "=== Codebase Size ==="
echo "Total indexable files: $TOTAL_FILES"
echo "Total lines: $TOTAL_LINES"
echo "Estimated tokens: $ESTIMATED_TOTAL_TOKENS"

3. Query Memory for Historical Data

uv run python -m simba.search stats

4. Calculate and Display Economics

Based on the gathered data, calculate and present:

Token Economics Model:

Scenario Calculation Typical Cost
Blind exploration Read 20+ files to find relevant code ~50,000 tokens
With turbo-search Search (50 tokens) + Read 3-5 targeted files ~5,000 tokens
Savings ~90%

Present this table to the user:

Read the full file on GitHub · 137 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 137 lines · 24 tokens per session scan A 369196e1b98f

Subscribe to this mod's changes

token-stats is a skill published in the GitHub repository mahmoudimus/simba (6 stars, last pushed 1mo ago), licensed MIT. It adds 24 tokens to every session and 1,056 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

weekly-digests

Generate a serial week-by-week narrative digest of a project's full claude-mem timeline. Splits the timeline into per-ISO-week files, then runs one consecutive subagent per week — each receiving the prior week's carry-forward block — to produce one chapter per ISO week of data. Use when asked for "weekly digests"…

thedotmack/claude-mem · 93 tokens

version-bump

Automated semantic versioning and release workflow for Claude Code plugins. Handles version increments across package.json, marketplace.json, plugin.json manifests, build verification, git tagging, GitHub releases, and changelog generation. NPM publishing is the final human-required handoff because the maintainer…

thedotmack/claude-mem · 64 tokens

cloud-sync

Set up or check claude-mem cloud sync with cmem.ai Pro. Use when the user says "set up cloud sync", "sync my memories", "cmem pro", "cloud backup", "sync status", or wants their memory database backed up or synced to their cmem.ai account.

thedotmack/claude-mem · 64 tokens

ix

This skill should be used when answering structural questions about a codebase: understanding what a symbol is, tracing flows, measuring change impact, finding callers/callees/imports, or detecting code smells. It drives the Ix CLI (ix map/explain/trace/impact/search/rank/smells) against a persistent code graph stored…

ix-infrastructure/Ix · 103 tokens

services-audit-cron

Use when scheduling the canonical biweekly services-audit cron loop for Empirica's AI service scanner (Phase 3). The auditor body is empirica services-audit — captures a fresh scan, diffs against the previous, and emits a notification when novel running services appear. This skill provides the prompt template that…

EmpiricaAI/empirica · 126 tokens

message-cleanup

Daily housekeeping body for the canonical message-cleanup loop. Prunes expired git-notes mesh messages so the inbox stays focused on un-read ones. Loaded by the loop scheduler when the cron entry fires (default 03:17 daily) — never invoked directly by a user. Triggers: from the message-cleanup loop, "message…

EmpiricaAI/empirica · 89 tokens