@furbyhaxx/pi-prompt-history
v0.1.0
Published
Slim Pi extension that keeps session-scoped prompt history and loads prior prompts into pi's native editor.
Maintainers
Readme
pi-prompt-history
A slim pi coding agent extension that keeps session-scoped prompt history and lets you load previous prompts back into pi's native editor.
It provides prompt recall with:
- Session-local storage — prompts are written next to the active pi session as
prompt.history.jsonl. - Native editor integration —
/historyloads a selected prompt via pi's built-in editor API. - No custom theme or editor — pi's active theme and default editor stay in charge, as nature briefly intended.
- Regular pi settings — configuration uses global/project
settings.json; noPi.yaml.
Project repository: https://github.com/furbyhaxx/pi-prompt-history
Install
Install from GitHub:
pi install git:https://github.com/furbyhaxx/pi-prompt-historyInstall from npm:
pi install npm:@furbyhaxx/pi-prompt-historyOr clone the repo and install from the local checkout:
git clone https://github.com/furbyhaxx/pi-prompt-history
pi install path/to/cloned/repoOr load directly without installing:
pi -e path/to/cloned/repo/extensions/prompt-history/index.tsWhat it does
Captures raw submitted prompt text via Pi's
inputevent before skill/template expansion.Stores history as JSONL in the current Pi session directory:
${PI_CODING_AGENT_DIR:-~/.pi/agent}/sessions/{session-cwd-sanitized}/prompt.history.jsonlAdds
/historyto browse stored prompts and load one back into the native Pi editor.Skips extension-injected messages so helper extensions do not pollute user prompt history.
Supports global and project config through Pi's normal
settings.jsonfiles.
Configuration
Global settings live at:
${PI_CODING_AGENT_DIR:-~/.pi/agent}/settings.jsonProject settings live at:
.pi/settings.jsonExample:
{
"promptHistory": {
"enabled": true,
"maxEntries": 200,
"dedupe": "consecutive",
"trim": true,
"ignoreInvalidLines": true,
"command": "history"
}
}Options:
| Key | Default | Description |
|---|---:|---|
| enabled | true | Enable prompt capture and /history. |
| maxEntries | 200 | Maximum entries retained in prompt.history.jsonl. |
| dedupe | "consecutive" | "none", "consecutive", or "all". |
| trim | true | Trim submitted prompts before storing. |
| ignoreInvalidLines | true | Ignore malformed JSONL lines instead of failing. |
| command | "history" | Optional extra command alias registered after session start. |
For compatibility with the extracted source layout, this package also reads editor.history from settings.json; promptHistory wins when both are present.
Build and validation
No build artifacts are produced; pi loads the .ts source directly via jiti.
npm install
npm run testnpm run test runs TypeScript typechecking and unit tests for config loading, JSONL storage, and extension registration behavior.
License
MIT
