cost

cost is a command for Claude Code from atuljha23/holocron. It costs 37 tokens per session (396 once invoked), scanned A, original, MIT.

A command that reports token use and estimated cost across logged Claude Code sessions, including totals, model details, cache use, and budget status. A stop hook must have logged the sessions for the report to contain data.

In plain words
What is it for?
Use it to check recent or all-session costs, compare model usage, inspect cache hit rates, view expensive sessions, or check a configured budget.
Why use it?
It makes session spending and token consumption visible over a chosen time window. The cache information can help identify context changes that reduce prompt-cache reuse.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; mentions Claude Code.

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the holocron plugin — 11 skills, 24 commands, 14 agents, 6 hooks shipped together

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.

agentmods
npx agentmods add commands/atuljha23/holocron/cost
Clone the repo
git clone --depth 1 https://github.com/atuljha23/holocron

Made for: Claude Code.

Or install holocron, the plugin that ships this one along with the rest of its 11 skills, 24 commands, 14 agents, 6 hooks.

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 cost

README.md
[![agentmods](https://agentmods.dev/badge/commands/atuljha23/holocron/cost.svg)](https://agentmods.dev/commands/atuljha23/holocron/cost)
Your own site
<a href="https://agentmods.dev/commands/atuljha23/holocron/cost"><img src="https://agentmods.dev/badge/commands/atuljha23/holocron/cost.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 396 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00037 $0.00396
Opus 5 $0.00018 $0.00198
Sonnet 5 $0.00007 $0.00079
Haiku 4.5 $0.00004 $0.00040

Measured 5d ago against content hash cf74d262fc1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

cost 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 5d 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.

commands/cost.md · 32 lines

What it actually says

/holocron:cost

Show how many tokens you've spent and what it cost.

node "${CLAUDE_PLUGIN_ROOT}/scripts/holocron-cli.js" cost $ARGUMENTS

What you'll see

  • Total cost in $ — summed across all logged sessions in the window
  • Turns, input/output tokens, cache read/write
  • Cache hit rate — the big one. Above ~70% is healthy. Below 50% means something is busting Anthropic's 5-min prompt cache; usually a volatile value (timestamp, random id) in CLAUDE.md or injected context.
  • Per-model breakdown — where the money goes (--breakdown or automatic if multiple models were used)
  • Top-10 sessions by cost (with --by-session)
  • Budget status if configured (set via /holocron:budget)

Defaults

  • --since 30d — last 30 days. Use 7d, all, or a custom window like 3d.
  • Data directory: ~/.holocron/sessions/. If empty, the Stop hook hasn't fired yet — run a Claude Code session, end it, and try again.

Pricing

Rates are hardcoded for Opus/Sonnet/Haiku 4.x (input, output, cache-write at 125% of input, cache-read at 10% of input). Update scripts/holocron-usage.js when Anthropic changes pricing.

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. 5d ago First seen · 32 lines · 0 tokens per session scan A cf74d262fc1e

Subscribe to this mod's changes

cost is a command published in the GitHub repository atuljha23/holocron (2 stars, last pushed 4mo ago), licensed MIT. It adds 37 tokens to every session and 396 once invoked, about $0.0002 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.