[FRE] Add timestamp to each message

Open 💬 19 comments Opened Jun 22, 2025 by MarcinOrlowski

It'd be extremely handy to timestamp each interaction with claude - be it outgoing (my messages) as well as its replies. That would significantly help running around multiple sessions - timestamp would let me easier place my actions in time

> commit

● Bash(git status)
⎿  On branch dev
Your branch is ahead of 'origin/dev' by 2 commits.
(use "git push" to publish your local commits)
… +2 lines (ctrl+r to expand)

● Bash(git diff --cached)
⎿  (No content)

● Bash(git diff)
⎿  (No content)

● The working tree is already clean and there are no staged or unstaged changes.
of origin. The fix for the --demo option issue has been successfully applied and committed.

╭───────────────────────────────────────────────────────────────────────────────────────────╮
│ >                                                                                         │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
? for shortcuts

after the change

> commit                                                                [2025-06-21, 23:59]

● Bash(git status)                                                                  [23:59]
⎿  On branch dev
Your branch is ahead of 'origin/dev' by 2 commits.
(use "git push" to publish your local commits)
… +2 lines (ctrl+r to expand)

● Bash(git diff --cached)                                                           [23:59]
⎿  (No content)

● Bash(git diff)                                                        [2025-06-22, 00:00]
⎿  (No content)

● The working tree is already clean and there are no staged or unstaged changes.
of origin. The fix for the --demo option issue has been successfully applied and committed.

╭───────────────────────────────────────────────────────────────────────────────────────────╮
│ >                                                                                         │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
? for shortcuts

View original on GitHub ↗

19 Comments

coygeek · 10 months ago

Hey, that's a really interesting idea for improving session tracking, and your mock-up is super clear. I'm not affiliated with Anthropic, but I've spent a lot of time digging through the Claude Code documentation and can share what I've found.

Current Status

The feature as you've requested it—with persistent, inline timestamps in the main interactive view—doesn't appear to be available right now.

However, the team has implemented something very close to this! According to the changelog (v1.0.30), timestamps were added to the transcript mode.

You can see this by pressing Ctrl+R during your session. This will show you a more detailed, scrollable view of the conversation history, and each entry there should have a timestamp, which might help with your workflow. It's not quite the "always-on" display you're looking for, but it's a good first step.

Possible Workarounds for Detailed Logging

If getting precise, structured, timestamped logs of every single event is your main goal, Claude Code actually has a very powerful (but more involved) solution: OpenTelemetry (OTel) monitoring.

According to the Monitoring documentation, you can configure Claude Code to export detailed events to a collector. This is definitely an advanced feature, but it gives you exactly the data you want:

  • claude_code.user_prompt event: Logs every time you submit a prompt, with an event.timestamp.
  • claude_code.tool_result event: Logs every time a tool runs (like Bash), also with an event.timestamp.

This won't display the timestamps in the terminal UI, but it would give you a structured log file or a dashboard (depending on your OTel setup) with a perfect, timestamped record of every interaction, which might be even better for tracking across multiple sessions.

Another, simpler logging option could be to use Hooks. You could set up a UserPromptSubmit hook and a PreToolUse hook to run a simple script that appends the prompt or tool command to a log file with a timestamp.

Hope this helps! I'll be keeping an eye on this issue as well, as I agree it would be a great UI enhancement.

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

jstasiak · 6 months ago

Not stale.

mng-spie · 5 months ago

It would be a great improve

thoeltig · 4 months ago

I built a statusline workaround just to display the last message timestamp so I can see if I'm still within the 5-minute cache window before deciding to continue or restart. When I'm doing something on the side and context is nearly full at the end of a bigger task, I often miss the window by a couple seconds and the entire conversation gets written to the cache again just to confirm something small.
Per-message timestamps would eliminate this hack for me and help avoid unnecessary cache writes in longer conversations.

prmichaelsen · 3 months ago

I this on the roadmap?

