cost-track
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.
More from ruvnet/ruflo
agent-swarm
Agent skill for swarm - invoke with $agent-swarm
402agent-workflow
Agent skill for workflow - invoke with $agent-workflow
402workflow-automation
>
390agent-arch-system-design
Agent skill for arch-system-design - invoke with $agent-arch-system-design
385security-audit
>
375agent-architecture
Agent skill for architecture - invoke with $agent-architecture
354