I’ve been using Claude Code daily for about 6 months now across a bunch of projects. At some point I got curious - how many hours am I actually spending with this thing? It felt like a lot but I had no numbers. Turns out Claude Code stores all your session data locally under ~/.claude/ - timestamps, project paths, everything. So I wrote a Python script that reads through all of that and calculates active time based on the gaps between messages. If there’s more than an hour between messages, it assumes you walked away. Otherwise it counts it as working time, plus a 10 minute buffer after each burst for reading and testing what Claude gave you. The tricky part was handling overlapping sessions. I often have 2-3 projects open at the same time, so just adding up per-project hours would double-count. The script merges those overlapping intervals to give you the real wall-clock time. It outputs an HTML report with a few views - weekly active hours, per-project breakdown, a monthly calendar with little colored pills showing what you worked on each day, and a summary table. I set up a cron job that runs it every Friday at 6pm and opens it in the browser, so I get a weekly “time card” automatically. No dependencies, just Python stdlib. Reads local files, writes local files, nothing leaves your machine. I put it on GitHub in case anyone finds it useful: https://github.com/gkastanis/claude-code-time-tracking Spoiler: I’m averaging about 6-8 hours a day. Make of that what you will. Disclosure: my own project, free and open source, no costs or tracking. submitted by /u/Low_Office_8947
Originally posted by u/Low_Office_8947 on r/ClaudeCode
