cost-report

cost-report is a command for Claude Code from Peaky8linders/claude-cortex. It costs 8 tokens per session (241 once invoked), scanned A, original, MIT.

A command that summarises the token use and estimated cost of an agent session, including how effectively previously cached context was reused. It also compares recent sessions and gives optimisation suggestions.

In plain words
What is it for?
Use it to review token and cost totals, model breakdowns, cache efficiency, recent-session trends, and recommendations based on observed usage.
Why use it?
It shows where session cost comes from and can reveal inefficient cache use or expensive session patterns. This helps decide whether to combine tasks, resume a session, or start fresh.

Command for Claude Code

Part of the cortex plugin — 1 skill, 15 commands, 3 agents, 5 hooks, 2 MCP servers 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/peaky8linders/claude-cortex/cost-report
Clone the repo
git clone --depth 1 https://github.com/Peaky8linders/claude-cortex

Made for: Claude Code.

Or install cortex, the plugin that ships this one along with the rest of its 1 skill, 15 commands, 3 agents, 5 hooks, 2 MCP servers.

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-report

README.md
[![agentmods](https://agentmods.dev/badge/commands/peaky8linders/claude-cortex/cost-report.svg)](https://agentmods.dev/commands/peaky8linders/claude-cortex/cost-report)
Your own site
<a href="https://agentmods.dev/commands/peaky8linders/claude-cortex/cost-report"><img src="https://agentmods.dev/badge/commands/peaky8linders/claude-cortex/cost-report.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 241 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 $0.00008 $0.00241
Opus 5 $0.00004 $0.00120
Sonnet 5 $0.00002 $0.00048
Haiku 4.5 $0.00001 $0.00024

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

Security

Grade A, and why

cost-report 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.

.claude/commands/cost-report.md · 23 lines

What it actually says

Generate a cost efficiency report for the current session.

Use the cortex_token_timeline MCP tool with the current session, then analyze and present:

  1. Session Cost Summary — total tokens, total estimated cost, breakdown by model
  2. Cache Efficiency — session type (startup/resume), first-turn vs average token ratio, cache miss detection, estimated savings from caching
  3. Cost Recommendations — actionable suggestions based on cache behavior:
    • Whether resume sessions are costing extra due to cache misses
    • Optimal session length based on historical data
    • Sentinel risk if discussing Claude Code internals
  4. Historical Trend — last 5 sessions: cost, tokens, cache efficiency, session type
  5. Optimization Tips — based on observed patterns:
    • Batch small tasks into fewer sessions for better cache utilization
    • Start fresh (not resume) for small quick tasks
    • Use npx @anthropic-ai/claude-code if sentinel risk detected

Format as a clear table with a summary section and actionable next steps.

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 · 23 lines · 8 tokens per session scan A bd299706e219

Subscribe to this mod's changes

cost-report is a command published in the GitHub repository Peaky8linders/claude-cortex (11 stars, last pushed 2mo ago), licensed MIT. It adds 8 tokens to every session and 241 once invoked, about $0.0000 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-30.