skills/token-usage-auditor/SKILL.md
Audit project token usage from local Codex, Codex sidecar, and Claude Code logs. Use when the user asks to measure token burn, token consumption, project attention, agent usage, Codex/Claude Code usage, sidecar usage, token efficiency, or lifecycle telemetry for a project.
npx skillsauth add a-green-hand-jack/ml-research-skills token-usage-auditorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Measure token usage as project telemetry: where agent attention went, how much fresh work versus cached context was spent, and which sessions or sidecar runs should be tied back to project phases and artifacts.
<installed-skill-dir>/
├── SKILL.md
├── scripts/
│ └── collect_token_usage.py
└── references/
└── data-model.md
.agent/sidecars/*/model.json metadata, because ephemeral sidecar runs may not persist normal session logs.For the current project, run:
python3 <installed-skill-dir>/scripts/collect_token_usage.py --project-root .
For a recent window:
python3 <installed-skill-dir>/scripts/collect_token_usage.py --project-root . --since 2026-05-01 --until 2026-05-31
To write repo-local reports:
python3 <installed-skill-dir>/scripts/collect_token_usage.py --project-root . --format markdown --output docs/reports/token_usage/2026-05.md
python3 <installed-skill-dir>/scripts/collect_token_usage.py --project-root . --format json --output memory/token_ledger/sessions.json
The script is read-only with respect to Codex and Claude Code logs. It writes only when --output is provided.
Identify the project root.
git rev-parse --show-toplevel when possible.code/ / paper/ if they want component-local accounting.Run the collector.
--since and --until when the user asks for a week, month, phase, or release window.--format markdown for discussion and --format json when updating project memory.--codex-root or --claude-root only when logs live outside the defaults.--no-sidecars only when the user wants raw agent-session logs without sidecar metadata.Interpret the report.
total_context_tokens: all context observed by the agent, including cached reads when the provider reports them.fresh_tokens: non-cached input plus cache creation plus output. Use this as the closer proxy for incremental cost/effort.cached_tokens: prompt-cache reads or cached input. Use this as context reuse, not equal fresh work.session_count: number of project-matched local sessions or recorded sidecar runs.codex-sidecar: repo-local .agent/sidecars/*/model.json records. Exact token fields appear only when the sidecar run copied Codex CLI usage into model.json.Add project labels only when supported.
phase: idea, literature, design, implementation, experiment, diagnosis, writing, rebuttal, release, maintenance, tooling, project-management.task_type: design, implementation, debug, writing, review, release, sync, setup, experiment, diagnosis, literature, coordination.confidence: exact, inferred, manual, unknown.Connect to artifacts.
Use references/data-model.md when writing long-lived project memory.
Recommended outputs:
docs/reports/token_usage/YYYY-MM.md for human-readable monthly reportsmemory/token_ledger/sessions.json for structured session summariesmemory/token_ledger/README.md only if the project needs policy notesWrite to memory/token_ledger/ only when: phase change, milestone tag, major experiment batch, or user explicitly asks for a usage record. One-off usage queries do not require writeback. Do not commit copied raw transcript logs unless the user explicitly asks and privacy has been reviewed.
When summarizing, separate these conclusions:
Avoid saying high token burn means good work. Prefer phrasing such as: "token usage was concentrated in experiment diagnosis; yield was decision-heavy rather than commit-heavy."
testing
Bootstrap project-local ml-research-skills. Use from global installs when creating a new ML research project, enabling this collection in an existing ML research repo, or deciding whether to install the full bundle locally. Route to project-init for new projects; do not handle paper or experiment work directly.
development
Route project operations tasks — git, memory, bootstrap, remote, workspace, code review, timeline, ops — to the correct skill. Use when the task involves commits, pushes, worktrees, project memory, enabling project-local skills, SSH/server coordination, sidecar runners, or audits. Do not solve the ops task directly.
testing
Route ML/AI paper writing tasks to the correct skill — contract planning, prose drafting, section writing, consistency editing, review simulation, rebuttal, submission, or citation work. Use when the task involves writing, revising, reviewing, or submitting a paper instead of guessing between paper-writing-assistant, paper-writing-contract-planner, paper-reviewer-simulator, auto-paper-improvement-loop, or citation skills. Do not draft prose directly.
data-ai
Project-local router for ML research skill selection. Use inside an initialized ML research project, or while maintaining this skill repo, when the user describes an ML research/paper/experiment/discovery/ops/release workflow and may not know the skill; route to a domain router or high-signal leaf. Do not use for generic non-ML projects.