Skip to content

Cursor time tracking: how to log your hours

Last updated: December 2026

Cursor has no built-in time report. To track time in Cursor you have three practical options: a sessionEnd hook that logs how long each agent conversation ran, the WakaTime extension for a dashboard, or a timer you start in a local tracker such as Dogn when you want hours you can bill to a client.

A prompt starts a change, an agent runs while you read the diff, and on a busy day two windows do that in parallel. The hours are real, but they don’t arrive as one block you can point at. Here is how each option captures them.

Your options

  • One Cursor hook: free and local. Cursor tells the hook how long each agent conversation lasted; you write it to a file. You still map folders to clients and pair it with your own work time. Setup below.
  • WakaTime: the regular VS Code extension installs in Cursor. Search for “wakatime” under Extensions, paste your API key, and your activity per project, file and branch goes to WakaTime’s dashboard. Cloud, with an account.
  • trackmy.codes: a Mac app that detects Cursor, Claude Code, Codex and Antigravity and turns active time into a daily streak. Local, no account, no clients or rates.
  • Dogn: a local time tracker for Mac, Windows and Linux with clients, rates and timesheets. It does not detect Cursor’s own agent sessions; you start a timer, or Cursor’s agent starts one for you. Details below.

Log every Cursor session with one hook

Cursor runs hooks at moments in the agent’s life, among them sessionStart when a new agent conversation is created and sessionEnd when it ends. Every hook gets JSON on standard input, including workspace_roots, the project folders. sessionEnd also gets the session_id, the reason it ended and duration_ms, the length of the conversation.

Save this as ~/.cursor/hooks/log-time.sh, make it executable with chmod +x (it needs jq):

#!/bin/sh
jq -r '[(now|todate), .session_id, ((.duration_ms // 0) / 60000 | floor),
  (.workspace_roots[0] // "")] | @tsv' >> "$HOME/cursor-time.tsv"

Then register it in ~/.cursor/hooks.json. User hooks run from ~/.cursor/, so the relative path works:

{
  "version": 1,
  "hooks": {
    "sessionEnd": [{ "command": "./hooks/log-time.sh" }]
  }
}

Each finished conversation now adds a line with the time, the session, the minutes and the folder. Three limits: the minutes are how long the conversation was open, not how long you worked; parallel conversations overlap, so don’t simply add them up; and cloud agents don’t run these hooks. A hook for one repo goes into .cursor/hooks.json in that repo instead; the format differs from Claude Code’s, so you can’t copy a Claude Code hook over as it is.

Where Cursor keeps your history

Cursor is a fork of VS Code and stores its state the same way: in SQLite databases called state.vscdb. On a Mac they sit under ~/Library/Application Support/Cursor/User/, one per workspace in workspaceStorage/<hash>/ plus a global one in globalStorage/. A workspace.json next to each maps the hash back to the project folder.

So the timestamps are on your disk, but not in a file you can read line by line like a Claude Code transcript. You would have to query an undocumented database whose layout changes between releases. The hook above is the easier way in.

Billable Cursor hours with Dogn

Dogn doesn’t read Cursor’s database. You track Cursor work like any other work: type what you’re doing, pick the client’s project, press Start. A second project at the same time? ⇧ ↵ starts it in parallel, on its own line. If you forgot, the timeline on Today hatches the gap, and “Review the day” lists it for you to fill in.

Two things save clicks. Dogn’s local MCP server can be connected to Cursor, so Cursor’s agent can start or stop a timer when you ask it to. And if you run Claude Code or Codex in Cursor’s terminal, Dogn tracks those sessions on its own once you switch that on. See automatic time tracking for Claude Code.

At month end the hours carry the project’s rate and land in a timesheet as PDF or CSV, or as an invoice draft in tjent. See a captured session become a billable entry or download Dogn to try it.

Questions, answered

Does Cursor track time by itself?

No. Cursor keeps its agent history in local SQLite databases, but it shows no time report. You need a hook or a separate tool.

How do I see how long a Cursor agent session took?

Cursor passes duration_ms to a sessionEnd hook: the length of that agent conversation in milliseconds. Log it to a file with a small hook script. It measures how long the conversation was open, not how long you actively worked.

Can I use WakaTime with Cursor?

Yes. Cursor is a VS Code fork, so the normal WakaTime extension installs from Cursor’s Extensions panel. Your activity goes to WakaTime’s cloud.

Does Dogn detect Cursor sessions?

No. Dogn detects Claude Code, Codex and Antigravity sessions. For Cursor you start a timer, or fill the gap later. Through its MCP server, Cursor’s agent can start a Dogn timer when you ask.

Continue