@vanillagreen/pi-hooks
v0.1.2
Published
First-class Pi port of the vstack safety hooks: bare-cd blocking, pre-commit fmt+clippy, post-edit clippy, end-of-turn lint. Per-hook toggles via pi-extension-manager.
Maintainers
Readme
@vanillagreen/pi-hooks

First-class Pi port of the vstack safety hooks. Each hook is independently toggleable.
Hooks
| Hook | Pi event | Behavior |
| --- | --- | --- |
| Block bare cd | tool_call (bash) | Blocks bare cd /path commands with no subshell or chaining. Use (cd /path && command) instead. |
| Pre-commit fmt + clippy | tool_call (bash) | When git commit is run, runs cargo fmt --check then cargo clippy. Blocks on failure. Only fires when .rs files are staged. |
| Post-edit clippy | tool_result (edit/write of .rs) | Runs workspace clippy after .rs edits and appends issues mentioning the edited file. Advisory only — doesn't undo the edit. |
| End-of-turn clippy | turn_end | If .rs files were touched during the turn, runs workspace clippy and surfaces errors via UI notification. Advisory only. |
These mirror the bash hooks in vstack/hooks/. Any change to a hook script must land alongside the matching change in pi-hooks — see AGENTS.md.
Install
vstack add --pi-extension pi-hooksOr as part of vstack add --all. Refresh with vstack refresh.
Via npm:
pi install npm:@vanillagreen/pi-hooksSettings
Open /extensions:settings; settings appear under the Hooks tab.
| Setting | What it does | | --- | --- | | Enable hooks | Master toggle. Disable to make the extension inert without uninstalling. | | Block bare cd | Toggle the bare-cd block hook. | | Pre-commit fmt + clippy | Toggle the pre-commit hook. | | Post-edit clippy | Toggle the post-edit advisory hook. | | End-of-turn clippy | Toggle the end-of-turn advisory hook. | | Clippy timeout | Max ms per clippy invocation before the check is abandoned. |
