@cad0p/pi-timestamps

UTC timestamps for every message in pi coding agent — TUI-only data-less custom-entry markers, clean export/copy/print, zero-config

Packages

Package details

extension

Install @cad0p/pi-timestamps from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@cad0p/pi-timestamps
Package
@cad0p/pi-timestamps
Version
0.2.0
Published
Aug 13, 2026
Downloads
256/mo · 68/wk
Author
cad0p
License
MIT
Types
extension
Size
9.4 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "extensions/message-timestamps"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-timestamps

UTC timestamps for every message in pi coding agent — rendered as dim-styled lines below each message, directly in the TUI, without touching message content.

user message
2026-06-05T21:44:02Z
assistant response
2026-06-05T21:44:02Z

Features

  • User + assistant stamps — a timestamp line renders below every user message and below every assistant/tool turn
  • TUI-only — timestamps are data-less custom session entries rendered via registerEntryRenderer; nothing is written into message content
  • Clean export/copy/print/export, /share, /copy, pi -p and --mode json output contains no ANSI escapes and no timestamp text
  • Survives export/import — markers and their parent timestamps round-trip through /import and /resume without duplication
  • UTC ISO format2026-06-05T21:44:02Z
  • Dim-styled — uses ANSI dim (\x1b[2m) for visual parity with thinking blocks; works with any theme
  • LLM-safe — the model only ever sees clean messages
  • Zero config — install and it works
  • No dependencies — pure TypeScript, no runtime deps

Install

pi install npm:@cad0p/pi-timestamps

Or try without installing:

pi -e npm:@cad0p/pi-timestamps

How it works

  1. When a user message is persisted, a pi-timestamps custom entry is appended (context event); when an assistant/tool turn ends, another is appended (turn_end event)
  2. Custom entries carry no data — the TUI renderer reconstructs the timestamp from the parent message's timestamp via the session manager
  3. At the context event, legacy v0.1.4 inline stamps are stripped from a deep copy — old sessions stay clean for the LLM

Migration from v0.1.4

Sessions stamped by v0.1.4 keep rendering their inline dim timestamps; the legacy strip keeps them out of the LLM context. New stamps are data-less markers, so exported content stays clean.

Visual style

Timestamps render with terminal's native "dim" attribute (SGR 2), matching pi's thinking block style. No hardcoded colors — works with light/dark themes automatically.

License

MIT