cchour scans the session logs already sitting on your machine, computes your real active hours, and renders one beautiful self-contained HTML report — daily, weekly, monthly, hour-of-day, by project and by category.
npx cchour --open
How it works
Streams every session log in ~/.claude/projects and ~/.codex/sessions with a timestamp regex — no JSON parsing. Hundreds of MB take about a second.
Adjacent events ≤ 15 minutes apart count as continuous work; longer gaps mean you stepped away. Parallel sessions are unioned, never double-counted.
One self-contained HTML file: daily / weekly / monthly stacked bars, hour-of-day distribution, work categories, top projects. Or --json for scripts.
Features
cchour --week last is last Mon–Sun in one line. --month 2026-05 is a specific month. Charts anchor to the range.
--since / --until filter events by local-time date before any stats are computed — totals, charts and projects all follow.
cchour --json | jq '.tools["Claude Code"].hours' — per-tool totals, all buckets, categories and per-project rows on stdout.
Ordered keyword rules in ~/.cchour/categories.json map projects to categories — content-level matching rescues sessions started in stray directories.
Everything runs on your machine and stays there. The report is a local file. Nothing is uploaded anywhere, ever.
Plain Node ≥ 18, no install needed with npx cchour. The whole tool is one small binary-free package.
CLI
Run it bare and get ./cchour-report.html. Add --open to pop it in your browser. Everything else is just narrowing the question.
npm i -g cchour
MIT licensed · star it on GitHub · npm