Fan Claude Code workflow steps out to any pi-supported model (Kimi K3 by default) via a relay subagent
Shell
0
2 commits
updated Sep 19, 2026
Fan Claude Code work out to a non-Claude model through pi. Claude keeps orchestration and judgment. pi, running Kimi K3 by default or any model pi supports, does the generation. Works in any folder once installed; nothing goes into the project.
| Piece | What it is |
|---|---|
pi-relay:pi-runner agent | Haiku relay subagent. Writes the prompt to a file, runs pi-run, returns pi's stdout verbatim. |
bin/pi-run | Headless pi shim. Prompt comes from a file or stdin and is piped into pi, never through shell arguments. |
bin/pi-doctor | Checks pi, the model, credentials, and runs a smoke test. |
pi-fanout skill | Teaches Claude how to mix pi steps into Workflow scripts. |
pi-relay:design-build-review workflow | pi designs, pi implements files in parallel, Claude reviews, pi fixes. |
On any machine:
npm i -g @earendil-works/pi-coding-agent # pi itself
pi # once, interactively: /login to your provider (e.g. fireworks)
claude plugin marketplace add jakelevirne/pi-relay
claude plugin install pi-relay@pi-relay
For a local checkout instead of GitHub: claude plugin marketplace add /path/to/pi-relay.
Then in any Claude Code session:
"${CLAUDE_PLUGIN_ROOT}/bin/pi-doctor" # or: ~/.claude/plugins/cache/pi-relay/pi-relay/*/bin/pi-doctor
Ask Claude to "fan this out to kimi" or "have pi do the implementation", and the pi-fanout
skill takes over. Or be explicit:
Agent({ subagent_type: 'pi-relay:pi-runner', prompt: 'MODE: text\nPROMPT:\n...' })
Workflow({ name: 'pi-relay:design-build-review', args: { spec: '...', files: [{ file: 'app.js', note: '...' }] } })
Inside your own Workflow scripts:
const kimi = (mode, prompt, opts = {}) => agent(
`MODE: ${mode}\nPROMPT:\n${prompt}`,
{ agentType: 'pi-relay:pi-runner', model: 'haiku', effort: 'low', ...opts })
Defaults are Fireworks and accounts/fireworks/models/kimi-k3. Override per machine with env
vars PI_RELAY_PROVIDER, PI_RELAY_MODEL, PI_RELAY_THINKING, or per task with MODEL:,
PROVIDER:, THINKING: lines in the relay task. pi --list-models kimi shows what pi knows.
Prompts contain quotes, backticks, $(...), and multi-line text. Passing them as shell
arguments is where relays break. The relay agent writes the prompt with its Write tool, and
pi-run pipes that file into pi's stdin. Nothing is ever shell-parsed.
One more thing pi-run handles: pi -p reads its prompt from stdin when stdin is not a
terminal, and blocks forever if that stdin is an open pipe that never closes. That is exactly
what agent harnesses hand it. Feeding the file on stdin sidesteps it.
Each pi step costs one small Haiku relay (a few thousand tokens) plus pi's own usage on your provider. Concurrency is bounded by the Workflow slot cap and the provider's rate limit.
2 commits
Shell
50.0%
JavaScript
50.0%
Fan Claude Code workflow steps out to any pi-supported model (Kimi K3 by default) via a relay subagent
Shell
0
2 commits
updated Sep 19, 2026
Fan Claude Code work out to a non-Claude model through pi. Claude keeps orchestration and judgment. pi, running Kimi K3 by default or any model pi supports, does the generation. Works in any folder once installed; nothing goes into the project.
| Piece | What it is |
|---|---|
pi-relay:pi-runner agent | Haiku relay subagent. Writes the prompt to a file, runs pi-run, returns pi's stdout verbatim. |
bin/pi-run | Headless pi shim. Prompt comes from a file or stdin and is piped into pi, never through shell arguments. |
bin/pi-doctor | Checks pi, the model, credentials, and runs a smoke test. |
pi-fanout skill | Teaches Claude how to mix pi steps into Workflow scripts. |
pi-relay:design-build-review workflow | pi designs, pi implements files in parallel, Claude reviews, pi fixes. |
On any machine:
npm i -g @earendil-works/pi-coding-agent # pi itself
pi # once, interactively: /login to your provider (e.g. fireworks)
claude plugin marketplace add jakelevirne/pi-relay
claude plugin install pi-relay@pi-relay
For a local checkout instead of GitHub: claude plugin marketplace add /path/to/pi-relay.
Then in any Claude Code session:
"${CLAUDE_PLUGIN_ROOT}/bin/pi-doctor" # or: ~/.claude/plugins/cache/pi-relay/pi-relay/*/bin/pi-doctor
Ask Claude to "fan this out to kimi" or "have pi do the implementation", and the pi-fanout
skill takes over. Or be explicit:
Agent({ subagent_type: 'pi-relay:pi-runner', prompt: 'MODE: text\nPROMPT:\n...' })
Workflow({ name: 'pi-relay:design-build-review', args: { spec: '...', files: [{ file: 'app.js', note: '...' }] } })
Inside your own Workflow scripts:
const kimi = (mode, prompt, opts = {}) => agent(
`MODE: ${mode}\nPROMPT:\n${prompt}`,
{ agentType: 'pi-relay:pi-runner', model: 'haiku', effort: 'low', ...opts })
Defaults are Fireworks and accounts/fireworks/models/kimi-k3. Override per machine with env
vars PI_RELAY_PROVIDER, PI_RELAY_MODEL, PI_RELAY_THINKING, or per task with MODEL:,
PROVIDER:, THINKING: lines in the relay task. pi --list-models kimi shows what pi knows.
Prompts contain quotes, backticks, $(...), and multi-line text. Passing them as shell
arguments is where relays break. The relay agent writes the prompt with its Write tool, and
pi-run pipes that file into pi's stdin. Nothing is ever shell-parsed.
One more thing pi-run handles: pi -p reads its prompt from stdin when stdin is not a
terminal, and blocks forever if that stdin is an open pipe that never closes. That is exactly
what agent harnesses hand it. Feeding the file on stdin sidesteps it.
Each pi step costs one small Haiku relay (a few thousand tokens) plus pi's own usage on your provider. Concurrency is bounded by the Workflow slot cap and the provider's rate limit.
2 commits
Shell
50.0%
JavaScript
50.0%