Claude Code Source
Default locations
Section titled “Default locations”~/.claude/projects/**/*.jsonl~/.claude/transcripts/**/*.jsonl
When CLAUDE_CONFIG_DIR is set, the projects and transcripts directories under it replace ~/.claude. A comma-separated value scans several config directories.
Override
Section titled “Override”llm-usage daily --claude-dir /path/to/.claude/projects# orllm-usage daily --source-dir claude=/path/to/.claude/projects# several directories (repeat the flag)llm-usage daily --claude-dir /work/.claude/projects --claude-dir /home/me/.claude/projectsParsing notes
Section titled “Parsing notes”The adapter reads Claude Code assistant transcript rows with message.usage, including nested subagent transcripts.
cache_creation.ephemeral_1h_input_tokens, when present, marks the part of cache_creation_input_tokens written to the one-hour cache, which is priced at the one-hour rate (see Pricing). output_tokens already includes extended thinking; output_tokens_details.thinking_tokens, when present, fills the reasoning breakdown without changing output, total, or cost.
Streaming/update rows are de-duplicated by message id plus request id, so only the final observed usage row per request is counted while retries count separately.
Forked subagents (isFork in the agent-<id>.meta.json sidecar) begin with a replay of their parent’s conversation; rows whose message id and request id also appear in the parent transcript (parentAgentId, or the main session transcript) are skipped because the parent already counts them. This applies only when the parent lies under a scanned Claude directory; otherwise the replayed rows are kept.
A session continued in a new session (Claude Desktop records continuedInSessionId in the original) starts a new transcript that copies the rows since the last compaction under the new session id. A row that several sessions hold with the same timestamp, model and usage is counted once, in the session whose first event is earlier (the lower session id on a tie), so the new session reports only its own usage. This also covers a session that has since been deleted and is served from history, and Claude transcripts of other machines.
A row’s project (repoRoot) is its cwd. Rows that declare a provider keep it; others get one inferred from the model name (anthropic for Claude models).