DEV Community

Cover image for How I Track Claude Code Costs Across Multiple PCs
Ryan Barbosa
Ryan Barbosa

Posted on

How I Track Claude Code Costs Across Multiple PCs

The Problem

Claude Code logs your usage locally in JSONL files. CLI tools like ccusage and ccost read these files beautifully — but only on one machine at a time.

If you use Claude Code on multiple PCs (work laptop, home desktop, cloud VM), you have a problem: Anthropic's rate limits are per account, not per machine. Without aggregation, you're flying blind:

  • No idea how close you are to your 5-hour block limit across machines
  • No way to compare daily spending between workstations
  • No centralized view of total cost
  • No historical trends across your entire usage footprint

I hit this wall myself. I use Claude Code on my work laptop and home desktop. Every time I ran ccusage it only showed me half the picture.

So I built claude-telemetry.

The Solution

Claude-telemetry is the aggregation layer that sits on top of existing tools like ccusage. The architecture is dead simple:

Claude-telemetry Architecture

A lightweight Python agent runs on each PC. Every 15 minutes, it calls ccusage to extract usage data, then syncs the results to a Supabase database. A React dashboard hosted on Cloudflare Pages shows everything aggregated.

The agent does no custom JSONL parsing. It delegates entirely to ccusage. I didn't want to reinvent the data extraction layer — ccusage already does that perfectly. I wanted to build the multi-PC aggregation that was missing.

Key Features

Multi-PC Aggregation

Total cost across all your machines, broken down by day, week, project, model, or session. Filter by individual machine or see everything combined.

Dashboard overview with total cost, daily chart, and machine cards

5-Hour Blocks Tracking

Claude Code's billing operates on 5-hour rolling windows. The dashboard shows your active block in real-time with burn rate (tokens/min) and projected end-of-block cost. Past blocks are visualized in a timeline with overlap detection — useful when you're using multiple machines simultaneously and consuming the same rate limit.

5-hour blocks page showing active block, timeline, and burn rate

Rate Limit Progress Bars

Visual 5-hour and weekly rate limit progress in the Overview. Green/yellow/red indicators based on usage percentage. Pulled from ccost sl data.

Plan vs API Cost Comparison

This is my favorite feature. Set your subscription tier (Pro $20, Max5x $100, Max20x $200) and the dashboard shows you how much you'd be paying if you were on the API directly. Most Max users are saving 80-95% vs API pricing — it's nice to actually see the value.

Project Budget Tracker

Set monthly spending limits per project. Get visual progress bars and alerts when you hit 90% or 100% of budget. Useful if you're working on multiple clients or want to keep certain projects in check.

Usage Pace Calculator

Daily averages with trend detection (increasing/stable/decreasing). Projects what you'll spend by week's end at the current pace.

Cross-Machine Insights

Combined metrics across all machines, with breakdowns by machine. See which PC is your "top spender" and which projects are consuming the most across your fleet.

Insights page with usage pace, budget alerts, and rate limit warnings

Tech Stack

  • Agent: Python 3.11+ (calls ccusage, syncs to Supabase)
  • Database: Supabase (PostgreSQL, free tier — 500 MB)
  • Backend API: Cloudflare Pages Functions (Workers)
  • Frontend: React 18 + Vite + Recharts + TailwindCSS
  • Hosting: Cloudflare Pages (free, global CDN)
  • Auth: Supabase Magic Link + email whitelist
  • Security: Row-Level Security on all tables, zero exposed keys (Worker proxy)

Total monthly cost: $0. Everything runs on free tiers. For personal use you'll never exceed the limits.

How to Set Up

  1. Create a Supabase project (free tier) and run the SQL migrations
  2. Deploy the dashboard to Cloudflare Pages with wrangler
  3. Install the agent on each PC: pip install -e . + claude-tracker setup + claude-tracker install-service

Full installation guide: https://claude-telemetry.ryanbarbosa.com/guide/installation

What's Next

v0.3.0 is in planning:

  • MCP Server — query your usage data directly from Claude Code via Model Context Protocol
  • Team Dashboard — multi-user support with admin roles
  • Notifications — email/webhook alerts for budget overruns
  • Codex/OpenCode support — beyond Claude Code

Try It

If you use Claude Code on more than one machine, I'd love to hear your feedback. Open an issue on GitHub or drop a comment here.

And if it saves you from rate limit blindness, consider buying me a coffee

Top comments (0)