Where did my Claude usage go? See usage by project
Last updated: 30 September 2026 · Deutsch
Claude Code writes every session to a file on your computer, under
~/.claude/projects, one folder per project. Each answer in it
carries its token counts. Add them up per folder and you have your use by
project — once you count each message only once, and only for the last
30 days, because that is how long Claude Code keeps the files by default.
What you did on claude.ai or in the Claude apps is not in there.
This page shows where the numbers sit, the two traps in adding them up, and what no local file can tell you. The facts about Claude Code come from Anthropic's docs, listed at the end.
Where Claude Code writes it down
In the session transcripts under ~/.claude/projects, one folder per project and one JSONL file per session. Each answer from the model carries a usage block with input, output and cache tokens.
- Path:
~/.claude/projects/<project>/<session>.jsonl. The folder name is the project path with slashes turned into dashes, such as-Users-you-work-my-repo. Subagents write to asubagents/folder next to the session. - Format: one JSON object per line. Lines from the model hold a
messagewith itsid, themodeland ausageblock:input_tokens,output_tokens,cache_creation_input_tokens,cache_read_input_tokens. - Plain text: the files are not encrypted. Anything that passed through a tool is in there — file contents, command output, pasted text.
Anthropic documents where the files are and what they hold, not the layout of each line. It can change with any release, so a script that reads them should skip lines it does not know rather than fail.
Why a plain sum is too high
Claude Code can write the same answer to the transcript more than once, for example while it streams or when a session branches. Count each message ID once, or the total comes out far too high.
The same message ID then shows up on several lines, each with a usage block. Keep one line per ID — the one with the largest output — and drop the rest. On my own machine a plain sum came out about 2.7 times too high. Across files the same holds: a resumed or branched session can copy earlier answers into a new file.
30 days, then gone
Only as far as the transcripts go. Claude Code deletes them once they are older than cleanupPeriodDays, which is 30 days by default. Raise that value or keep your own totals if you want more.
- The setting:
cleanupPeriodDaysin~/.claude/settings.json, for example{"cleanupPeriodDays": 90}. The smallest value is 1; 0 is refused. - An exception: sessions you started or last continued in
Claude Desktop or Cowork are kept at any age, unless you set
desktopSessionCleanupPeriodDays(Claude Code 2.1.248 or later). - The price: a longer period keeps more plain text on disk. If you only want the numbers, it is safer to save totals elsewhere and leave the period short.
Tokens by project, roughly
After de-duplication, add the usage per project folder. Three things make the result fairer:
- Worktrees: each worktree gets its own folder. Add those to the repository they belong to.
- Weight, not just count: a million cache reads cost far less than a million output tokens. Pricing each type at API list prices gives a fairer weight. It is a yardstick, not a bill — on Pro or Max you pay no price per token.
- Share of the window, as an estimate: Anthropic does not say how tokens turn into the per cent in your five-hour or weekly window. Any share per project is an estimate, and should be labelled as one.
What stays invisible
Chats on claude.ai and in the Claude apps leave no transcript on your computer. They still draw on the same session and weekly limits, so part of the window can't be traced to a project.
The same goes for Claude Code on another computer, for transcripts already deleted, and for a second account on the same machine. If your window rose more than your local tokens explain, that is usually where the rest went.
In AI Cockpit
From Mac 6.8, the Usage window does this work for you. It shows where your Claude and Codex quota went — by project, model, effort and hour, up to 365 days back.
- Two measures side by side: raw tokens and the equivalent at API list prices, labelled as not an invoice.
- Estimated share of the five-hour and seven-day windows, plus a weekday × hour heatmap.
- Counted once: answers are de-duplicated by message ID. Worktrees count toward their parent repository.
- Past the 30 days: the app reads back what Claude Code still keeps and from then on saves the totals itself — numbers only, stored locally, never the text of your sessions.
- Create analysis saves a self-contained HTML report; CSV export too. Project names can be anonymised.
The window is on the Mac only; it reads files on the machine. The limits themselves — how full each window is and when it resets — are covered in Monitoring Claude usage limits.
Short answers
Where does Claude Code store my token usage?
In the session transcripts under ~/.claude/projects, one folder per project and one JSONL file per session. Each answer from the model carries a usage block with input, output and cache tokens.
Why does my token total come out too high?
Claude Code can write the same answer to the transcript more than once, for example while it streams or when a session branches. Count each message ID once, or the total comes out far too high.
How far back can I see my Claude Code usage?
Only as far as the transcripts go. Claude Code deletes them once they are older than cleanupPeriodDays, which is 30 days by default. Raise that value or keep your own totals if you want more.
Why doesn't my use of claude.ai show up?
Chats on claude.ai and in the Claude apps leave no transcript on your computer. They still draw on the same session and weekly limits, so part of the window can't be traced to a project.
Sources
Anthropic changes Claude Code often; the pages below were checked on 29 September 2026.
- Explore the .claude directory — transcripts, retention, plain-text storage
- Settings reference: cleanupPeriodDays
- Use Claude Code with your Pro or Max plan — shared limits