ProducerGuy · 3 months ago

Hey @MarcinOrlowski — I built a solution: claude-timecodes. Would love any feedback.

sophronesis · 3 months ago

https://gitlab.com/sophronesis/claude-code-ts
built similar solution
unfortunately github version got nuked via dmca, but i rehosted it on gitlab as it is just patch to original code, and not deminified source code`

Spenhouet · 2 months ago

Really missing this with long running autoresearch tasks. Surprised this is missing in a chat interface.

SoftSolid · 1 month ago

+1 from another concrete use case: running 10+ Claude Code sessions in parallel across many terminal tabs/windows, often left idle overnight and resumed next day.

Two specific pain points:

  1. Multi-console orientation — after switching back to a terminal that's been idle, the Worked for 8m 14s tells me duration but not when. Was the last response 5 minutes ago, or 5 hours? Can't tell without external context.
  2. Multi-day sessions — sessions frequently span days (run something late evening, come back next morning). Pure clock time like 14:22 is ambiguous; full YYYY-MM-DD HH:MM would resolve this.

Ideal format would be configurable absolute timestamps on the turn footer / inline indicators, e.g. Worked at 2026-05-19 14:22 (took 8m 14s). Either replacing the duration or appending it both work.

(Originally filed #60531 before realizing this was already tracked here.)

sophronesis · 1 month ago

@SoftSolid best way to "fix" this i found is to just add to claude.md line to call first tool to run date command and to write this to prompt. But this feels so dirty

remygendron · 1 month ago

Just also adding my name under this request. For those of us who give Claude Code an advanced persona and extended memories, temporal awareness goes a long way into push Claude Code toward an AI partner instead of a simple coding chatbot.

Humm.... could hooks be used for this?

sophronesis · 1 month ago

@remygendron nope, hooks are only good for like storing logs of your messages and tool uses. this needs to be togglable separately. sux that claude code doesn't have plugins in any shape or form (skill do not count)

prmichaelsen · 1 month ago
@SoftSolid best way to "fix" this i found is to just add to claude.md line to call first tool to run date command and to write this to prompt. But this feels so dirty

Thank you for the suggestion, I didn't think of this before.

### 0020 - Temporal Awarness
You MUST include the timestamp of each message in GMT-7 as the first
entry of every message.

Format
`[7:59pm] <message>`

Result:

<img width="1142" height="155" alt="Image" src="https://github.com/user-attachments/assets/320527f6-4535-4687-adc5-565eae8882cf" />

at-whitelapin · 1 month ago

+1 — heavy Claude Code desktop user here, and the lack of per-message timestamps is a recurring friction point.

Three concrete use cases on my side:

  1. Reviewing past sessions — When I scroll back through a long conversation later (or the next day), I can't tell when each exchange happened. This matters for correlating what I asked Claude with external events (a deploy I kicked off, a meeting that interrupted me, etc.).
  2. Multi-window orientation — I often run several Claude Code windows in parallel. Coming back to an idle one, I have no way to tell whether the last response was 5 minutes ago or 5 hours ago. \Worked for 8m 14s\ tells me duration, not when.
  3. Audit / handoff — For client work, "this was discussed at 14:32 on YYYY-MM-DD" is sometimes useful for record-keeping and handoff docs.

A dim absolute timestamp on each user/assistant turn (\14:32\, or \YYYY-MM-DD HH:MM\ for multi-day sessions) would solve all three. A settings toggle would be ideal so people who don't want the visual noise can hide it.

Would love to see this on the roadmap. Thanks!

zoharbabin · 1 month ago

I built a small open-source plugin that solves this with hooks, so it works today without waiting on a built-in feature: claude-code-message-timestamps.

It does two things:

  • Shows the local time [HH:MM:SS] on every assistant message in the transcript — via a MessageDisplay hook, which is display-only, so it never pollutes the model's context.
  • **Tells Claude when you sent each prompt** — via a UserPromptSubmit hook that adds the time as a <system-reminder>, so the model can reason about elapsed time without mistaking the timestamp for your typed text.

Install (Claude Code 2.1.152+):

/plugin marketplace add zoharbabin/claude-code-message-timestamps
/plugin install message-timestamps@zoharbabin-claude-tools

Cross-OS (macOS/Linux/Windows via Git Bash), needs jq, and degrades gracefully with a one-time notice if it's missing. MIT-licensed — hope it helps until/if this ships natively.

at-whitelapin · 1 month ago

Hey @zoharbabin, thanks for sharing this — really nice idea, and exactly
the kind of "works today" solution I was hoping for.

I tried installing it just now via Claude Code, but ran into a load error.
Posting the details here in case it's useful for a patch release.

Environment

  • Claude Code: 2.1.161 (freshly updated from 2.1.116 to meet the 2.1.152+

requirement)

  • OS: macOS
  • jq: 1.7.1 (present on PATH)

What I did

claude plugin marketplace add zoharbabin/claude-code-message-timestamps
claude plugin install ***@***.***

Both commands reported success.

What Claude Code then reports on claude plugin list

❯ ***@***.***
  Version: 1.1.0
  Scope: user
  Status: ✘ failed to load
  Error: Hook load failed: Duplicate hooks file detected:
  ./hooks/hooks.json resolves to already-loaded file

/Users/.../zoharbabin-claude-tools/message-timestamps/1.1.0/hooks/hooks.json.
  The standard hooks/hooks.json is loaded automatically, so manifest.hooks
  should only reference additional hook files.

Likely cause (from Claude Code's own message)
Recent Claude Code versions appear to auto-load hooks/hooks.json from the
standard path. The explicit "hooks": "./hooks/hooks.json" line in your
plugin.json then collides with that auto-load. Dropping that line from
the manifest (or pointing it at an additional, differently-named hook file)
looks like it would resolve the duplicate.

Happy to retest once you push a fix. Thanks again for putting this out!

2026年6月3日(水) 0:03 Zohar Babin @.***>:

zoharbabin left a comment (anthropics/claude-code#2441) <https://github.com/anthropics/claude-code/issues/2441#issuecomment-4603718544> I built a small open-source plugin that solves this with hooks, so it works today without waiting on a built-in feature: claude-code-message-timestamps <https://github.com/zoharbabin/claude-code-message-timestamps>. It does two things: - Shows the local time [HH:MM:SS] on every assistant message in the transcript — via a MessageDisplay hook, which is display-only, so it never pollutes the model's context. - Tells Claude when you sent each prompt — via a UserPromptSubmit hook that adds the time as a <system-reminder>, so the model can reason about elapsed time without mistaking the timestamp for your typed text. Install (Claude Code 2.1.152+): /plugin marketplace add zoharbabin/claude-code-message-timestamps /plugin install @. Cross-OS (macOS/Linux/Windows via Git Bash), needs jq, and degrades gracefully with a one-time notice if it's missing. MIT-licensed — hope it helps until/if this ships natively. — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/2441?email_source=notifications&email_token=CAPU2CRERO5HSKINJRV45ID453UEZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRQGM3TCOBVGQ2KM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4603718544>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/CAPU2CVQ42YUH3MLB6NQGDL453UEZAVCNFSM6AAAAAB73IX3NOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMMBTG4YTQNJUGQ> . You are receiving this because you commented.Message ID: @.>
zoharbabin · 1 month ago
Hey @zoharbabin, thanks for sharing this — really nice idea, and exactly ... Happy to retest once you push a fix. Thanks again for putting this out! […](#)

Thanks to @quad341 this was resolved in https://github.com/zoharbabin/claude-code-message-timestamps/pull/1

sophronesis · 10 days ago

really hope this will be added as an option, because "Add timestamp at the start of every message" to claude.md feels dirty and should be solved deterministically