Tokentrail


The bill arrived as one number.
Claude Code writes a log of every session to your Mac, but the invoice is a single total. I could not say which feature, branch, or pull request the money had gone to.

Follow the trail from session log to feature.
A command-line tool that reads the logs already on disk, ties each session to its git branch and pull request, and rolls the cost up by feature. The ledger is one SQLite file. Nothing leaves the machine unless you turn on Notion sync.




A dashboard, a menu bar, and a nudge when something looks off.
A local web dashboard and a native macOS menu-bar app show the spend by day, project, and feature. A "worth a look" list flags hot sessions, spike days, and features burning more than they should. It reads Claude Code, Cursor, and GitHub Copilot usage, and an optional model, hosted or local, groups busy features by topic.
Open source, one line to install, and open on my Mac every day.

Tokentrail is free under the MIT license and installs from Homebrew. Version 0.17 shipped in August 2026 with 27 commands and 67 test files behind it. It is how I keep my own AI spend tied to the work it paid for.
From the storyboard



End credits · The stack
- Command line
- TypeScript, Node, Commander
- The ledger
- SQLite, on your machine
- Dashboard
- Fastify and uPlot
- Menu bar
- SwiftUI and Swift Charts
- Sources
- Claude Code, Cursor, GitHub Copilot
- Integrations
- Notion and GitHub
- Topic grouping
- OpenRouter or Ollama, optional
- Distribution
- Homebrew, MIT license
Not if you want something like this.