@esso0428/pi-retry-command
pi extension: /retry command using Session Tree navigation
Package details
Install @esso0428/pi-retry-command from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@esso0428/pi-retry-command- Package
@esso0428/pi-retry-command- Version
0.2.1- Published
- Nov 2, 2026
- Downloads
- 236/mo · 199/wk
- Author
- esso0428
- License
- MIT
- Types
- extension
- Size
- 7.5 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@esso0428/pi-retry-command
A Pi extension providing /retry and /continue commands.
How it works
/retry uses Session Tree navigation to retry the last prompt:
- Finds the last user message in the session tree
- Navigates back to its parent entry using
ctx.navigateTree() - Resubmits the original prompt via
pi.sendUserMessage()
This creates a true session branch — the failed response is preserved and you can always go back to it via /tree.
/continue stays on the current session branch and continues agent execution without replaying a user prompt. It keeps the prior conversation and triggers an additional agent turn. The command leaves only a hidden journal custom message; the context hook removes that message before the LLM sees it.
Original:
User A → Assistant A → User B → Assistant B (failed)
After /retry:
User A → Assistant A
├── User B → Assistant B (failed, preserved)
└── User B' → Assistant B' (new attempt)
Installation
pi install npm:@esso0428/pi-retry-command
Usage
Type /retry in Pi when:
- The last response was aborted (ESC) or errored
- You want to retry with the exact same prompt (including images/multimodal content)
- You want to preserve the failed branch for reference
Type /continue when you want another agent turn on the current branch without sending a new prompt:
/retry # retry the last user prompt on a new branch
/continue # continue the current branch with the existing conversation
Requirements
- Pi Coding Agent with Session Tree support
License
MIT