
Cost Track
After every Claude Code session, you're left wondering what you just spent on API calls. This skill solves that by reading the session jsonl, tallying token usage per model (including prompt cache hits), calculating actual USD cost from Anthropic's pricing tiers, and persisting everything to the cost-tracking namespace so other skills like cost-report can query it. Run it after a chunk of work or at session end. The markdown output shows per-model breakdowns and cache efficiency. Honest take: if you're working on anything beyond hobby scripts, this is table stakes for not getting surprised by your bill.
- skills.sh installs
- 685
- GitHub stars
- 81.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add ruvnet/ruflo --skill cost-track --agent claude-codeInstalls into .claude/skills of the current project.
Files
Cost Track
Reads the active Claude Code session jsonl (~/.claude/projects/<encoded-cwd>/<session>.jsonl), tallies assistant-message usage per model, computes USD cost using REFERENCE.md pricing, and writes a structured record to the cost-tracking AgentDB namespace. This is the producer that gives cost-report and cost-optimize real data to consume.
When to use
- After a meaningful chunk of work, to capture spend for the report.
- At session-end to persist the final tally.
- Periodically during long sessions (cron-friendly — see
/loop 30m).
Steps
-
Run the tracker from the project root:
node plugins/ruflo-cost-tracker/scripts/track.mjsThe script auto-discovers the session jsonl from the current working directory. To pin a specific session:
TRACK_SESSION=/path/to/session.jsonl. To dry-run (no memory write):TRACK_DRY_RUN=1. -
Inspect the markdown summary — total cost, per-model and per-tier breakdowns, and the persisted memory key.
Sponsors
Details
- Repository
- github.com/ruvnet/ruflo
- First seen
- Jun 3, 2026
More from ruvnet/ruflo
All 236- Cost Booster Route684
- Cost Federation684
- Cost Summary684
- Intelligence Transfer684
- Vector Setup684
- Cost Trend683
- Cost Conversation682
- Cost Export681
- Cost Benchmark679
- Cost Booster Edit679
- Browser674
- Witness656
- AgentDB Advanced Features
- AgentDB Learning Plugins
- AgentDB Memory Patterns
- AgentDB Performance Optimization
- AgentDB Vector Search
- Hooks Automation
- Pair Programming
- ReasoningBank Intelligence
- ReasoningBank With AgentDB
- Skill Builder
- V3 CLI Modernization
- V3 Core Implementation