Skip to content
ruam.ai

AI agent time tracking for Claude Code and Codex

Track AI agent time by logging each run: client, task, duration, cost and who started it. Three ways to do it, from a sheet to a tool.

Indrayudh Sen
Indrayudh Sen

, 8 min read

A sample client record in Ruam for Northwind: people's hours next to AI agent runs from Claude Code and Codex, each with what it delivered, its time and cost

AI agent time tracking means recording each run an AI agent does for you, such as a Claude Code or Codex task, with the date, who started it, the client, what it delivered, how long it ran and what it cost. It is separate from tracking the hours people work. You can fill the log in by hand, pull the numbers from each agent’s usage command, or use a tool that logs runs for you.

Commands and figures below were checked against each vendor’s docs in November 2026.

The three methods at a glance

Method What it gives you What it misses
A sheet you fill in Full control of every field Relies on you remembering; breaks once runs happen in parallel
The agent’s usage numbers (/usage, /status, ccusage) Tokens, estimated cost, session duration and history The client, the ticket and what the run delivered
A tool that logs runs Runs filed on a client without retyping Varies by tool; check what it sends to its servers

What counts as an AI agent run

A run is one task you hand to an agent, from the moment it starts working to the moment it stops. You ask Claude Code to add a CSV export, it works for 38 minutes, it tells you the tests pass. That is one run.

Runs are a better unit than “hours of agent use” for two reasons. First, a client does not care that an agent was open all afternoon. They care that a refund flow now has tests. Second, one run usually maps to one ticket, so the entry can carry the ticket code and later match an invoice line.

Agents also behave differently from people. A person works one thing at a time. An agent can run while you sit in a meeting, and you can start two at once. The minutes of an agent run are real, but they are not minutes of your day. That matters further down.

What to record for each run

Ten fields cover almost every question a client or a teammate will ask later:

  1. Date.
  2. Agent, such as Claude Code or Codex.
  3. Who started it. A person is always responsible for a run, and you will want to know who.
  4. Client.
  5. Ticket or project code.
  6. Task, in the words you gave the agent.
  7. What it delivered, in one line.
  8. Time, from start to finish.
  9. Cost, or “included in plan” if you pay a flat price.
  10. Billable, yes or no.

Here is one filled-in entry, using a sample client:

Field Example
Date November 18
Agent Claude Code
Started by Sofia
Client Northwind
Ticket NW-142
Task Add a CSV export to the orders page
Delivered Export button added, 6 tests written, all passing
Time 38 minutes
Cost Included in plan
Billable Yes

The delivered line is the one people skip, and it is the one that makes the entry useful. “Claude Code, 38 minutes” tells a client nothing. “Claude Code, 38 minutes, export button and 6 passing tests” tells them what they got.

For a sense of scale, Anthropic reports that across enterprise deployments the average cost of Claude Code is around $13 per developer per active day, with costs below $30 per active day for 90% of users (Anthropic, checked November 2026). Your numbers will differ with the model and the codebase, which is the reason to record your own instead of guessing.

Keep agent time out of a person’s hours

Do not add agent minutes to anyone’s timesheet. There are practical reasons.

If Sofia works on a client for four hours and starts a 40-minute agent run during that time, her day is still four hours. Adding the run makes it four hours forty. Her utilization looks higher than it was, and if you bill her hours to a client you now bill the same time twice.

People’s hours also feed things agents do not have: overtime, time off balances, approvals, pay. An agent has none of that. Mixing the two makes every one of those reports wrong in a way that is hard to spot later.

The third reason is the client conversation. A line such as “our team spent 31 hours, and our agents ran 12 tasks that took 6 hours” is easy to follow. A single number that blends them is not. How you then charge for the agent side is covered in how to bill clients for AI agent work.

So keep two ledgers that meet at the client: people’s hours on one side, agent runs on the other. Ruam works this way, and so can a spreadsheet with two tabs.

Three ways to track Claude Code and Codex time

By hand in a sheet

A spreadsheet with the ten columns above works for a freelancer running a few agent tasks a day. Fill in a row when the run ends, while you still remember what it delivered.

The cost is attention. You have to remember, and you have to find the duration and cost somewhere. If you forget for three days, the entries turn into guesses. This method breaks first when you start running agents in parallel or a teammate starts too.

From the agent’s own usage numbers

Each agent can tell you something about what it used, and you can copy those numbers into your sheet.

In Claude Code, running /usage shows the current session’s token usage in a Session block, with its total duration and an estimated cost computed from token counts at list price. Anthropic notes that the Session block is intended for API users. On Pro, Max and Ultra plans, usage is included in the subscription, so that dollar figure is not what you are billed. Subscribers see plan usage bars and a breakdown instead (Anthropic, checked November 2026). The totals reset when /clear starts a new session, so note them before you start the next task.

In a Codex CLI session, /status shows your remaining limits, and OpenAI points to a usage dashboard for current limits (OpenAI, checked November 2026). That tells you about your allowance, not about a single run, so you will still note the start and end times yourself.

In Antigravity CLI, /usage displays current model credit consumption and quota limits (Google, checked November 2026).

For history across many sessions, ccusage is an open source command line tool. Its GitHub page says it reads local usage data from coding agent CLIs, including Claude Code and Codex, and turns it into daily, weekly, monthly and session reports, with token counts, per-model breakdowns and costs in USD, and JSON output (ccusage on GitHub, checked November 2026). A session report is a good starting point for filling in the time and cost columns. To turn those token counts into a cost per client, paste them into the free AI agent cost calculator.

