Original Reddit post

I use Claude Code for client projects and bill by the hour. The problem is I never really know how long I actually worked on something. Session timestamps are useless for this. A 4-hour session span might only have 45 minutes of real work in it if you stepped away for lunch or got pulled into a meeting. I also tend to run multiple projects in split terminals, which makes it worse. So I built claude-work-timer (command: ctt ). It reads your local Claude Code session logs, finds idle gaps, and calculates how long you were actually working. How it works: Parses user/assistant messages from ~/.claude/projects/ Deduplicates streaming assistant updates (keeps the last per round) If the gap between two messages is over 5 minutes (configurable), it starts a new work segment Adds a 30-second buffer after the last message in each segment (you’re probably still reading) Adds up the segments = actual working time ​ npm install -g claude-work-timer ctt # today + this week overview ctt daily # today’s hours by project ctt weekly # week breakdown ctt project my-app # single project history ctt session abc123 # drill into one session Example output: Claude Code Working Hours — 2026-02-24 Project │ Sessions │ Active │ Span │ Idle ─────────────────────┼──────────┼─────────┼─────────┼─────── client-project │ 3 │ 2h 35m │ 4h 10m │ 1h 35m side-project │ 1 │ 45m │ 1h 10m │ 25m ─────────────────────┼──────────┼─────────┼─────────┼─────── Total │ 4 │ 3h 20m │ 5h 20m │ 2h 00m It runs locally, just reads the JSONL files Claude Code already writes. Also handles sessions that cross midnight (splits by calendar date) and has –json output if you want to pipe it. github.com/danyuchn/claude-work-timer Anyone else tracking hours with Claude Code? Curious how other people handle this. PRs welcome if you want to add something. submitted by /u/Danyuchn7

Originally posted by u/Danyuchn7 on r/ClaudeCode