A pi extension that prepends today's date to the system prompt for new sessions.
LLMs don't inherently know the current date. This extension ensures the model can give accurate date-based answers, avoid "as of my last training cutoff" disclaimers, and use proper date references in responses.
pi install git:github.com/jandrikus/pi-today# Global (available in all projects)
cp -r pi-today ~/.pi/agent/extensions/
# Or symlink
ln -sf /path/to/pi-today ~/.pi/agent/extensions/pi-todaycp -r pi-today .pi/extensions/No configuration needed. The extension works automatically:
- Start a new session (launch
pior use/new) - The system prompt is prepended with:
Current date: [Day], [Month] [Day], [Year]
Example: Current date: Thursday, May 30, 2025
The date is injected on the first message only — subsequent messages in the same session reuse the cached system prompt.
- On
session_start(new session or/new), the extension computes today's date - On the first
before_agent_startevent, it prepends the date to the system prompt via the return value - All subsequent messages skip the injection — preserving prompt cache and reducing costs
The extension also emits a today:date event via pi.events, making the date available to other extensions (e.g., pi-system-prompt displays it in /system-prompt output).
- Zero configuration — works out of the box
- Cache-safe — only modifies the first message's system prompt, not the base prompt
- Cross-extension support — emits
today:dateevent for other extensions to consume - No dependencies — pure TypeScript, no external packages
- No file I/O or network requests
Works with pi-system-prompt — when both extensions are installed, /system-prompt displays the injected date at the top of the system prompt.
Apache-2.0