Skip to content

Guide · 7 min read

How to track Claude Code time and cost per task

Claude Code is two different things to a time tracker. Used by you, it is a tool that saves you time and should help you track yours. Used by your team, it is a worker whose hours and cost belong on the client's task, apart from yours. Hourtick supports both over MCP. This guide shows each setup, what lands where, and what you still have to decide yourself.

Pick the mode first

  • As you: Claude Code signs in as you and acts as you. It starts and stops your timer, reads your tasks, logs time you ask it to and drafts your timesheet. Nothing it does is attributed to anyone else.
  • As an agent: Claude Code connects to an agent's own address. Work is handed to it on a task, its finished time and cost are logged as the agent's, and none of it lands on a person's timesheet.
  • Most teams use both: as themselves for their own work, and as an agent seat for the tasks the team hands over.

Mode 1: track your own time from Claude Code

Claude Code doesn't watch your editor or terminal, and Hourtick doesn't ask it to. The evidence comes from what you did in Hourtick: tasks you moved, comments, chat and requests to agents. If your coding time isn't visible there, say so in the prompt and give it the hours.

  1. Add Hourtick as a remote MCP server: claude mcp add --transport http hourtick https://hourtick.com/api/mcp
  2. Run claude mcp login hourtick (or /mcp inside Claude Code). Your browser opens; sign in and allow access.
  3. Ask it: "Start a timer on #212" or "What did I track today?". It uses start_timer_on_task, stop_timer and list tools.
  4. At the end of the day, ask it to fill your timesheet. It reads get_my_day (what you tracked plus what you did in Hourtick) and proposes the missing entries with the evidence for each. It logs only what you confirm.

Mode 2: let Claude Code work as an agent

  1. An admin adds an agent in Team → AI agents, or asks Claude Code to do it (create_agent). The agent gets its own address and no token.
  2. Add that address as a second MCP server and sign in once, choosing to work as the agent: claude mcp add --transport http hourtick-reviewer https://hourtick.com/api/mcp/agents/<agent-id>
  3. Hand it a task: pick the agent as an assignee, @mention it in a thread or DM it. The request becomes a session.
  4. Claude Code takes the session with agent_wait_for_work, reads the task, checklist, files and thread with agent_get_context, posts progress with agent_log and asks with agent_ask.
  5. When it finishes, it answers with agent_reply, and logs the time it worked with log_time and what it cost with the usage field or report_cost.

What lands where

  • Your hours: your timesheet, week total and approval.
  • The agent's hours: its own row in Reports, for example "Claude (agent)", on the task and project. Billable like anyone's, following the task type and the project's rate, and markable as invoiced.
  • The agent's cost: a ledger of model, tokens and cost per task, which feeds the agent's budget, Reports and the P&L.
  • People's time around the agent's work: briefing before it, review after it. That is where an agent's real cost hides (see the true cost guide).

What Hourtick does not do for you

  • Agents don't run timers. They log finished time with log_time, so someone has to tell the agent how long it worked; the session itself also records duration per request.
  • Hourtick can't see your Anthropic bill by itself. Either the agent reports its cost, or an admin connects an Anthropic Admin API key and Hourtick compares reported cost with the bill each month, adds what is missing and flags double reporting.
  • A Claude Code session only works while it runs. For work while nobody is at a keyboard, give the agent a webhook that starts a GitHub Actions workflow running Claude Code headless; the developers page has the recipe.
  • Hourtick doesn't run or resell Claude. You pay Anthropic for the model as usual.

Keep it safe

An agent has the rights of an ordinary member. Admins can scope it to chosen clients and projects, make it read-only, cap its monthly cost or time, set an end date and choose who may ask it. Its instructions live in Hourtick and every version is kept. See the agent governance page for the full list.

Frequently asked questions

Does Hourtick track what Claude Code does in my editor?

No. Hourtick doesn't capture screens, apps or keystrokes. Claude Code works with the tasks, comments and time you give it over MCP.

Should I connect as me or as an agent?

As you for your own work and timesheet. As an agent when the team hands Claude Code a task, so its time and cost are recorded as the agent's, not yours.

How do I get Claude Code's cost into Hourtick?

Have the agent send it with log_time (usage), agent_reply (usage) or report_cost. For a check, connect an Anthropic Admin API key in Settings → AI provider costs.

Does it cost extra?

No. The MCP server and agents are included on every plan. You pay Anthropic for the model.

Can Claude Code work while I'm away?

Not by itself. Give the agent a webhook and run Claude Code headless from GitHub Actions or your own server when work arrives.

Sources

Related guides

Track your first hour in a minute.

Free for your whole team, forever. $29/month when you need 5 GB.