pi-agent-for-claude
Reviewed
at commit 0878de6
Caution: Hands tasks to the pi CLI, whose own bash, edit and write tools can change your files without Claude Code's permission prompts.
Sends data to The model provider your pi CLI is configured for (for example OpenRouter)
pi agent for claude: a `pi` subagent type whose model steps run the pi CLI, so pi subagents and agent-team teammates live in Claude Code's own agent UI…
0 upvotes
Log in to upvote or save- Made by
- Fazal Ali
- Pinned commit
-
0878de6d69b06324ff6515b63d5daf73de90f601 - What we checked
-
Adds a `pi` subagent type: when you or Claude start one, the task prompt goes to the pi command-line agent in a background process instead of to Claude, and pi's streamed output and answer appear in Claude Code's agent view. pi uses its own model and tools, so the prompt goes to whichever provider pi is set up for.
Review details
Static review of the source at the pinned commit; not run. Registers session.start, tool.call (denies its internal pi_progress tool otherwise), agent.spawn and turn.step. Runs through $.process.run `sh -c` scripts that start `pi -p --mode json --session-id pi-<agentId> [--model <pattern>] -- <prompt>` detached, pipe its JSON events through a small inline Node filter into /tmp/pi-agent-for-claude-<id>.jsonl, poll that file with tail and kill -0, and on abort run pkill on that session id and delete the temp files. The prompt is passed as a positional argument, not interpolated into the shell; the model pattern is limited to safe characters. Also reads `ps` output for its parent process arguments (to detect pi teammates) and finds and reads the subagent's own transcript under ~/.claude/projects to pick up follow-up messages. Model choice and pi's tool permissions are pi's own config. No direct network calls from the mod.
- What it uses
-
- Reads your prompts: yes
- Sees tool calls: yes
- Blocks or changes tool calls: yes
- Reads or writes files: yes
- Runs programs on your machine: yes
- Calls the model (uses tokens): no
- Sends data over the network: yes
- Stores data: no
- Shows something on screen: yes
- Hooked events
pi agent for claude: a `pi` subagent type whose model steps run the pi CLI, so pi subagents and agent-team teammates live in Claude Code's own agent UI, streamed live.
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/pi-agent-for-claude/)