
Cost Tracking
Queries a local SQLite database to show you how much you've spent on Claude Code sessions, broken down by project, tool, date, or session. Assumes you're already running a cost tracking hook that logs token usage to `~/.claude-cost-tracker/usage.db`. The queries are straightforward: today versus total, top projects by cost, seven-day trends, session drilldowns. It won't guess at pricing or make up data if the database is missing. Salvaged from a stale community PR, so it's narrow in scope but does one thing cleanly if you have the infrastructure in place.
- skills.sh installs
- 1.6K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill cost-tracking --agent claude-codeInstalls into .claude/skills of the current project.
Files
Cost Tracking
Use this skill to analyze Claude Code cost and usage history from the metrics log
that ECC's stop:cost-tracker hook writes.
Where the data lives
The tracker appends one JSON object per session-stop to
~/.claude/metrics/costs.jsonl. Each row is a cumulative snapshot for that
session, so to total spend you take the latest row per session_id and
sum across sessions — summing every row multiply-counts.
ECC also maintains internal per-session files under
~/.claude/metrics/cost-snapshots/ so runtime hooks can read the current
session total without rescanning all history. Treat those files as a
rebuildable cache; each snapshot stores a byte cursor so only newly appended
rows are scanned. Stable reads are O(1), while updates are O(new bytes). Stale
entries are pruned after 30 days or when the directory exceeds 512 sessions.
Cold catch-up work is limited to 16 MiB per hook invocation, and malformed
unterminated rows larger than 1 MiB are discarded with a resumable cursor.
Reports and exports should continue to use costs.jsonl.
Row schema:
Sponsors
Details
- Repository
- github.com/affaan-m/everything-claude-code
- First seen
- Jun 3, 2026
More from affaan-m/everything-claude-code
All 256- Fsharp Testing1.6K
- Gget1.6K
- Homelab Pihole Dns1.6K
- Homelab Vlan Segmentation1.6K
- Homelab Wireguard Vpn1.6K
- Mle Workflow1.6K
- Motion Foundations1.6K
- Motion Patterns1.6K
- Quarkus Patterns1.6K
- Quarkus Security1.6K
- Quarkus Tdd1.6K
- Quarkus Verification1.6K
- Skill Scout1.6K
- Uspto Database1.6K
- Prisma Patterns1.4K
- Blender Motion State Inspection1.3K
- Recsys Pipeline Architect1.3K
- Uncloud1.2K
- React Testing910
- React Performance903
- React Patterns893
- Frontend A11y870
- Marketing Campaign827
- Benchmark Optimization Loop826