@spences10/pi-confirm-destructive
Pi extension that confirms destructive actions before they run
Package details
Install @spences10/pi-confirm-destructive from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@spences10/pi-confirm-destructive- Package
@spences10/pi-confirm-destructive- Version
0.0.7- Published
- May 4, 2026
- Downloads
- 918/mo · 728/wk
- Author
- spences10
- License
- MIT
- Types
- extension
- Size
- 31.9 KB
- Dependencies
- 1 dependency · 0 peers
Pi manifest JSON
{
"extensions": [
"./dist/index.js"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@spences10/pi-confirm-destructive
Git-aware destructive action guard for the Pi coding agent.
Maintained in the my-pi Vite+ workspace and tested with Vitest.
Installation
pi install npm:@spences10/pi-confirm-destructive
Local development from this monorepo:
pnpm --filter @spences10/pi-confirm-destructive run build
pi install ./packages/pi-confirm-destructive
# or for one run only
pi -e ./packages/pi-confirm-destructive
What it does
The extension intercepts Pi tool_call and user_bash events before
they run and asks for confirmation when an action may destroy data
that Git cannot restore.
It allows common refactor operations on clean tracked files without prompting, while guarding:
- untracked file deletes or overwrites
- tracked files with uncommitted changes
- broad destructive shell commands such as
find -delete,git clean,rsync --delete,truncate,dd, and disk tools - destructive Prisma commands such as
prisma migrate resetandprisma db push --force-reset - destructive database CLI calls through
psql,mysql,mariadb, orsqlite3 - custom/MCP tools with destructive names such as
delete,drop,execute_write_query, orexecute_schema_query
In interactive mode the prompt offers:
Allow onceAllow similar for this sessionBlock
In non-interactive mode destructive actions are blocked by default.
Using from a custom harness
import confirm_destructive from '@spences10/pi-confirm-destructive';
// pass `confirm_destructive` as an ExtensionFactory to your Pi runtime
my-pi imports this package directly and enables it as the built-in
confirm-destructive guard.
Development
pnpm --filter @spences10/pi-confirm-destructive run check
pnpm --filter @spences10/pi-confirm-destructive run test
pnpm --filter @spences10/pi-confirm-destructive run build
License
MIT