How to get Anthropic Claude Code Usage Locally
Getting aggregated usage cost in Claude Code is not straight forward.
However, all the interaction that you do with Claude Code is stored in ~/.claude/
directory which also includes date, model used, token usage, etc.
With these information we can get the high level overview of it.
You can also use ccusage - npm to get a really good report in a nice format
npx ccusage@latest
Like this 👇
This is especially useful if you do not have access to view those information in Anthropic console.
You can checkout their docs to learn more about the filters supported in ccusage
Happy measuring cost!
Was this content helpful?
Help us improve by giving us your feedback.