@dreki-gg/pi-past-chats
Reference previous pi sessions inline with @chat: and @session: autocomplete
Package details
Install @dreki-gg/pi-past-chats from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@dreki-gg/pi-past-chats- Package
@dreki-gg/pi-past-chats- Version
0.1.2- Published
- May 30, 2026
- Downloads
- not available
- Author
- jalbarrang
- License
- MIT
- Types
- extension
- Size
- 33.9 KB
- Dependencies
- 1 dependency · 4 peers
Pi manifest JSON
{
"extensions": [
"./extensions/past-chats"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@dreki-gg/pi-past-chats
Reference previous Pi sessions inline with @chat: or @session:.
Usage
Type either prefix in the Pi editor:
Use the approach from @chat:
Compare this with @session:
Autocomplete shows sessions from:
- the current working directory, and
- external folders configured in
.pi/past-chats.json.
Selecting a suggestion inserts a stable token such as @chat:9ab12cd34ef0. When you submit the prompt, the extension injects a hidden context message with:
- session title/name
- session file path
- cwd/source folder
- created/modified dates
- message count
- deterministic handoff summary
- optional cached AI handoff summary when enabled
The agent can use the injected summary immediately, or read the listed session JSONL file for deeper details.
Commands
/past-chats list
/past-chats add <path> [label]
/past-chats remove <label|path>
/past-chats refresh
/past-chats summarize @session:<id>
Examples:
/past-chats add ../api API
/past-chats add /Users/me/work/mobile Mobile App
/past-chats list
Config
Project config lives at:
.pi/past-chats.json
Example:
{
"folders": [
{ "path": "../api", "label": "API" },
{ "path": "/Users/me/work/mobile", "label": "Mobile App" }
],
"summary": {
"ai": false,
"provider": "openai",
"model": "gpt-5-mini"
}
}
Notes:
- The current cwd is always included implicitly.
- Folder paths are resolved relative to the current cwd unless absolute.
- AI summaries are opt-in with
summary.ai: trueand require a configured provider/model/API key. - If AI summary generation fails, the extension falls back to deterministic summaries.
Cache
AI summaries are cached in:
.pi/past-chats-cache.json
Cache entries are invalidated by session path, modified timestamp, summary version, provider, and model.
Install
pi install npm:@dreki-gg/pi-past-chats