Guide
See Claude Code Cost per Project on Mac
Which repository used your Claude Code plan this week? How to break usage down by project, from a quick terminal report to a full drilldown.
Updated by Pulkit
The short answer
Claude Code writes a transcript for every session on your Mac, and each transcript records the folder it ran in and the tokens every request used. Group those by repository and you have cost per project. Claude Code's own /usage shows the current session; the free ccusage tool groups Claude Code usage by project in the terminal; Edith's Usage extension groups every session, worktree and chat under its GitHub repository and keeps a drilldown you can filter by day, model and agent.
Who needs this
- Freelancers and agencies who want to show a client how much agent work went into their project, or to pass on API costs.
- Teams on API keys who split spend between products.
- Anyone who ran out of a weekly limit and wants to know which repository did it. See how to pace the Claude Code weekly limit for the other half of that problem.
Method 1: /usage in each session
Built into Claude Code
Check the session cost before you exit
/usage (also /cost) shows the cost of the current session alongside your plan limits, as listed in Anthropic's commands reference. If you run one session per project and write the number down, that is a per-project cost. It does not add sessions up, and it forgets them once they end.
Method 2: ccusage project reports
Free, open source
Group a report by project
ccusage is free and MIT licensed. Its README (checked December 2026) documents a --instances flag that groups Claude Code usage by project, a --project filter for one project, and --json output for scripts:
npx ccusage claude daily --instancesnpx ccusage claude daily --project myproject --jsonIt is a good fit for a quick report or an invoice script, and it costs nothing. It groups by the project folder Claude Code recorded, so whether worktrees and second clones of one repository end up together depends on how Claude Code named them.
Where these fall short
- Worktrees split a project. Parallel agents in
.claude/worktreesor sibling folders can show up as different projects. - Folders are not repositories. The same repository cloned twice, or on two machines, is two folders.
- Claude Code is not the only agent. If Codex also worked on the project, a Claude-only project view leaves it out.
The Edith way: the project drilldown
Usage reads the transcripts Claude Code keeps on your Mac, plus Codex, Cursor, OpenCode and other agents, and matches each session's folder to its GitHub repository. Every worktree and every clone of a repository rolls up into one row. Only token counts, model names, timestamps, folders and short chat titles are used; your prompts and code are not.
- 1
Install Usage and collect your history
Open Library in Edith, find Usage and press Install. Open the Usage page and press the refresh button in the page header. The first run reads every transcript on this Mac and can take a few minutes.
- 2
Open the By project card
Pick a range in the filters at the top of the page, then scroll to By project and press Show repositories. Each row is one repository with its Tokens, Cost, % share, Days, Time spent and Last used. Click a column header to sort, for example by Cost to put the most expensive project first.
- 3
Drill into one repository
Expand a repository to see its folders, worktrees and individual chats, each with tokens and estimated cost, so you can see which branch or which agent run was the expensive one.
- 4
Act on a row
Right-click a repository for Open repository or Copy repository link, or a chat for Copy chat ID, handy when you write up a client report.
Folders without a GitHub remote
Not every folder is a clean clone. After each refresh, Usage moves a folder with no GitHub remote under a repository when its name or path clearly names exactly one of your known repositories, ignoring suffixes such as -main or -fix. Moved folders are marked attributed by name in the drilldown. If you set up the optional Jev extension, it can suggest a match for the rest. Moving a folder only moves its cost between rows; the overall total never changes.
Anything that cannot be tied to a folder reliably, such as some Cursor usage that has no local chat on this Mac, stays in an Unattributed row, so the project list always adds up to the same total as the rest of the page.
Projects across agents and machines
Because Usage reads more than Claude Code, the project row for a repository includes Codex, OpenCode and other agents that worked in it. Use the agent filter at the top of the page to show only Claude Code. And if the same repository is cloned on a server you added in Machines, ticking that machine under Collected over SSH in Usage settings and pressing Collect now adds its sessions to the same row.
From the terminal
For invoice scripts and spreadsheets, the same drilldown prints JSON with --json, and attribution shows or resets how folders were matched:
ed usage projects list --range month --limit 10ed usage projects show my-app --range monthed usage projects list --range month --jsoned usage attribution lsCommon questions
Can Claude Code show cost per project by itself?
Not across sessions. /usage covers the session you are in. You need a tool that reads the saved transcripts to total past sessions by project.
Does a subscription make the cost meaningless?
No. You do not pay it, but it is a consistent measure of how much of your plan each project used, and it is what the same work would cost on an API key.
Are worktrees counted under their repository?
Yes. Worktrees from claude --worktree, git worktrees and clones with the same GitHub remote all roll up into one repository row, with each worktree listed underneath.
Get started
Usage is included with Edith, a Mac app for macOS 14 or later on Apple silicon, sold as a one-time purchase. Pair it with Code Review to read what the agents changed in each worktree, see how to track every coding agent in one view, or compare with the free terminal route on our ccusage alternative page.