agentleFS
trac3r00trac3r00/agent-skills/skills/usage-audit/SKILL.md

usage-audit

Skill0 starsChanged 8 days agoMITView on GitHub

Cross-client token and session accounting. Every AI agent client records what it consumed — Claude Code per-message usage JSONL, Codex token_count events, OpenCode per-session token columns — but none shows the cross-client total. Reads the same local stores as session-handoff (read-only, nothing uploaded) and reports tokens by model, client, and project, with an optional budget gate.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Usage Audit

You cannot manage what no client will show you: cross-client, cross-project token consumption, from the logs already on your disk.

Commands

python3 scripts/usage_audit.py                        # last 30 days, by model
python3 scripts/usage_audit.py --by project           # where tokens go
python3 scripts/usage_audit.py --by client --since 7  # which client burns most
python3 scripts/usage_audit.py --budget-tokens 50000000 || notify  # tripwire
python3 scripts/usage_audit.py --json                 # full report, all groupings

Stores read (read-only, local)

ClientSource
Claude Code~/.claude/projects/*/*.jsonl per-message usage blocks
Codex~/.codex/sessions/**/rollout-*.jsonl final token_count totals
OpenCode / OMOopencode.db session token columns

Missing stores are skipped silently. Cache tokens are tracked separately from input/output so cached-heavy workflows read honestly.

Pairs with

context-budget (why is per-turn cost high) answers the static question; usage-audit answers the historical one (where did tokens actually go). session-handoff shares the same store-reading conventions.

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.