pi

An integration that lets OpenAgents run Pi, a terminal-based coding agent distributed as an npm package. It connects to Pi through a long-running command-line process for each communication channel.

In plain words
What is it for?
Use it to register Pi as a supported coding agent, keep one running Pi process per channel, parse its streamed output, and manage its lifecycle through the OpenAgents connector.
Why use it?
It lets OpenAgents use Pi without embedding Pi's internal software libraries or source code. The integration follows the same persistent-process approach used for another coding agent in the project.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/openagents-org/openagents/pi
Clone the repo
git clone --depth 1 https://github.com/openagents-org/openagents
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,511 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.05511
Opus 5 $0.00000 $0.02756
Sonnet 5 $0.00000 $0.01102
Haiku 4.5 $0.00000 $0.00551

Measured yesterday against content hash 10bf7393f5b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pi scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

REST API through its built-in `bash` tool and curl, exactly like the OpenCode

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

`child_process`, `crypto`, `fs`, `os`, `path`). A test asserts the package's
docs/agents/pi.md · 448 lines

How it starts

The opening of the file, as written. The whole thing — 448 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pi

OpenAgents supports Pi, Earendil's coding agent for the terminal — executable pi, distributed as the npm package @earendil-works/pi-coding-agent.

  • Internal agent id: pi
  • User-facing name: Pi
  • Adapter: packages/agent-connector/src/adapters/pi.js
  • Stream parser: packages/agent-connector/src/adapters/pi-stream.js
  • Registry source: sdk/src/openagents/registry/pi.yaml (hand-synced into packages/agent-connector/registry.json)
  • Verified against: pi 0.83.0

Architecture: one long-lived RPC subprocess per channel

Pi is integrated the same way every other coding agent in this repo is — as a CLI subprocess. Nothing in OpenAgents imports Pi's SDK, AgentSession, or any @earendil-works/* module, and no Pi source is vendored in. A test statically asserts this (test/pi.test.js → "never imports a Pi SDK or internal Pi module").

The adapter reuses the persistent-process model already proven by claude.js, structure for structure:

Concern claude.js pi.js
per-channel process record _persistentProcs[channel] same
process handle the daemon/stop path reads _channelProcesses[channel] same
release an idle channel _resetIdleTimer (1 h) same (1 h)
kill a wedged process _startWatchdog / _stopWatchdog (15 s × 20) same
cross-platform tree kill _stopProcess (SIGTERM→SIGKILL / taskkill /F /T) same
stop only one channel _onControlAction('stop', {channel}) same
dedup the stop notice _stopNoticeSent same
teardown on daemon shutdown stop()_stopAllProcesses same

What differs is the wire protocol. Claude Code takes one user message per stdin line and answers with a result event; Pi speaks a request/response RPC:

pi --mode rpc --session-dir <oa dir> --session-id <uuid> --no-approve \
   [--provider …] [--model …] [--thinking …] --append-system-prompt <text> --name <agent/channel>

Read the full file on GitHub · 448 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 448 lines · 0 tokens per session scan A 10bf7393f5b3

Subscribe to this mod's changes

pi is an agent published in the GitHub repository openagents-org/openagents (4,020 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 5,511 tokens. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.