Pi plugin for Claude Code
Use Pi from inside Claude Code for code reviews or to delegate tasks to Pi.
This plugin is for Claude Code users who want an easy way to start using Pi from the workflow
they already have.
What You Get
/pi:review for a normal read-only Pi review
/pi:adversarial-review for a steerable challenge review
/pi:rescue, /pi:transfer, /pi:status, /pi:result, and /pi:cancel to delegate work, hand off sessions, and manage background jobs
/pi:task to run Pi directly, with explicit control over write access and session resume
Requirements
- Pi 1.5.0 or later with at least one provider configured, either through
/login inside Pi (a subscription or a stored API key) or a provider API key in the environment.
- Usage counts against that provider's usage limits or billing.
- Node.js 18.18 or later for the plugin. Installing Pi from npm requires Node.js 22.19 or later.
[!NOTE]
The plugin starts pi directly, without a shell, so prompt text is never parsed by a shell. On Windows, npm's pi.cmd shim cannot be started that way, so an npm install of Pi does not work with this plugin on Windows. Windows is untested.
Install
Add the marketplace in Claude Code:
/plugin marketplace add 5kahoisaac/pi-plugin-cc
Install the plugin:
/plugin install pi@5kahoisaac-pi
Reload plugins:
/reload-plugins
Then run:
/pi:setup
/pi:setup will tell you whether Pi is ready. If Pi is missing and npm is available, it can offer to install Pi for you.
If you prefer to install Pi yourself, use Pi's installer:
curl -fsSL https://pi.dev/install.sh | sh
Or install it from npm (requires Node.js 22.19 or later):
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
If Pi is installed but no provider is configured yet, run pi in a separate terminal and use /login inside Pi. Pi has no login subcommand, and its interactive terminal UI does not work through Claude Code's ! shell mode. You can also export a provider API key such as ANTHROPIC_API_KEY or OPENAI_API_KEY before starting Claude Code.
After install, you should see:
- the slash commands listed below
- the
pi:pi-rescue subagent in /agents
One simple first run is:
/pi:review --background
/pi:status
/pi:result
Usage
/pi:review
Runs a normal Pi review on your current work. Pi has no built-in review command, so the plugin sends Pi a review prompt with the diff inlined (or, for a very large diff, a summary of the changed files that Pi then reads itself), and Pi reviews it with read-only tools.
[!NOTE]
Code review especially for multi-file changes might take a while. It's generally recommended to run it in the background.
Use it when you want:
- a review of your current uncommitted changes
- a review of your branch compared to a base branch like
main
Use --base <ref> for branch review. It also supports --wait and --background. It is not steerable and does not take custom focus text. Use /pi:adversarial-review when you want to challenge a specific decision or risk area.
Examples:
/pi:review
/pi:review --base main
/pi:review --background
This command is read-only and will not perform any changes. When run in the background you can use /pi:status to check on the progress and /pi:cancel to cancel the ongoing task.
/pi:adversarial-review
Runs a steerable review that questions the chosen implementation and design.
It can be used to pressure-test assumptions, tradeoffs, failure modes, and whether a different approach would have been safer or simpler.
It uses the same review target selection as /pi:review, including --base <ref> for branch review.
It also supports --wait and --background. Unlike /pi:review, it can take extra focus text after the flags.
Use it when you want:
- a review before shipping that challenges the direction, not just the code details
- review focused on design choices, tradeoffs, hidden assumptions, and alternative approaches
- pressure-testing around specific risk areas like auth, data loss, rollback, race conditions, or reliability
Examples:
/pi:adversarial-review
/pi:adversarial-review --base main challenge whether this was the right caching and retry design
/pi:adversarial-review --background look for race conditions and question the chosen approach
This command is read-only. It does not fix code.
/pi:rescue
Hands a task to Pi through the pi:pi-rescue subagent.
Use it when you want Pi to:
- investigate a bug
- try a fix
- continue a previous Pi task
- take a faster or cheaper pass with a smaller model