agentleFS
ArylmeraArylmera/Geneseed/.claude/skills/token-report/SKILL.md

token-report

Skill1 starsChanged 34 days agoMITView on GitHub

Generate a token usage report for the current session — a markdown table breakdown of context window usage: the session-start baseline (harness, system prompt, tools, skills), everything processed since (user messages, replies, thinking, tool calls and results per tool), exact recorded totals, and the heaviest single items. Use this whenever the user asks about token usage, context usage, context window size, session cost in tokens, 'how full is the context', 'what is eating my context', a usage breakdown or usage report — even if they don't say the word 'token'.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. codewithmukesh/dotnet-claude-kit★ 808same name
    2. YorkWong1995/OPC-Harness★ 4same name
    3. sarveshtalele/devcrew★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the product's own copy of the script — this repository IS the source tree, so the deployed skill points at src/ instead of carrying a …

    line 17
  2. Distinctive:

    After the tables, add a short interpretation in your own words: what is consuming the most context, and one concrete suggestion if …

    line 64
  3. Distinctive:

    If the script errors or reports degraded fidelity (a host that stores its sessions elsewhere, or records no usage), say so plainly and fall …

    line 70
  4. Very specific:

    If the script failed to find this host's session data, or a host changed its storage schema, note the observed layout and fix …

    line 78

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Token usage report

Generate the session's token usage breakdown — exact recorded totals, context window occupancy, and an estimated attribution of what filled it — as markdown tables, on any supported host.

Produce a token usage report for the current session by running the bundled script, then present its markdown output to the user.

How to run

Run the product's own copy of the script — this repository IS the source tree, so the deployed skill points at src/ instead of carrying a second tracked copy that would drift:

node src/skills/token-report/scripts/token_report.mjs

(Path relative to the repository root.)

It auto-detects the host you are running on by locating session data and picking the most recently active source:

HostSession dataFidelity
Claude Code~/.claude/projects/<slug>/*.jsonlexact usage per request
IBM Bob~/.bob/projects/<slug>/*.jsonl (Claude-shaped, $BOB_CONFIG_DIR honoured)exact usage per request
OpenCode~/.local/share/opencode/opencode.db (SQLite, v1.2+; pre-1.2 falls back to storage/ JSON files)exact tokens per request; child sessions attributed as subagents
OpenClaude~/.openclaude/projects/<slug>/*.jsonl (Claude-shaped, $OPENCLAUDE_CONFIG_DIR honoured)exact usage per request

Useful flags: --host claude|bob|openclaude|opencode to force a host, --transcript <path> / --session <id> for a specific session, --limit <tokens> for the context-window limit used in the % columns (default 200000), --top <n> for the heaviest-items list.

What the report contains, and where the numbers come from

Two kinds of numbers — keep the distinction explicit when presenting:

  1. Exact numbers come from the usage the host records with every request: session totals (output tokens, fresh input, cache reads/writes), the session-start baseline, and the current/peak context size. These are ground truth — never contradict them.
  2. Estimated attribution (~4 characters per token) explains what fills the context: user messages, assistant replies, thinking, tool calls, and tool results grouped per tool. These are labeled estimates; keep them labeled that way.

The session-start baseline is the input-side token count of the very first request — that is the harness (system prompt, tool schemas, skill/agent listings, memory files) plus the user's first message. At the start of a fresh session that is the whole story; later, the delta between current and start context is the work processed since.

Presenting the result

Relay the script's markdown tables directly — they are the deliverable. After the tables, add a short interpretation in your own words: what is consuming the most context, and one concrete suggestion if something stands out (e.g. a single huge file read dominating, or heavy tool results that a subagent could have absorbed instead). Do not pad the report with generic advice when nothing stands out.

If the script errors or reports degraded fidelity (a host that stores its sessions elsewhere, or records no usage), say so plainly and fall back to reporting what you know: rough context size from any usage information available to you, and a qualitative breakdown of what has happened this session. Do not invent exact numbers.

Self-improvement

If the script failed to find this host's session data, or a host changed its storage schema, note the observed layout and fix src/skills/token-report/scripts/token_report.mjs (or record the finding in memory for the next run) before closing out.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.