The free AI agent cost calculator with its built-in example: a month of Claude Code token usage priced at $222.33 pay per use
The free AI agent cost calculator’s built-in example: a month of Claude Code usage at list prices. Sample numbers.

These numbers give you duration and tokens. They do not give you the client, the ticket, or what the run delivered. You still add those by hand, so the sheet gets easier to fill but stays manual.

With a tool that logs runs

The third option is software that records the work for you. Tools differ in what they record.

Some measure your own time while you work with the agent. WakaTime offers a Claude Code plugin with metrics per project, file and branch (WakaTime, checked November 2026), and Timing, a Mac app, records the time you spend working with Claude in the terminal and which project and file you focused on (Timing, checked November 2026). Those answer how long you spent working with the agent.

A client record needs a different answer: which runs happened, who started each one, which client it was for, what it delivered and what it cost. When you compare tools, ask whether it matches runs to clients without you typing, whether it keeps agent time out of people’s hours, whether it shows what each run delivered, and what it sends to its servers.

How Ruam tracks AI agent time

Ruam logs each agent run as its own record. Agent tracking is in Beta and open on every plan.

You connect each agent once. Claude Code, Codex, Antigravity CLI and Cursor are supported, and any other tool that supports MCP can log runs too. With Claude Code and Codex, a run opens by itself when you give the agent a task.

Each run then lands on a client. Ruam checks, in order, whether the agent named a client, whether a ticket code in the run matches your project keys, whether it remembers the repo, and whether you have only one client. The first time it sees a repo, it asks once which client the repo is for, and anything unresolved waits as “Needs a client” instead of landing in the wrong place.

The five checks Ruam uses to put an agent run on a client, with a sample question asking which client a repo is for
How a run finds its client, from Ruam’s agent tracking page. Sample data.

The run shows what it delivered, who started it and how long it took. Cost appears when Ruam can work it out: runs on a flat plan such as Claude Max show as included once you tell Ruam which plan that agent runs on, and pay per use runs are priced from what the run used, at list prices. Runs carry a billable flag. Agent time never counts as anyone’s hours, and Ruam receives summaries only, never code, prompts or files.

One limit to know about: agent cost does not reach invoices, margins, budgets, reports or exports yet, so you copy the figures across when you bill. See what a run looks like for Claude Code, Codex or Antigravity CLI. If you use an assistant such as Claude or ChatGPT, you can also ask Ruam about your hours from your AI assistant.

Pick one client and one agent this week. Write down the next five runs with all ten fields, then look at the entries. If the sheet is already a chore, that is the moment to try a tool.

Questions

How do I track Claude Code time?

Log each Claude Code run with the client, ticket, what it delivered, the time and the cost. Take token, duration and cost figures from /usage or from ccusage reports, and note the client and ticket yourself. A sheet works well for a few runs a day; past that, a tool that logs runs saves the retyping.

Does Claude Code have built-in time tracking?

Partly. The /usage command shows the current session's total duration, token usage and an estimated cost, and the totals reset when /clear starts a new session (Anthropic, checked November 2026). It does not keep a log of runs by client or ticket, so you add those yourself or use a tool.

What should I record for each AI agent run?

Record the date, the agent, who started it, the client, the ticket or project code, the task, what it delivered, the time, the cost (or "included in plan") and whether it is billable. The "what it delivered" line is the one that makes the entry useful to a client.

Should AI agent time go on a person's timesheet?

No. If someone works four hours and starts a 40-minute agent run during that time, their day is still four hours. Adding the run counts the same time twice and throws off utilization, overtime and pay. Keep agent runs in a separate record that meets people's hours at the client.

How much does a Claude Code run cost?

It depends on the model and the codebase. Anthropic reports an average of around $13 per developer per active day across enterprise deployments, with costs below $30 per active day for 90% of users (Anthropic, checked November 2026). Record your own runs to get your real figure.

Is AI agent time billable?

It can be, but record it separately from people's hours. Whether you charge for it, and how, is a pricing decision; how to bill clients for AI agent work covers the three common methods with a worked example.

Does /usage show what I was billed?

Not always. Anthropic says the Session block's dollar figure is an estimate computed at list price and is meant for API users. On Pro, Max and Ultra plans, usage is included in the subscription (Anthropic, checked November 2026).

Does Ruam read my code?

No. An agent sends Ruam a short summary of a run: the goal, what it delivered, the outcome, the times, the ticket, the model, how much it used and the cost. Never code, prompts or files.

How do I track people's hours alongside agent runs?

Track people's hours the way you do for any client work, and keep the two records side by side on the client. For the human side, see how to track billable hours and agency time tracking.

Hours that count themselves.

By project, client and shift. No screenshots. Free forever for one person.

Try Ruam for free
Indrayudh Sen, Founder, Ruam
Indrayudh Sen

Founder, Ruam

Indrayudh Sen, the founder of Ruam, has managed remote teams since 2020 and has run a cold email agency.

Newsletter

New articles by email.

One email when there's a new article. No spam, unsubscribe any time.

See our Privacy Policy.

More articles

Time tracking, 8 min read

How to bill clients for AI agent work: 3 methods

Three ways to bill clients for AI agent work: at cost, with a markup, or in a fixed price. What to put on the invoice, with a worked example.

Indrayudh SenIndrayudh Sen

Time tracking, 8 min read

How to do a time audit (free template)

A time audit shows where your work hours really go. Log one week in 30-minute blocks, sort them, compare with your guess. Free template and CSV included.

Indrayudh SenIndrayudh Sen