[FEATURE] Task-level time tracking, session timestamps, and cost apportionment by project/client

Resolved 💬 1 comment Opened May 3, 2026 by StuLast Closed Jun 2, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

---
Summary

Claude Code currently has no way to track how long it spends on tasks, or attribute that time and cost to specific projects or clients. For professionals using Claude Code
as a billable work tool — developers, consultants, agencies — this is a significant gap. Adding time tracking would move Claude Code from a "background tool" to a genuine
"work colleague" whose time, like any other team member's, can be tracked, reported, and charged.

---
The problem

When Claude Code works on a task — writing code, reviewing a PR, researching a problem — there is no record of:

  • How long the task took
  • Which project or client it was for
  • What the associated API cost was

This means:

  • Developers cannot apportion Claude's time to client projects for billing purposes
  • Consultancies cannot include AI-assisted work in time reports
  • Teams cannot understand which projects consume the most AI resource
  • There is no audit trail of work done

---
Proposed feature

  1. Session and task timestamps
  • Record a start timestamp when a task begins (either automatically on first message, or triggered by a keyword like start [task name])
  • Record a stop timestamp when a task ends (on session close, or triggered by stop / done)
  • Calculate and display elapsed time per task
  1. Project/client attribution
  • Allow the user to assign a project and/or client label to a session or task
  • Could integrate with existing CLAUDE.md project context, or be set explicitly per session
  1. Cost apportionment
  • Surface the API token cost per task/session (input + output tokens × current model rate)
  • Attribute cost to the assigned project/client
  • Exportable as a CSV or JSON time log
  1. External integrations (optional / future)
  • Webhook or API export to time-tracking tools (Clockify, Toggl, Harvest)
  • Could be implemented as a hook event (PostTaskComplete) that fires with task name, duration, token count, and cost

Why this matters for Claude Code specifically

Claude Code is already positioned as a collaborative development tool — a "work colleague" rather than a search engine. Time tracking is a natural extension of that
framing. Every human colleague's time is tracked and attributed; Claude's should be too. This feature would make Claude Code the obvious choice for any professional or
team that bills by time or needs to justify AI spend internally.

---
Minimal viable version

Even a simple session log — start time, end time, elapsed, token count, optional project label — written to a local file would be enormously useful and could be built on
by the community via hooks.

---
Happy to discuss further — contact via https://spycedconcepts.co.uk

Proposed Solution

Proposed feature

  1. Session and task timestamps
  • Record a start timestamp when a task begins (either automatically on first message, or triggered by a keyword like start [task name])
  • Record a stop timestamp when a task ends (on session close, or triggered by stop / done)
  • Calculate and display elapsed time per task
  1. Project/client attribution
  • Allow the user to assign a project and/or client label to a session or task
  • Could integrate with existing CLAUDE.md project context, or be set explicitly per session
  1. Cost apportionment
  • Surface the API token cost per task/session (input + output tokens × current model rate)
  • Attribute cost to the assigned project/client
  • Exportable as a CSV or JSON time log
  1. External integrations (optional / future)
  • Webhook or API export to time-tracking tools (Clockify, Toggl, Harvest)
  • Could be implemented as a hook event (PostTaskComplete) that fires with task name, duration, token count, and cost

Alternative Solutions

My currrent alterantive solution is to ask Claude code to include timestamps triggere by custom keywords, but these are just timestamps and still manual intervention to hook up to timetracking tools. This is howeer time-consuming and complex in setup, usage and maintenance.

Priority

Medium - Would be very helpful

Feature Category

Developer tools/SDK

Use Case Example

Use cases

  • Freelance developer: logs Claude Code time against client projects; includes AI-assisted hours in invoices with cost evidence
  • Consultancy: apportions Claude API cost across client engagements for accurate project P&L
  • Agency: understands which clients and project types consume the most AI resource; informs pricing
  • Solo founder: tracks time spent across multiple products to understand where effort is going

Additional Context

Why this matters for Claude Code specifically

Claude Code is already positioned as a collaborative development tool — a "work colleague" rather than a search engine. Time tracking is a natural extension of that
framing. Every human colleague's time is tracked and attributed; Claude's should be too. This feature would make Claude Code the obvious choice for any professional or
team that bills by time or needs to justify AI spend internally.

---
Minimal viable version

Even a simple session log — start time, end time, elapsed, token count, optional project label — written to a local file would be enormously useful and could be built on
by the community via hooks.

---
Happy to discuss further — contact via https://spycedconcepts.co.uk

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