@diegopetrucci/pi-confirm-destructive

A pi extension that confirms destructive session actions.

Package details

extension

Install @diegopetrucci/pi-confirm-destructive from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@diegopetrucci/pi-confirm-destructive
Package
@diegopetrucci/pi-confirm-destructive
Version
0.1.0
Published
Apr 18, 2026
Downloads
75/mo · 5/wk
Author
diegopetrucci
License
MIT
Types
extension
Size
3.2 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

confirm-destructive

A small pi extension that asks for confirmation before destructive session actions.

This is adapted from the original confirm-destructive.ts example in badlogic/pi-mono and kept basically the same.

What it checks

  • clearing the current session
  • switching sessions when the current session has user messages
  • forking from an entry

Install

Standalone npm package

pi install npm:@diegopetrucci/pi-confirm-destructive

Collection package

pi install npm:@diegopetrucci/pi-extensions

GitHub package

pi install git:github.com/diegopetrucci/pi-extensions

Then reload pi:

/reload

Notes

  • Hooks session_before_switch and session_before_fork.
  • Cancels the action when the user declines.
  • Does nothing in non-interactive mode.