Where does Claude Code keep its logs?

Under ~/.claude/projects/ on your Mac. There is one folder per project directory and one file per session, and they hold everything needed to work out where your tokens went.

The layout

~/.claude/projects/
  <project folder>/
    <session id>.jsonl            the main session
    <session id>/subagents/
      agent-<id>.jsonl            one file per subagent

Each file is a list of records, one per line. The useful ones for cost are the assistant replies. Each carries a timestamp, the model, and a usage block with four counts: fresh input, input written to the cache, input read from the cache, and output.

What you can work out

Two traps

Codex keeps logs too

Codex writes its sessions under ~/.codex/sessions/, grouped by date. Each model reply has a usage record with input, cached input and output counts. In those records the input figure already includes the cached part, which is the opposite of how Claude Code records it.

Reading them without writing a script

Cost Doctor reads both sets of logs, counts each reply once, includes subagents, and shows the result in the menu bar. It only reads the files; it never changes a session.

See it on your own sessions

Cost Doctor is a Mac menu bar app that reads the logs Claude Code and Codex already write. It names the session that is using your tokens, says why, and turns your screen red when a check fails while an agent sits waiting. Nothing leaves your Mac.

Download the free trialHow it works

14 days free, no account. Then $19 once, plus tax where it applies. For Apple silicon and Intel Macs on macOS 13 or later.