How to Track AI Coding Costs by Repository
Start with the repository total and follow the cost to a session and the commands it ran. This walkthrough uses RepoSpend’s fictional Middle-earth demo.
Find the repo driving the total
Open Repos / folders and sort by estimated cost. In the demo, one-ring-infra shows $38.71 across two sessions. Its top session accounts for $32.91, about 85% of the known cost. Open that session from Needs review.

Check the session’s model and cache use
Open Tokens & Cost to see how much input was served from cache and how much was billed as regular input or written to cache. For a session that switches models, RepoSpend prices each recorded request using the model active at that point.
For example, a Standard GPT‑6.2 Sol request with 20,000 input tokens, including 15,000 cache reads, and 2,000 output tokens is $0.0315. The same request on GPT‑6.2 Astra is $0.126. A session with one request on each sums to $0.1575 at published rates. Try the token calculator or check the OpenAI rate card.
Inspect the repeated command
Open Files & Commands in the session or go to Agent Friction. In the demo, pnpm test --filter one-ring-infra flags a repeated failing shard. Inspect the recorded evidence before deciding whether the command needs a fix.

Run it with your own usage
ccusage is useful for daily or project reports in the terminal. RepoSpend opens a local dashboard to drill into a Git repository’s sessions, token shape, and command evidence.
Use Node.js 22.12 or later. Run npx repospend doctor to check source coverage, missing token breakdowns, and estimates that use inherited pricing.