How to track time in Cursor automatically (and keep it off the cloud)

Last updated: July 2026

Cursor made a certain kind of workday normal: a Composer prompt kicks off a change, an Agent runs while you read a diff, and on a good day several agents are working in parallel across a couple of windows. It is fast — and it quietly wrecks time tracking. The billable hours are real, but they no longer look like a block you can point at. This guide covers where Cursor actually keeps that work, why it is trickier to read than a terminal agent, and the honest options for turning it into hours without shipping your code to someone else's cloud.

Why Cursor breaks normal time tracking

Traditional time tracking assumes one task, one window, a straight line: start the timer, do the work, stop it. Cursor is the opposite of that. Cursor 2.0 is agent-first — you can launch several Composer agents at once and let them run in parallel while you review a diff, switch to another project, or step away entirely. A manual timer only captures that if you religiously start and stop it every time your attention moves, and nobody does. That start-stop rhythm is exactly where manual timers leak, and it is why they are estimated to miss anywhere from 15% to 40% of billable time.

The good news is that Cursor already keeps a detailed record of what happened. The catch — and it is a real one — is where it keeps it.

Where Cursor actually stores your sessions

Unlike a terminal agent such as Claude Code, which writes a plain-text JSONL transcript you can tail, Cursor keeps its Composer and Agent history in SQLite databases. On a Mac the workspace databases live under ~/Library/Application Support/Cursor/User/workspaceStorage/<hash>/ — each project gets its own hashed folder holding a state.vscdb database and a workspace.json that maps that hash back to the real project path. There is also a large global database at ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb.

Inside, most of the history sits in a key-value table called cursorDiskKV, under keys like composerData:<id> for a session and bubbleId:<id>:<id> for the individual messages. (Some newer builds also drop more readable agent transcripts under ~/.cursor/projects/<hash>/agent-transcripts/.) The practical upshot: the timestamps and the project mapping you need are all there, locally — but you cannot just follow a log file. Anything that tracks Cursor time has to open a binary database and query it, which is why the generic "watch a folder" tricks and DIY one-liners that work for terminal agents fall over here.

Cursor is a VS Code fork — and that decides your tooling

The saving grace is that Cursor is a fork of VS Code, so the entire VS Code extension ecosystem installs and runs inside it. That shapes your options in two concrete ways.

Editor extensions just work. The WakaTime VS Code extension installs straight from Cursor: press ⌘⇧P, choose Extensions: Install Extension, search wakatime, paste your API key, and your coding activity — per project, file, branch and language, including how much of each file is AI-generated — flows to your dashboard. It is the same open-source extension VS Code users run; there is no Cursor-specific plugin to hunt down. The trade-off is unchanged: it is a cloud dashboard behind an account.

Cursor now has its own hooks. Since version 1.7 (late 2025) Cursor supports agent-lifecycle hooks — shell commands it runs at defined moments (sessionStart, stop, afterFileEdit, beforeSubmitPrompt and more), configured in .cursor/hooks.json per repository or ~/.cursor/hooks.json globally. That is the Cursor equivalent of the DIY route: a sessionStart / stop hook can append timestamps to a file you total yourself. Two honest caveats — the format differs from Claude Code's .claude/settings.json, and Cursor's hooks were still marked RFC/draft through 2026, so treat them as subject to change.

Your options today, honestly

  • WakaTime — installed as the VS Code extension above. Rich metrics, goals and leaderboards, and it understands AI-generated code. Best if you want to understand how you code and are fine with an account and a cloud. Not the pick if your client's code has to stay on your machine.
  • trackmy.codes — a local Mac app that explicitly auto-detects Cursor (alongside Claude Code, Codex and Antigravity), counts 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 or a SQLite reader — wire up a Cursor hooks.json, or query state.vscdb yourself. Fully local and free, but you own the maintenance forever — and the database schema is undocumented and shifts between releases.
  • Døgn — a local menu-bar tracker that turns your working day into billable hours and a draft invoice. One honest note up front: Døgn's per-session auto-detection today covers the terminal agents (Claude Code, Codex, Antigravity), not Cursor. For Cursor it works a little differently — covered next.

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 — a different job. Døgn is built for that, and it is honest about how it handles Cursor. Rather than reach into Cursor's SQLite history, Døgn tracks Cursor as part of your whole working day: you start a project with one click (or ⌃⌘T), run several projects in parallel — each on its own line — and a 24-hour timeline surfaces the stretches where you were active but nothing was tracked. So a two-hour Composer session in Cursor becomes one click to assign to the right client, not a memory game at month's end.

From there each entry carries a client, a duration and a rate; everything stays in local Core Data — no account, no cloud, no telemetry — and 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.

Using Claude Code instead of — or alongside — Cursor? Those terminal sessions Døgn does detect automatically, writing a short on-device summary as the description. See automatic time tracking for Claude Code for that flow.

A setup you can do in five minutes

Decide the one thing that actually settles it — local or cloud — because an NDA or a client's confidentiality usually makes the call for you:

  • Want deep metrics and don't mind an account? Install the WakaTime extension in Cursor.
  • Want a local streak to stay motivated? trackmy.codes detects Cursor out of the box.
  • Need to bill the time? Run Døgn in your menu bar, assign the day's Cursor stretches once a week, and let the signed webhook draft the invoice.

Whichever you pick, the win is the same: you stop reconstructing the month from memory and start from a record that was captured while you worked.

Questions, answered

Does Cursor track time by itself?

Not as billable time. Cursor keeps a full Composer and Agent history locally, but it shows no time report and no billable total — and because that history lives in SQLite rather than a plain log file, you need a separate tool to turn it into hours.

Where does Cursor store my chat and session history?

In SQLite databases on your own disk: per-project state.vscdb files under ~/Library/Application Support/Cursor/User/workspaceStorage/<hash>/ (with a workspace.json mapping the hash to the project path), plus a global globalStorage/state.vscdb. Nothing is uploaded unless you install a tool that sends it somewhere.

Can I use WakaTime with Cursor?

Yes. Because Cursor is a VS Code fork, the standard WakaTime VS Code extension installs from Cursor’s Extensions panel with your API key — no Cursor-specific plugin needed. It is a cloud dashboard, so your activity metadata leaves your machine; trackmy.codes and Døgn keep everything local instead.

Does Døgn auto-detect Cursor sessions like it does Claude Code?

Not per session today. Døgn’s automatic session detection covers the terminal agents — Claude Code, Codex and Antigravity — where it also writes an on-device summary. Cursor is tracked as part of your whole working day instead: one-click and parallel timers plus a timeline that surfaces active-but-untracked stretches to assign, then bills them. If you also use Claude Code, see the Claude Code guide for the auto-detected flow.

Continue