cost-tracking
Track and report Claude Code token usage, spending, and budgets from the local ECC cost-tracker metrics log. Use when the user asks about costs, spending, usage, tokens, budgets, or cost breakdowns by model, session, or date.
- Kind
- Skill
- Works with
- Claude Code, Codex
- Source
- affaan-m/ECC @ d3b8a3e90890
- Path
- skills/cost-tracking/SKILL.md
- Topics
- Data analysis & BI, Web research
Credit
- Made by
- affaan-m
- Original
- github.com/affaan-m/ECC/blob/d3b8a3e908904e242ed2dbe66af62cca…
- License
- MIT
Listed by Skill Manifest; not made by us.
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
- Adds
- .claude/skills/cost-tracking/ (the skill folder)
- Runs scripts
- Yes
- shell block in the text
- Uses the network
- None found
- Needs secrets
- None found
- Reads outside the project
- ~/.claude/metrics/costs.jsonl (SKILL.md)
- ~/.claude/metrics/cost-snapshots/ (SKILL.md)
- Calls other skills
- /cost-report
- Source revision
- d3b8a3e90890
- Licence
- MIT
- Last activity
- 23 Nov 2026
- Source changed after the scan
- Yes
- Last push 23 Nov 2026, scanned 3 Nov 2026; read it again before you rely on this scan
- Review
- Reviewed
Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.
# 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: | Field | Meaning | | --- | --- | | `timestamp` | ISO timestamp of the snapshot | …