Skip to main content

Cost Track

Skill Verified Active

Auto-capture per-session token usage from the Claude Code session jsonl and persist to the cost-tracking namespace

Purpose

To provide a transparent and automated way to track the token usage and associated costs of Claude Code sessions for better budget management and reporting.

Features

  • Auto-capture per-session token usage
  • Persist usage to AgentDB
  • Calculate USD cost based on model pricing
  • Support for environment variable overrides
  • Dry-run capability

Use Cases

  • Capturing spend after a meaningful chunk of work
  • Persisting final tally at session end
  • Periodically capturing costs during long sessions
  • Providing data for cost reporting and optimization tools

Non-Goals

  • Directly managing LLM provider accounts or billing
  • Real-time alerting for budget overruns (this is a producer for other skills)
  • Providing detailed analysis of *why* tokens were used

Workflow

  1. Run the tracker script from the project root
  2. Script auto-discovers session jsonl or uses TRACK_SESSION env var
  3. Calculate cost using defined pricing
  4. Persist structured record to AgentDB cost-tracking namespace
  5. Inspect markdown summary and verify persistence

Practices

  • Cost Tracking
  • Session Management

Prerequisites

  • Claude Code environment
  • Access to session jsonl files
  • AgentDB namespace configured

Code Execution

  • info:ValidationWhile the script's operations are well-defined, explicit input validation using a schema library is not evident for environment variables or session data parsing.
  • info:LoggingThe script provides markdown output for successful runs and can suppress it with `TRACK_QUIET=1`, but detailed audit logging to a specific file is not explicitly mentioned.

Installation

First, add the marketplace

/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-cost-tracker@ruflo

Quality Score

Verified
97 /100
Analyzed about 20 hours ago

Trust Signals

Last commitabout 22 hours ago
Stars50.2k
LicenseMIT
Status
View Source

© 2025 SkillRepo · Find the right skill, skip the noise.