Add optional host-side timestamps before every output block in Codex CLI

Open 💬 4 comments Opened Jun 9, 2026 by simfor99

What variant of Codex are you using?

Codex CLI / Codex in terminal, running in WSL on Linux.

What feature would you like to see?

Please add an optional mode that prefixes every visible output block with the local host-side timestamp generated by the Codex UI/CLI layer, not by the model.

For example:

[2026-06-09 17:38:12 CEST] assistant update ...
[2026-06-09 17:38:40 CEST] tool call started ...
[2026-06-09 17:39:03 CEST] tool output ...
[2026-06-09 17:39:20 CEST] assistant update ...

Ideally this would be configurable, e.g. a CLI flag or config option such as:

show_output_block_timestamps = true
timestamp_source = "host"
timestamp_format = "%Y-%m-%d %H:%M:%S %Z"

The key point is that the timestamp should come from the Codex client process / host clock, not from assistant text generation.

Why this matters

Agents do not have a reliable internal sense of wall-clock time. Even with explicit AGENTS.md instructions telling the agent to run date before any visible timestamp, assistant messages can still display incorrect times after long turns, context compaction, resume, or UI replay.

In one real session, the visible assistant output jumped to 18:31, 18:32, 18:33, 18:35, and 18:37, while the actual local system time checked via shell was around 17:38-17:39 CEST. From the user perspective, the transcript made it look as if ~37 minutes had passed, when only about 10 minutes had passed.

This makes long-running agent work hard to supervise:

  • The user cannot tell how much real time elapsed between output blocks.
  • The agent may accidentally present fabricated or stale timestamps as status evidence.
  • Context compaction/resume can make prior timestamps look authoritative even when they are not.
  • The existing final "Worked for ..." line is useful but not enough to reconstruct timing across multiple assistant updates, tool blocks, compaction, or resumed turns.

Proposed behavior

Add a display-layer timestamp mode where Codex annotates output blocks itself. This should be treated like terminal/UI metadata, similar to log timestamps, not as assistant-authored content.

Suggested scope:

  • Prefix assistant output blocks.
  • Prefix tool call start/end or tool output blocks where feasible.
  • Preserve timestamps through transcript replay/export.
  • Make the mode opt-in to avoid visual noise for users who do not want it.
  • Consider also showing monotonic elapsed time since user submit, e.g. +00:02:31, next to wall-clock time.

Relationship to existing timing requests

This is related to #24240, but different: #24240 asks for user-side timing metrics between turns. This request is specifically for host-generated timestamps before each visible output block so users can audit elapsed time during one long agent action and after compaction/resume.

View original on GitHub ↗

4 Comments

simfor99 · 2 months ago

Related existing timing issues:

  • #24240 asks for user-side timing metrics between turns.
  • #19984 covers active turn timer loss/misreporting after TUI restore/replay.
  • #15458 covers final Worked for ... duration reset/truncation on long turns.

This request is complementary: it asks for opt-in host-generated timestamps before visible output blocks, so elapsed wall-clock time remains auditable even when assistant-authored timestamps are stale or wrong.

papastanb · 1 month ago

I strongly support this request. I use several long-running Codex CLI sessions across different projects inside many terminals. When I return to a project, the lack of timestamps makes it difficult to determine when a message, tool call, or action occurred. Host-side timestamps on every visible output block, including tool calls, would significantly improve traceability for multi-project workflows.

rjorgenson · 4 days ago

I wanted this for the same reason: when scrolling through a long TUI transcript, I need to know when each message was sent.

I tested a small implementation against Codex CLI 0.149.0. It adds an opt-in setting:

[tui]
show_message_timestamps = true

With the setting enabled, the existing separator renders the user message's local send time on the right:

──────────────────────────── 2026-08-23 14:05:09 ─

Codex already records the required value in Turn.started_at as a Unix timestamp in seconds, so this does not require a session format or protocol change. The implementation passes that value to the turn-completion path, converts it to local time, and adds it to FinalMessageSeparator.

A few behavior details from the prototype:

  • The setting defaults to false, preserving the current display.
  • Timestamps appear for conversational turns as well as turns that ran tools.
  • Resumed conversations use the timestamp already stored in the turn history.
  • Existing duration and runtime metrics remain on the left side of the separator.
  • The timestamp is truncated safely when the terminal is narrower than the full label.

I built and used the patched 0.149.0 binary, and the display works as expected. I also added an insta snapshot covering the right-aligned timestamp and regenerated core/config.schema.json for the new setting.

The code change is fairly contained. The main changes are config plumbing, passing notification.turn.started_at into the completion handler, and extending the separator renderer. No new dependency is needed because the TUI already depends on chrono.

Since the repository does not accept external pull requests, I am posting the implementation notes here in case they are useful to the Codex team.

felix314159 · 17 hours ago

yeah please add this, such an obviously useful feature that is still missing for some reason