claude-code - 💡(How to fix) Fix Feature request: expose session start timestamp for AI efficiency monitoring

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Motivation: When asking Claude Code about session metadata (e.g., "what time did I start this session?"), it cannot answer because session start time is not available in context. This makes it difficult to:

  • Monitor AI efficiency (e.g., how long a task took end-to-end)
  • Understand the cost of a session in terms of wall-clock time
  • Track productivity improvements when adopting AI-assisted workflows
RAW_BUFFERClick to expand / collapse

Feature Request

Summary: Expose the session start timestamp so users can track how long a Claude Code session has been running.

Motivation: When asking Claude Code about session metadata (e.g., "what time did I start this session?"), it cannot answer because session start time is not available in context. This makes it difficult to:

  • Monitor AI efficiency (e.g., how long a task took end-to-end)
  • Understand the cost of a session in terms of wall-clock time
  • Track productivity improvements when adopting AI-assisted workflows

Proposed change: Surface the session start timestamp (and optionally elapsed time) as part of the context Claude Code has access to, similar to how currentDate is already injected. Even a read-only system variable like session_started_at would be sufficient.

Use case example: A data engineer wants to log that a complex SQL refactor + PR creation workflow took 45 minutes with AI assistance vs. several hours manually. Without a session start time, this measurement isn't possible from within the session.

extent analysis

TL;DR

Expose the session start timestamp as a read-only system variable, such as session_started_at, to enable users to track session duration.

Guidance

  • Consider adding a session_started_at variable to the context, similar to currentDate, to provide the session start timestamp.
  • Evaluate the feasibility of calculating and storing the elapsed time since session start, in addition to the start timestamp.
  • Assess the potential impact on existing workflows and user interactions, ensuring that the added variable does not introduce unintended behavior.
  • Review the proposed use case examples to identify potential requirements for the new variable, such as formatting or precision.

Notes

The implementation details of exposing the session start timestamp are not specified, and the exact requirements for the session_started_at variable are unclear.

Recommendation

Apply workaround: Implement a custom solution to track session start time, such as using an external timer or logging mechanism, until the proposed change is integrated.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature request: expose session start timestamp for AI efficiency monitoring