← Catalog

@nighty90/pi-timestamps

Append timestamps to user messages in the pi coding agent so the model can perceive elapsed time between turns.

Extension

Install

Install with PiG

pig install npm:@nighty90/pi-timestamps

Install with Pi

pi install npm:@nighty90/pi-timestamps
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 1.0.0 (README.md). PiG does not review it.

pi-timestamps

Append a timestamp to user messages in pi so the model can tell how much time passed between turns.

English | 中文

npm version license

Install

Requirements

  • pi >= 0.78.1
  • Node >= 22.19.0

npm

pi install npm:@nighty90/pi-timestamps

git

pi install git:github.com/nighty90/pi-timestamps

Features

Example

Every user message gets its send time appended, along with the gap since the previous user message.

This is a reply from the user.

[2026-11-12 Thu 16:21 UTC+8 | gap: 29m]

When the time of the previous user message is unavailable — the first message of a new session, for instance — no gap is added.

This is the first message of a new conversation.

[2026-11-12 Thu 16:59 UTC+8]

If less than the threshold has passed since the previous user message (5 minutes by default, configurable), no suffix is added at all.

This message was sent at 17:00.

Behavior

  • Slash commands get no suffix, so skill names and template arguments still expand
  • Image-only messages get no suffix but count for timing, so the next message's gap starts from them
  • /tree strips the suffix from the text it restores into the editor
  • After /resume, /fork, a restart, or a /tree branch switch, the gap continues from the previous user message recorded in the session

Configuration

The switch and the threshold are managed by /timestamp. Changes take effect immediately and are written to ~/.pi/agent/extensions/pi-timestamps/config.json (follows PI_CODING_AGENT_DIR).

InputEffect
/timestampShow the current switch and threshold, with the source of each (config.json or the default)
/timestamp onEnable injection
/timestamp offDisable injection
/timestamp gap <n>Set the threshold in minutes; 0 injects on every message

Credits

The code was written by pi driving deepseek-flash.

  • Human (nighty90): requirements and design decisions, trade-offs and rejections, code review, real-environment acceptance
  • Model (deepseek-flash): reading pi's source and extension API, implementation and refactoring, tests and comments

License

MIT (see LICENSE).