cost-report

cost-report is a command for Claude Code from Fmarzochi/EGC. It costs 25 tokens per session (1,244 once invoked), scanned A, a copy of cost-report, Apache-2.0.

A report generated from a local SQLite database that records Gemini CLI usage costs. It summarizes spending by day, project, tool, and session, and can export recent records as CSV.

In plain words
What is it for?
Use it to review development-tool spending, compare costs across projects or sessions, or export usage data for further analysis.
Why use it?
It makes local usage spending visible instead of requiring developers to inspect raw database rows. It also clearly reports when the required cost tracker or database is not set up.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code; mentions OpenCode.

Part of the egc plugin — 49 skills, 83 commands, 61 agents, 8 hooks shipped together

Good fit Use it to review development-tool spending, compare costs across projects or sessions, or export usage data for further analysis.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fmarzochi/egc/cost-report
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.

Clone the repo
git clone --depth 1 https://github.com/Fmarzochi/EGC

Made for: Claude Code.

Or install egc, the plugin that ships this one along with the rest of its 49 skills, 83 commands, 61 agents, 8 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-report

README.md
[![agentmods](https://agentmods.dev/badge/commands/fmarzochi/egc/cost-report/github.svg)](https://agentmods.dev/commands/fmarzochi/egc/cost-report)
Your own site
<a href="https://agentmods.dev/commands/fmarzochi/egc/cost-report"><img src="https://agentmods.dev/badge/commands/fmarzochi/egc/cost-report/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 cost-report

Your own site · 80×15
<a href="https://agentmods.dev/commands/fmarzochi/egc/cost-report"><img src="https://agentmods.dev/badge/commands/fmarzochi/egc/cost-report.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,244 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.
Origin 89% copy Near-identical to another mod 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.00025 $0.01244
Opus 5.5 $0.00010 $0.00498
Sonnet 5.5 $0.00005 $0.00249
Haiku 4.5 $0.00003 $0.00124

Measured 1mo ago against content hash 55db1b4992df, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

Origin

This is a copy

89% identical to cost-report — 130 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

commands/cost-report.md · 114 lines

How it starts

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

Cost Report

Present a spending and usage report from metrics/costs.jsonl, the file EGC's stop:cost-tracker hook (scripts/hooks/cost-tracker.js) appends one JSON line to at every session stop. EGC keeps no cost database. The cost-tracking skill covers the file in depth; this command is the short report.

What This Command Does

  1. Find metrics/costs.jsonl and check that jq is available.
  2. Summarize today, yesterday, the total, the rows and the sessions.
  3. Break the estimate down by model and by session, and list the last seven days.
  4. With the csv argument, export the most recent rows.

Find the Ledger

for dir in "${EGC_DIR:-}" ~/.claude ~/.cursor ~/.gemini ~/.codeium/windsurf ~/.config/opencode ~/.config/zed \
  ~/.agents ~/.amp ~/.continue ~/.github ~/.kiro ~/.trae ~/.trae-cn ~/.codebuddy; do
  [ -n "$dir" ] || continue
  [ -f "$dir/metrics/costs.jsonl" ] && echo "costs: $dir/metrics/costs.jsonl"
done
test -f ~/.egc/metrics/costs.jsonl && echo "costs: ~/.egc/metrics/costs.jsonl"
command -v jq >/dev/null && echo "jq available" || echo "jq missing"

Set COSTS to the file found: EGC_DIR first, then the directory of the tool you are running in, then ~/.egc. If there is none, tell the user cost tracking is not active for this tool (Claude Code and Cursor run the cost tracker, and EGC_DISABLED_HOOKS can turn it off) and stop: do not invent figures. The queries below read the file with cat and pipe it into jq, because the Guardian lets the agent read ~/.egc/metrics but refuses jq naming a path there.

Each line holds timestamp (ISO 8601, UTC), session_id, model, input_tokens, output_tokens and estimated_cost_usd.

Summary

cat "$COSTS" | jq -s '(now | strftime("%Y-%m-%d")) as $today
  | ((now - 86400) | strftime("%Y-%m-%d")) as $yesterday
  | {
      today: (map(select(.timestamp | startswith($today)) | .estimated_cost_usd) | add // 0),
      yesterday: (map(select(.timestamp | startswith($yesterday)) | .estimated_cost_usd) | add // 0),
      total: (map(.estimated_cost_usd) | add // 0),
      rows: length,
      sessions: (map(.session_id) | unique | length),
      rows_without_tokens: (map(select(.input_tokens == 0 and .output_tokens == 0)) | length)
    }'

Read the full file on GitHub · 114 lines

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. 1mo ago Changed · +6 lines · +10 tokens per session 55db1b4992df
  2. 2mo ago First seen · 108 lines · 15 tokens per session scan A 48f48ebb5f3e

Subscribe to this mod's changes

cost-report is a command published in the GitHub repository Fmarzochi/EGC (70 stars, last pushed yesterday), licensed Apache-2.0. It adds 25 tokens to every session and 1,244 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 89% identical to cost-report, differing in 130 lines, and is treated as a copy.

Related

cost-report compared with commands from other repositories

cost-report next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cost-reportFmarzochi/EGCCommand70yesterdayApache-2.0A25Claude Code
checklistgithub/spec-kitCommand153k3d agoMITA13Claude Code
clarifygithub/spec-kitCommand153k3d agoMITA27Claude Code
analyzegithub/spec-kitCommand153k3d agoMITA26Claude Code
specifygithub/spec-kitCommand153k3d agoMITA13Claude Code
convergegithub/spec-kitCommand153k3d agoMITA35Claude Code
implementgithub/spec-kitCommand153k3d agoMITA14Claude Code