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.
npx agentmods add instructions/peiris/token-cost/claude-mdgit clone --depth 1 https://github.com/peiris/token-costWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00982 | $0.00982 |
| Opus 5 | $0.00491 | $0.00491 |
| Sonnet 5 | $0.00196 | $0.00196 |
| Haiku 4.5 | $0.00098 | $0.00098 |
Grade A, and why
token-cost CLAUDE.md 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 2d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
token-cost — project rules
No legacy support, at all
This plugin is a work in progress with a single user (the author, for testing). The current ledger format is the only format.
- Never write code that reads, repairs, migrates, or improves rows written by older plugin versions — no version-aware branches, no post-hoc fix-up passes, no "this field may be missing on old rows" fallbacks, no display states that mean "recorded before we tracked this".
- When the ledger format changes: bump
ledger.FORMATand the plugin version. A project whose format stamp disagrees is rebuilt from its own transcripts by that project's nextsync()— SessionStart there,/token-cost, the UI, or--backfill. Rebuilds are staged (scratch file, one rename, stamp written last,.bakleft beside) so a killed hook leaves either the old world or a finished rebuild. Lossless only while Claude Code still keeps the transcripts (~30 days), so a format bump wants releasing promptly. - The plugin acts on the current project only. Nothing — code or agent — may enumerate, rebuild, or write other projects' ledgers. Healing happens where the user actually runs token-cost, never machine-wide.
- Version numbers are burned: never reuse or roll back one — the plugin cache is keyed by the version string.
The one distinction that is NOT legacy support: robustness toward Claude
Code's own transcript format (e.g. is_human_prompt()'s field fallbacks).
Those files are input we read but don't control, and old ones legitimately
sit on disk.
Publishing ends at the local install, not at the push
The author's own Claude Code runs the installed plugin, not this checkout, so a release the local install never received changed nothing.
- Publish without being asked. Finishing a change means releasing it: once the work is done and verified, run the full publish sequence below as part of the same task — don't stop at the working tree and offer to release.
- Publish = bump the plugin version, commit, push, then both
installs:
claude plugin update token-cost@token-costfor the CLI — the bare name doesn't resolve; the@token-costmarketplace suffix is required — andpython3 dev/resync_claudeai.pyfor Claude Desktop. Each needs its own restart to apply. - Push before updating: the marketplace pulls from GitHub, not from this directory. And without a version bump there is nothing for it to pull — the cache is keyed by the version string.
- Claude Desktop is a second install, and it wins. Where a plugin
exists both locally and on claude.ai, the desktop runs the claude.ai
copy and ignores the one the CLI installed. claude.ai only re-clones
the repo when asked — the marketplace says
auto_sync_on_pushbut has no webhook behind it — soclaude plugin updatealone leaves the desktop on whatever commit claude.ai last saw, with its Update button reading "On latest version".dev/resync_claudeai.pyis the ask; it exits non-zero unless claude.ai lands on HEAD. - A re-sync that changes hooks or executables comes back flagged
exec_surface_changed. That is claude.ai noting the plugin's exec surface moved, not a failed sync — the new version is stored.
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.
- 2d ago First seen · 79 lines · 982 tokens per session scan A 14e7bdbc5d73
token-cost CLAUDE.md is an instructions file published in the GitHub repository peiris/token-cost (2 stars, last pushed 5d ago), licensed MIT. It adds 982 tokens to every session, about $0.0049 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-08-31.
Other instructions, from other repositories
codex-usage-tracker AGENTS.md
Instructions for douglasmonsky/codex-usage-tracker, covering codex usage tracker instructions, product and authority, standing repository authorization, cross-packet semantic continuity and packet task handoff.
headroom AGENTS.md
Instructions for ZM-BAD/headroom, covering agents.md, project overview, commands, architecture and upstash (redis) data model — the cloud storage layer.
codex-usage-tracker CLAUDE.md
Instructions for douglasmonsky/codex-usage-tracker: Read and follow AGENTS.md before changing this repository.
token-saviour AGENTS.md
Instructions for vagkaratzas/token-saviour: Always-on rules for agents that read AGENTS.md (Codex CLI/app, VS Code Codex extension, and other instruction-only hosts). Full playbook with commands and evidence: skills/token-saviour/SKILL.md.
agents-md AGENTS.md
AGENTS.md instructions for Austin1serb/agents-md, covering coding agent instructions, operating principles, context discipline, command output and good byte capping examples.
aimeter CLAUDE.md
Instructions for saileshr/aimeter, covering claude.md, what aimeter is, commands, architecture and invariants (don't break these).