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.

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.

Tokens by project, roughly

After de-duplication, add the usage per project folder. Three things make the result fairer:

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.

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.

Related questions