npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@thiagocbarreto/pi-timestamp-context

v0.1.0

Published

Adds each user message's timestamp and local datetime to Pi's LLM context.

Readme

Pi Timestamp Context

Pi extension that gives the model exact time context for every user message. This helps the model account for hours or days that pass before a session resumes.

What the model receives

The extension prepends one metadata block to each user message in the active model context:

<user_message_time unix_ms="0">Local datetime: Thursday, January 1, 1970 at 12:00:00.000 AM GMT+00:00</user_message_time>

unix_ms identifies the exact instant without locale ambiguity. The readable value uses English names and the machine's local time zone, including its UTC offset.

For the user text When did I send this?, Pi passes this complete user message to the model provider:

{
  "role": "user",
  "content": [
    {
      "type": "text",
      "text": "<user_message_time unix_ms=\"0\">Local datetime: Thursday, January 1, 1970 at 12:00:00.000 AM GMT+00:00</user_message_time>"
    },
    {
      "type": "text",
      "text": "When did I send this?"
    }
  ],
  "timestamp": 0
}

The outer timestamp remains Pi metadata. The inserted text block makes the same timestamp visible to models whose provider API does not support a timestamp field.

Behavior

  • Uses the timestamp Pi recorded when the user message was created.
  • Covers current and resumed sessions because Pi rebuilds model context before each model call.
  • Preserves text and image content after the timestamp block.
  • Changes only Pi's temporary model context. Stored session messages and the TUI transcript remain unchanged.
  • Adds stable historical metadata, so repeated model calls receive the same value for the same message.
  • Adds no tools, commands, settings, background work, or runtime dependencies.

Messages replaced by a compaction summary no longer exist as individual context messages, so their individual timestamps cannot be attached. Messages retained after compaction keep their timestamps.

Security and privacy

Pi packages run with the current user's permissions. Review package source before installation.

This extension sends message timestamps and readable local datetimes to the selected model provider as part of model context. It does not access the filesystem, start processes, make network requests, read environment variables, or persist data.

Installation

Install from npm:

pi install npm:@thiagocbarreto/pi-timestamp-context

Restart Pi after installation. Use pi list to confirm that the package is loaded.

Update or remove it with:

pi update npm:@thiagocbarreto/pi-timestamp-context
pi remove npm:@thiagocbarreto/pi-timestamp-context

Install a local checkout during development with:

pi install /absolute/path/to/pi-timestamp-context

Development

Install the locked development dependencies without lifecycle scripts, then run all checks:

npm ci --ignore-scripts
npm run check

Apply formatting with:

npm run format

See the official Pi extension documentation and package documentation for host APIs and package rules.

License

MIT