Pi is the best fit in this cluster when you want a small terminal harness you can program. Its default model gets four tools—read, write, edit, and bash—while TypeScript extensions, skills, prompt templates, and packages let you replace or add workflow behavior.

Pi deliberately does not prescribe every agent feature. Its README says features such as subagents and plan mode are not built into the core; you can add a package or build the behavior you need.

Quick facts

QuestionPi answer
InterfaceInteractive terminal, print/JSON, RPC, and embeddable SDK
Core toolsRead, write, edit, bash
StatePersistent JSONL sessions with branching, fork and resume
Long contextAutomatic/manual compaction with customizable summarization
ExtensibilityTypeScript extensions, custom tools, skills, prompts, themes, packages
GLM-5.2Native zai model configuration with 1M context
Best forDevelopers who want to shape the harness around a terminal workflow

Install Pi

The repository documents this npm path:

1
2
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
pi

--ignore-scripts disables dependency lifecycle scripts; Pi says normal npm installation does not require them. An installer script is also available, but inspect remote scripts before piping them into a shell.

After launch:

1
2
/login
/model

Choose the provider and model tied to the account you intend to bill.

Use GLM-5.2 Without Mixing Billing Paths

Pi publishes a native zai configuration for glm-5.2 with:

  • base URL https://api.z.ai/api/coding/paas/v4;
  • 1,000,000-token context;
  • 131,072 maximum output tokens;
  • an API-key field in the provider configuration.

The zero-cost fields on Pi’s model catalog appear to describe its Coding Plan provider accounting; they are not evidence that GLM-5.2 PAYG usage is free. Check the GLM-5.2 model guide for current API list pricing and Z.AI for subscription rules.

Sessions and Compaction

Pi stores sessions as JSONL trees and supports resume, fork, clone, and navigation:

1
2
3
4
/session
/tree
/fork
/compact Preserve acceptance criteria, failed hypotheses, changed files, and test results.

Automatic compaction summarizes older content when context approaches its limit or overflows. This is recovery machinery, not free memory: summarization can omit important constraints. Keep acceptance criteria in the current prompt and review the diff and tests after compaction.

Extensions and Custom Tools

Pi extensions can:

  • register tools callable by the model;
  • intercept or block tool calls;
  • inject context or customize compaction;
  • add commands, UI, shortcuts, providers, and session behavior;
  • control active tools and model selection.

That makes Pi useful for repository-specific guardrails. A practical extension can deny network or publish actions, expose a typed test runner, and require a final diff review instead of giving the model unrestricted shell conventions.

Project-local settings and extensions are a trust boundary. Pi asks before loading them in an untrusted project; inspect repository-owned agent configuration before approval.

Productive Starting Prompt

1
2
3
4
5
Fix the single failing test I name.
Reproduce it before editing, read only the nearest implementation files,
make the smallest patch, rerun the focused test, and show git diff.
Do not install, commit, push, delete, or use the network.
Stop if the failure cannot be reproduced.

For audit and refactor prompts plus a comparable results card, use Pi vs ZCode vs OpenCode.

Choose Pi When

  • You prefer terminal-first work and want little UI between you and the model.
  • You need custom tools or lifecycle hooks instead of a fixed product workflow.
  • Persistent session trees and customizable compaction matter.
  • You are prepared to define permissions, verification, and provider billing explicitly.

Choose ZCode for a GLM-5.2-native desktop environment. Choose OpenCode for broader provider, IDE, GitHub, and permission defaults.

Sources


Last verified: July 2, 2026. Recheck Pi provider configuration and Z.AI’s supported-tool policy before using subscription credentials.