jakelevirne/pi-relay

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

See the code

See what people are saying (2)

SourceMessageScoreDate

Show HN: Self Improving AgentOrchestrator Skill

Thank you, will checkout https://github.com/jakelevirne/pi-relay I want to extend this. Support other harness like PI and models like Kimi

0

Sep 21, 2026

Show HN: Self Improving AgentOrchestrator Skill

This is great to see. I've now fully embraced long-running agentic workflows with separate plan->generate->evaluate steps, all coordinated by an orchestrator. I've done this using Claude Code alone, which is very easy but costly using Fable alone. I've done this in a team-visible way using Linear…

0

Sep 21, 2026

README

pi-relay

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.

What you get

PieceWhat it is
pi-relay:pi-runner agentHaiku relay subagent. Writes the prompt to a file, runs pi-run, returns pi's stdout verbatim.
bin/pi-runHeadless pi shim. Prompt comes from a file or stdin and is piped into pi, never through shell arguments.
bin/pi-doctorChecks pi, the model, credentials, and runs a smoke test.
pi-fanout skillTeaches Claude how to mix pi steps into Workflow scripts.
pi-relay:design-build-review workflowpi designs, pi implements files in parallel, Claude reviews, pi fixes.

Install

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

Use

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 })

Choosing the model

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.

Why the prompt goes through a file

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.

Cost shape

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.

Contributors

jakelevirne

2 commits

jakelevirne/pi-relay

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

See the code

See what people are saying (2)

SourceMessageScoreDate

Show HN: Self Improving AgentOrchestrator Skill

Thank you, will checkout https://github.com/jakelevirne/pi-relay I want to extend this. Support other harness like PI and models like Kimi

0

Sep 21, 2026

Show HN: Self Improving AgentOrchestrator Skill

This is great to see. I've now fully embraced long-running agentic workflows with separate plan->generate->evaluate steps, all coordinated by an orchestrator. I've done this using Claude Code alone, which is very easy but costly using Fable alone. I've done this in a team-visible way using Linear…

0

Sep 21, 2026

README

pi-relay

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.

What you get

PieceWhat it is
pi-relay:pi-runner agentHaiku relay subagent. Writes the prompt to a file, runs pi-run, returns pi's stdout verbatim.
bin/pi-runHeadless pi shim. Prompt comes from a file or stdin and is piped into pi, never through shell arguments.
bin/pi-doctorChecks pi, the model, credentials, and runs a smoke test.
pi-fanout skillTeaches Claude how to mix pi steps into Workflow scripts.
pi-relay:design-build-review workflowpi designs, pi implements files in parallel, Claude reviews, pi fixes.

Install

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

Use

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 })

Choosing the model

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.

Why the prompt goes through a file

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.

Cost shape

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.

Contributors

jakelevirne

2 commits

Languages

Shell

50.0%

JavaScript

50.0%