for Claude Code & Codex

Where did your AI coding hours actually go?

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
100% local — nothing uploaded zero dependencies Node ≥ 18

See a real report from my machine →

How it works

Your logs already know.
cchour just asks them.

1

Scan

Streams every session log in ~/.claude/projects and ~/.codex/sessions with a timestamp regex — no JSON parsing. Hundreds of MB take about a second.

2

Sessionize

Adjacent events ≤ 15 minutes apart count as continuous work; longer gaps mean you stepped away. Parallel sessions are unioned, never double-counted.

3

Render

One self-contained HTML file: daily / weekly / monthly stacked bars, hour-of-day distribution, work categories, top projects. Or --json for scripts.

Features

Small tool, sharp answers

📅

Instant weekly & monthly reports

cchour --week last is last Mon–Sun in one line. --month 2026-05 is a specific month. Charts anchor to the range.

✂️

Any date range

--since / --until filter events by local-time date before any stats are computed — totals, charts and projects all follow.

🔌

JSON for your scripts

cchour --json | jq '.tools["Claude Code"].hours' — per-tool totals, all buckets, categories and per-project rows on stdout.

🏷️

Your own categories

Ordered keyword rules in ~/.cchour/categories.json map projects to categories — content-level matching rescues sessions started in stray directories.

🔒

Private by design

Everything runs on your machine and stays there. The report is a local file. Nothing is uploaded anywhere, ever.

🪶

Zero dependencies

Plain Node ≥ 18, no install needed with npx cchour. The whole tool is one small binary-free package.

CLI

One command,
a few good flags

Run it bare and get ./cchour-report.html. Add --open to pop it in your browser. Everything else is just narrowing the question.

cchour — usage
cchour # writes ./cchour-report.html
cchour --open # ...and opens it in your browser
cchour --days 60 # daily chart window (default 30)
cchour --week # this week (Mon through today)
cchour --week last # last full week — instant report
cchour --month last # last full month
cchour --since 2026-06-01 # only on/after this date
cchour --until 2026-06-10 # only up to this date
cchour --json # report data as JSON to stdout

The data is already on your disk.
Go look at it.

$ npm i -g cchour

MIT licensed · star it on GitHub · npm