Collection of pi extensions (checkpoint, lsp, permission, ralph-loop, repeat)
npm install pi-hooksMinimal reference extensions for pi-coding-agent.
Install the package:
``bash`
pi install npm:pi-hooks@latest
pi config # enable/disable extensions
Dependencies are installed automatically during pi install.
To pull updates later:
`bash`
pi update git:github.com/prateekmedia/pi-hooks
Git-based checkpoint system for restoring code state when forking conversations.
- Captures repo state at the start of every turn (tracked, staged, and untracked files)
- Stores checkpoints as Git refs for persistence across sessions
- Offers restore options: files + conversation, conversation only, or files only
- Automatically saves current state before restoring past snapshots

Language Server Protocol integration (hook + tool).
The package exports two extensions via package.json:lsp-hook.ts
- - Auto-diagnostics (default at agent end)lsp-tool.ts
- - On-demand LSP queries
Hook (auto-diagnostics):
- Default: runs diagnostics once at agent end for touched files
- Optional: run after each write/edit/lsp
- Configure via to switch to per-edit or disabled
- Supports web, Flutter, and common backend stacks
- Manages LSP server lifecycles per project root
Tool (on-demand queries):
- Definitions, references, hover, symbols, diagnostics, signatures
- Query by symbol name or line/column position

Layered permission control with four permission levels:
| Level | Description | What's allowed |
|---------|-----------------------|-----------------------------------------------------|
| Minimal | Read-only mode | Only read commands (ls, cat, git status, etc.) |
| Low | File edits | + write/edit files |
| Medium | Dev commands | + npm, git, make, cargo, etc. |
| High | Full access | Everything (dangerous commands still prompt) |
On first run you pick a level; it's saved globally. Use /permission to change levels and /permission-mode to switch between ask/block prompts.

Looped subagent execution via the ralph_loop tool.

- Runs single or chain subagent tasks until a condition returns false
- Takes a prompt and exit condition (exit condition optional)
- Can supply max iterations and minimum delay between each
- Optionally supply model and thinking
- Supports conditionCommand, maxIterations, and sleepMs controlsworker
- Interactive steering/follow-up + pause/resume/stop commands in UI mode
- Defaults to the agent and the last user prompt when omitted
- No npm install required
Example prompt: "Use ralph loop to check the current time five times, sleeping 1s between iterations."
Repeat past tool calls (bash/edit/write) from the current branch.
- /repeat shows a picker of recent bash/edit/write tool calls with type-to-search filtering!command
- Bash entries load as in the editor for tweak + run$EDITOR
- Write entries open a temp editor (if is set) and apply only when you save$EDITOR
- Edit entries can repeat the edit (may fail) or open at the first changed line; repeat uses a temp editor and applies on save
Shows the average output tokens per second (TPS) in the footer status line.

1. Install the package and enable extensions:
`bash`
pi install npm:pi-hooks@latest
pi config
2. See inline comments in each extension for configuration options.
`bash``
cd lsp && npm install
cd ../permission && npm install
cd ../checkpoint && npm test
cd ../lsp && npm run test:all
cd ../permission && npm test
MIT