Automatic time tracking for Claude Code (without sending your data to the cloud)
Last updated: July 2026
Claude Code, Codex and other terminal agents changed how a lot of us write software — and quietly broke time tracking along the way. Work is now spread across several terminals; an agent runs for ten minutes while you read a diff in another window; and by the end of the month the hours you actually spent are almost impossible to reconstruct from memory. This guide covers what Claude Code records on its own, the tools that turn that into hours, and how to keep all of it on your machine.
Why AI coding breaks normal time tracking
Traditional time tracking assumes you work on one thing, in one window, in a straight line — start the timer, do the task, stop it. Agent-assisted work is the opposite. You kick off a change in one terminal, switch to a second project while it runs, review a pull request in the browser, then come back. A manual timer only captures that if you remember to click it every time you switch, and nobody does. That is exactly why manual timers are estimated to miss anywhere from 15% to 40% of billable time — and AI work, with its start-stop rhythm, is where they leak the most.
The honest fix is to stop relying on memory. The raw material for accurate tracking already exists on your disk — you just need something to read it.
What Claude Code already records
Claude Code writes a complete transcript of every session to your local disk. By default each session lives at ~/.claude/projects/<project>/<session-id>.jsonl, where the project folder is your working directory path with non-alphanumeric characters replaced by dashes. Each line is one JSON object — a message, a tool call with its inputs and outputs, a timestamp — and a sessions-index.json alongside it holds metadata like an auto-generated summary, message counts, the git branch, and creation and modification times.
On top of that, Claude Code has hooks: shell commands it runs at defined moments (SessionStart, PreToolUse, PostToolUse, Stop and more), configured in .claude/settings.json. That means the timestamps, the project path and the git branch you need to reconstruct a working session are all already there, locally, for free. The only missing piece is a tool that reads it and turns it into hours you can bill.
Your options today, honestly
- WakaTime — the established name. The open-source
claude-code-wakatimeplugin installs withclaude plugin marketplace add https://github.com/wakatime/claude-code-wakatime.gitand feeds a cloud dashboard with rich metrics per project, language, branch and commit, plus goals and leaderboards. It is excellent if you want to understand how you code — but it sends your coding activity to WakaTime's servers behind an account. Not the pick if your data has to stay local. - trackmy.codes — a local Mac app that auto-detects Claude Code, Codex, Cursor and Antigravity, counts your active coding time with idle time dropped, and turns it into daily streaks and shareable cards. No account, nothing uploaded. Great for motivation and a public streak; it is not built around clients, rates or invoices.
- DIY hooks — you can wire a
SessionStart/Stophook to append timestamps to a file and total them yourself. Free and fully local, but you own the maintenance forever. - Døgn — a local menu-bar tracker that detects the same sessions, writes a short on-device summary as the entry description, and ties each one to a project and client so the time becomes billable. Covered below and in Døgn for developers.
If the goal is getting paid
Metrics and streaks are satisfying, but a freelancer needs billable hours per client and a line on an invoice — and that is a different job. Døgn is built for it. You point it at a repository (it drops a small .dogn marker and installs the Claude Code hooks once), then keep working. From then on your sessions are tracked automatically, each on its own line, with a short summary written on-device by Apple Intelligence as the description — so the entry reads "Refactored auth middleware, added tests," not "Claude Code, 47 min."
Everything stays in local Core Data — no account, no cloud, no telemetry. At month's end, an HMAC-signed webhook hands the finished entries to a draft invoice you review and send. It is a one-time purchase, and it is plain billable time tracking — not a countdown, pomodoro or focus timer.
A setup you can do in five minutes
Decide the one thing that actually matters first — local or cloud — because your NDAs and your clients' code confidentiality usually settle it:
- Want deep metrics and leaderboards, and fine with an account? Install claude-code-wakatime.
- Want a local streak to stay motivated? Try trackmy.codes.
- Need to bill the time? Point Døgn at the repo, keep coding, and review the day's entries once a week.
Whichever you choose, the win is the same: you stop reconstructing your month from memory and start from a record that was captured while you worked.
Questions, answered
Does Claude Code track time by itself?
Not as billable time. Claude Code records a full transcript of every session locally as timestamped JSONL, but it shows no time report and no billable total. You need a separate tool to turn those transcripts into hours.
Where does Claude Code store my session data?
By default at ~/.claude/projects/<project>/<session-id>.jsonl, with a sessions-index.json holding per-session metadata. All of it is on your own disk — nothing is uploaded unless you install a tool that sends it somewhere.
Can I track time across multiple terminals and parallel agents?
Yes. Because each session is its own transcript, a per-session tracker keeps parallel agents on separate lines instead of blurring them into one timer. Døgn tracks each session as its own entry for exactly this reason.
Do these tools send my code to the cloud?
It depends. WakaTime sends coding-activity metadata to its cloud dashboard behind an account. trackmy.codes and Døgn keep everything on your Mac. A DIY hook stays wherever you write the file. None of the local tools upload your source code.