input-token-analysis

input-token-analysis is a skill for Claude Code, Codex from moonlight-lupin/agent-skills. It costs 14 tokens per session (2,567 once invoked), scanned A, original, MIT.

A toolkit for measuring how many input tokens an AI agent uses across sessions, scheduled jobs, models, providers, and tool calls.

In plain words
What is it for?
It audits usage totals, cache reads and writes, and average usage by task, model, provider, and scheduled job.
Why use it?
It shows where token usage is concentrated and helps explain unexpectedly high input costs or context volume.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit It audits usage totals, cache reads and writes, and average usage by task, model, provider, and scheduled job.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/moonlight-lupin/agent-skills/input-token-analysis
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.

Any agent
npx skills add moonlight-lupin/agent-skills --skill input-token-analysis
Clone the repo
git clone --depth 1 https://github.com/moonlight-lupin/agent-skills

Made for: Claude Code, Codex.

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 input-token-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/input-token-analysis/github.svg)](https://agentmods.dev/skills/moonlight-lupin/agent-skills/input-token-analysis)
Your own site
<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/input-token-analysis"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/input-token-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for input-token-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/input-token-analysis"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/input-token-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,567 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00014 $0.02567
Opus 5 $0.00007 $0.01283
Sonnet 5 $0.00003 $0.00513
Haiku 4.5 $0.00001 $0.00257

Measured 8d ago against content hash 4df92ee0c269, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

input-token-analysis 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 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/audit.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

agent-ops/input-token-analysis/SKILL.md · 121 lines

How it starts

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

Input Token Analysis

Explain aggregate input token consumption. Answer three questions with numbers: where did the tokens go, which consumers dominate, what config or prompt change reduces them. Distinct from input-token-overheads, which audits per-turn system-prompt blocks. This skill audits total volume across sessions, cron fires, and tool traffic.

When to Use

  • Monthly/weekly input token bill is large and unexplained (e.g. "2.4B tokens in 30 days")
  • After applying token-saving changes — measure the delta against a baseline
  • A cron job is suspected of runaway token use

For per-turn context-window health, use input-token-overheads. For API billing disputes, use the provider's usage dashboard — local telemetry cannot see provider-side caching.

Quick Start

Run the audit script (read-only, pure stdlib):

python3 ~/.hermes/skills/agent-ops/input-token-analysis/scripts/audit.py --days 30
# other profiles: --db ~/.hermes/profiles/<name>/state.db
# custom cron ledger: --cron-audit /path/to/usage_audit.jsonl --jobs /path/to/jobs.json

The script prints: totals by task/model/provider, cache-read and cache-write columns, weighted per-call averages (long sessions and short-session floor), top sessions, cron offenders, active-only tool-result volume with the tool-share percentage, and oversized-result counts. Everything is derived from real DB rows — never estimate by hand when the script can measure.

Pre-Check Discipline

Verify before advising. Advice formed from memory is not acceptable.

  1. Config keys and current values — read the live value first: hermes config get <key>. Never state a current value from memory or assume the default is in force.
  2. Defaults and mechanisms — confirm a key exists and what it does against the installed build (hermes_cli/config_defaults.py) or the Hermes docs. If the installed build and docs disagree, say so.
  3. Provider behavior — do not assume a provider reports cache fields, honors a pricing tier, or counts tokens a certain way. Probe it or check its current docs before claiming.
  4. Unverifiable claims — mark them UNVERIFIED in the report. A labeled unknown beats a confident guess.

Read the full file on GitHub · 121 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 121 lines · 14 tokens per session scan A 4df92ee0c269

Subscribe to this mod's changes

input-token-analysis is a skill published in the GitHub repository moonlight-lupin/agent-skills (64 stars, last pushed 5d ago), licensed MIT. It adds 14 tokens to every session and 2,567 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-09-04.