AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Cost Tracking

skill-jbdamask-john-claude-skills-cost-tracking · by jbdamask

Track API token costs for specific operations in Claude Code. Use when the user invokes /cost-tracking to start measuring costs, or says "stop tracking", "stop cost tracking", or "how much did that cost" to stop and calculate. Tracks input, output, and cache tokens per API call and calculates USD cost using current Anthropic pricing.

No reviews yet
0 installs
33 views
0.0% view→install

Install

$ agentstack add skill-jbdamask-john-claude-skills-cost-tracking

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-jbdamask-john-claude-skills-cost-tracking)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Cost Tracking? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Cost Tracking

Track the exact token cost of any Claude Code operation by marking a start and stop point in the session JSONL.

Start Tracking

When the user invokes /cost-tracking:

  1. Determine the current session JSONL path. It lives at:

`` ~/.claude/projects//.jsonl ` Find the project directory by looking for the most recently modified .jsonl file under ~/.claude/projects/. The project hash is a mangled version of the working directory path (slashes replaced with dashes, e.g., -Users-johndamask-myproject`).

  1. Determine the cost tracking output directory:

`` ~/.claude/projects//cost-tracking/ ``

  1. Run the start script:

``bash python3 /scripts/start_tracking.py ``

  1. Store the returned tracking_id — mention it to the user and remember it for the stop step.
  1. Confirm: "Cost tracking started. I'll calculate costs when you say 'stop tracking'."

Stop Tracking

When the user says "stop tracking", "stop cost tracking", or asks about the cost:

  1. Run the stop script with the tracking_id from the start step:

``bash python3 /scripts/stop_tracking.py ``

  1. The script outputs a formatted cost report and writes:
  • tokens.jsonl — per-entry token log with timestamp, model, inputtokens, outputtokens
  • summary.json — aggregated cost breakdown by model
  1. Present the report to the user.

Pricing

Pricing is stored in resources/pricing.json (last updated 2026-03-08, source: https://platform.claude.com/docs/en/about-claude/pricing). The stop script loads this file at runtime. It distinguishes between 5-minute and 1-hour cache writes using the cache_creation.ephemeral_* fields in the session JSONL. If pricing appears stale, fetch the pricing page and update resources/pricing.json.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.