tkusage
Unified local usage and estimated cost reporting for Claude Code and Codex.
tkusage is a standalone CLI. It reads local logs directly from ~/.claude/projects and ~/.codex/sessions, so normal report generation is fully offline.
The first run builds a local cache from your transcript/session files. Later runs reuse that cache and are much faster.
Commands
npx tkusage daily
npx tkusage monthly 2026-03 --source codex
npx tkusage session --source all --compact
npx tkusage statusline
Flags
--source all|claude|codex
--since YYYY-MM-DD
--until YYYY-MM-DD
--timezone America/Los_Angeles
--locale en-US
--json
--compact
--breakdown
--claude-home /path/to/.claude
--codex-home /path/to/.codex
--format plain|json
Notes
Cost is an estimated USD equivalent derived from embedded token pricing tables.
- It is not the same thing as your actual ChatGPT/Codex subscription billing or Anthropic invoice.
- Claude usage is deduplicated by
requestId because transcript logs can repeat the same assistant usage entry more than once.