claude-cost-tracker

claude-cost-tracker is a skill for Claude Code, Codex from tellmefrankie/news-engine. It costs 0 tokens per session (692 once invoked), scanned A, original, MIT.

A cost tracker for the Anthropic API, the service used to send requests to Claude models. It groups spending by project, model, task type, and date range.

In plain words
What is it for?
Use it to review spending, flag expensive calls, estimate monthly costs from the current daily rate, and identify tasks that might use a less expensive model.
Why use it?
It shows where API budget is being spent and highlights costly requests before they become an unexpected bill.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to review spending, flag expensive calls, estimate monthly costs from the current daily rate, and identify tasks that might use a less expensive model.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tellmefrankie/news-engine/claude-cost-tracker
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 tellmefrankie/news-engine --skill claude-cost-tracker
Clone the repo
git clone --depth 1 https://github.com/tellmefrankie/news-engine

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 claude-cost-tracker

README.md
[![agentmods](https://agentmods.dev/badge/skills/tellmefrankie/news-engine/claude-cost-tracker/github.svg)](https://agentmods.dev/skills/tellmefrankie/news-engine/claude-cost-tracker)
Your own site
<a href="https://agentmods.dev/skills/tellmefrankie/news-engine/claude-cost-tracker"><img src="https://agentmods.dev/badge/skills/tellmefrankie/news-engine/claude-cost-tracker/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 claude-cost-tracker

Your own site · 80×15
<a href="https://agentmods.dev/skills/tellmefrankie/news-engine/claude-cost-tracker"><img src="https://agentmods.dev/badge/skills/tellmefrankie/news-engine/claude-cost-tracker.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 692 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 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.00000 $0.00692
Opus 5 $0.00000 $0.00346
Sonnet 5 $0.00000 $0.00138
Haiku 4.5 $0.00000 $0.00069

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

Security

Grade A, and why

claude-cost-tracker 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 11d 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.

skills/claude-cost-tracker/SKILL.md · 86 lines

How it starts

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

Claude API Cost Tracker

Track your Anthropic API spend by project, model, and task type. Know exactly what each feature costs before it ships.

What it does

  • Pulls usage data from Anthropic API billing endpoint
  • Breaks down cost by: project, model (Opus/Sonnet/Haiku), date range
  • Flags expensive operations (prompts > $0.10 per call)
  • Projects monthly spend from current daily burn rate
  • Identifies which tasks are best candidates for model downgrade (Opus → Sonnet)

Usage

Check my Claude API costs for this week.
Break down by: model, project tag, daily trend.
Flag any single calls over $0.05.
Project monthly spend at current rate.
Suggest which tasks could switch from Opus to Sonnet without quality loss.

Example Output

Claude API Cost Report — Week of May 13, 2026

TOTAL THIS WEEK: $4.23
  Opus 4.5:    $3.10  (73%)  — news analysis pipeline
  Sonnet 4.5:  $0.89  (21%)  — investment briefing
  Haiku 4.5:   $0.24   (6%)  — price monitor checks

DAILY BURN: $0.60/day
MONTHLY PROJECTION: ~$18/month

TOP EXPENSIVE CALLS (this week):
  $0.14 — filter.ts:45 — 50-article importance ranking prompt
  $0.09 — analyze.ts:88 — per-article deep analysis (x5 articles)
  $0.04 — briefing.ts:12 — portfolio summary generation

OPTIMIZATION SUGGESTIONS:
  filter.ts ranking prompt: Switch to Sonnet — saves ~$0.06/day ($1.80/month)
  Confidence: HIGH — filtering is structured JSON output, not nuanced reasoning

  price monitor heartbeat: Already on Haiku — optimal

Model Downgrade Analysis

The skill evaluates each prompt type against downgrade criteria:

Task type Opus needed? Recommendation
Structured JSON extraction No → Sonnet
Importance ranking (1-5) No → Haiku
Nuanced sentiment analysis Yes Keep Opus
Code generation Situational Test Sonnet first
Multi-step reasoning chains Yes Keep Opus

Configuration

Track Claude costs:
API key: (reads from ANTHROPIC_API_KEY env)
Date range: last 7 days
Group by: model, then by file/prompt tag
Budget alert: warn if projected monthly > $30
Downgrade candidates: flag any Opus task where Sonnet could substitute

Read the full file on GitHub · 86 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. 11d ago First seen · 86 lines · 0 tokens per session scan A 9bd25eff2387

Subscribe to this mod's changes

claude-cost-tracker is a skill published in the GitHub repository tellmefrankie/news-engine (1 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 692 tokens. 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.