@firstpick/pi-extension-reverse-last

Session-aware undo for Pi write/edit tool changes via /reverse-last.

Packages

Package details

extension

Install @firstpick/pi-extension-reverse-last from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@firstpick/pi-extension-reverse-last
Package
@firstpick/pi-extension-reverse-last
Version
0.1.8
Published
Jun 8, 2026
Downloads
569/mo · 214/wk
Author
firstpick
License
MIT
Types
extension
Size
17.7 KB
Dependencies
1 dependency · 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

pi-extension-reverse-last

Session-local undo for Pi write and edit file changes.

What it does

  • Captures pre-change file snapshots for successful write/edit tool calls.
  • Maintains a per-session undo stack.
  • Restores one or multiple recent changes with a command.

Install

pi install npm:@firstpick/pi-extension-reverse-last

Configuration

  • PI_REVERSE_LAST_STATE_DIR (optional)
    • Override undo state storage directory.
    • Accepts absolute paths or home-relative paths.
    • Default: ~/.pi/agent/state/reverse-last

Commands

  • /reverse-last [count] — undo last successful file changes in current session.

Tools

  • reverse_last — undo the most recent write/edit file changes captured in this session.

Example view

/reverse-last
Restored 1 file from the session undo stack:
- src/config.ts

/reverse-last 2
Restored 2 recent file changes.

This is a quick escape hatch for recent Pi write/edit changes in the current session.