Agent Token Audit — Security skill for Claude Code
Zero-dependency read-only script to audit Claude Code & Codex token burn, latency, and context bloat.
How to install Agent Token Audit
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open arkheiaai/agent-token-audit and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Agent Token Audit does
Zero-dependency read-only script to audit Claude Code & Codex token burn, latency, and context bloat.
Alternatives in Security
- SEO Audit Skill — English · 中文 可复用的单页面 SEO 审计 Agent Skill 235 ★
- Loongsuite Pilot — Local-first telemetry collector for AI coding agents — unified OpenTelemetry events for Claude Code, Codex, Cu 150 ★
- Senior Engineering Partner — A stack-agnostic Claude Code skill: strict code reviewer, pair programmer, debugger, and mentor (Python/Bash/A 148 ★
README
agent-token-audit
A tiny, zero-dependency, read-only Python script to audit where your **Claude Code** and **Codex** weekly token quotas are actually going.
Why I built this
I run 20x subscriptions on both Claude Code and Codex (plus local open-weight models) and started hitting my weekly cap in **about a single day**. Before blaming silent rate-limit nerfs, I audited my local `~/.claude` and `~/.codex` session logs over a 7-day window.
I guessed I was burning 2–3 billion tokens/week. The actual number on one laptop alone was **12.7 billion tokens in 7 days**:
- Codex: 8.97B tokens across 46,377 turns (193k avg tokens/turn)
- Claude Code: 3.73B tokens across 13,813 turns (270k avg tokens/turn)
Almost none of it was "thinking harder." It was **four silent context multipliers** I had accidentally built into my own workflow:
- Immortal multi-week threads: One Codex session had been alive for 28 days (1.34 GB JSONL log, still burning 379M tokens/day). Two Claude threads had been alive 2+ weeks (288 MB and 205 MB) averaging 270k tokens/turn.
- A 5.13 MB shared task board markdown file (~1.28M tokens, including a single 1.17 MB line!) that my startup instructions told every new session to read.
- A 391 KB / 5,023-line engineering contract (
DONE.md) (~98k tokens) read whole before builds, plus 3.0 MB of append-onlymemory.mdfiles across scheduled automations. - Raw tool dumps & repeated screenshots: Hundreds of >10 KB
Readand shell outputs (250 MB+ in 48h) and 1 MB+ PNGs read repeatedly inside long-lived threads, then re-billed on every subsequent turn.
Even with >97% prompt-cache hit rates, carrying 200k–270k tokens per turn across thousands of tool calls hits you three ways at once:
- Quota burn: evaporates a weekly 20x allowance in a day.
- Speed: slows every tool turn down (and causes brutal prefill stalls whenever a >5 min pause evicts the KV cache).
- Signal quality: stale logs, repe
Related Skills
Tokendiet MCP
Zero-dependency Open-Core MCP server, CLI & GitHub Action to audit MCP JSON Schema token weight, simulate mult
Context Audit
Audit how much input-token bloat the read-guard removes on this repo
Claude Cache Guard
Claude Code skill that stops prompt-cache thrash: -88% token burn in image-heavy agent sessions, with an audit
Context Bloat
Audit and optimize token bloat in AI agent repositories
Sabotage Audit
Agent Skill and zero-dependency forensic scanner for detecting and proving silent throttling, stubbed checks,
SkillClinic
Your AI is running skills you never audited. A zero dependency CLI that audits installed AI skill files for va
Related Agents
Lean Coder
Token-efficient coding agent for any project. Use for edits, refactors and bug fixes (multi-file or unfamiliar
Mb Context Doctor
Diagnoses CLAUDE.md and .claude/ bloat. Runs token counts, identifies what's redundant or stale, and proposes
Agent Harness Optimizer
Context window, token budget, and agent harness optimization specialist. Analyzes transcript bloat, tunes prom