# Pi vs OpenCode: features, pricing and adoption compared

Pi and OpenCode compared from their docs and public data: built-in tools, subagents, MCP, permissions, pricing, npm downloads and GitHub stars. Reviewed 2026-11-02.

- Canonical: https://replicas.dev/resources/pi-vs-opencode

## Pi vs OpenCode adoption: npm downloads and GitHub stars

| Agent | npm downloads, Jan 2026 | npm downloads, Oct 2026 | GitHub stars |
| --- | --- | --- | --- |
| Pi [9](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@earendil-works/pi-coding-agent)[10](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@mariozechner/pi-coding-agent)[8](https://github.com/earendil-works/pi) | 1,134,515 | 18,159,471 | 119,428 |
| OpenCode [11](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/opencode-ai)[12](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@opencode/cli)[13](https://github.com/anomalyco/opencode) | 1,240,590 | 13,840,043 | 223,927 |

- Pi’s counts add its current package, `@earendil-works/pi-coding-agent`, to the original `@mariozechner/pi-coding-agent`. OpenCode’s add the 1.x package, `opencode-ai`, to the 2.x package, `@opencode/cli`. [9](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@earendil-works/pi-coding-agent)[10](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@mariozechner/pi-coding-agent)[11](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/opencode-ai)[12](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@opencode/cli)
- Pi is also a TypeScript SDK that other apps build on, such as OpenClaw, so its downloads include installs that never run the Pi CLI. Both counts include CI installs and updates, and miss each project’s install script. [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)

Monthly npm downloads, January to October 2026. GitHub stars checked November 2, 2026.

## Built-in tools in Pi and OpenCode

| Job | Pi (4 tools) | OpenCode (10 tools) |
| --- | --- | --- |
| Run shell commands | `bash` | `bash` |
| Read, edit, write files | `read` `edit` `write` | `read` `edit` `write` |
| Find files and search code | `grep` `find` `ls` (off by default) | `glob` `grep` |
| Fetch a web page | Not built in | `webfetch` |
| Delegate to subagents | Not built in | `task` |
| Load skills | Not built in | `skill` |
| Track a to-do list | Not built in | `todowrite` |

Pi’s defaults are `read`, `bash`, `edit` and `write`. It also ships `grep`, `find` and `ls`, which are off until you add them with `--tools` or `defaultTools`. [2](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/cli.md)

## Pi pricing

Pi has no model plans of its own.

- **Your own API key (Provider rates):** Anthropic, OpenAI, Google, Bedrock, Azure, OpenRouter, Groq, xAI, DeepSeek, OpenCode Zen and Go, and more. Custom providers can be added in `models.json`. [7](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/providers.md)
- **Existing subscription (What you already pay):** ChatGPT Plus or Pro, GitHub Copilot, and Claude Pro or Max. Pi’s docs say Claude usage from Pi is billed per token as extra usage, not from plan limits. [7](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/providers.md)

## OpenCode pricing

OpenCode also sells its own model plans, Go and Zen.

- **Your own API key (Provider rates):** 75+ providers through the AI SDK and Models.dev, plus local models. [15](https://opencode.ai/docs/providers)
- **Existing subscription (What you already pay):** ChatGPT Plus, GitHub Copilot and GitLab Duo. OpenCode stopped bundling Claude Pro and Max plugins in 1.3.0, saying Anthropic prohibits it. [15](https://opencode.ai/docs/providers)
- **Go ($10/mo):** Open models with usage caps. Go Plus is $40/month, and Go Teams is $20 per member per month. Pi also accepts Go keys, so one subscription works with both agents. [17](https://opencode.ai/docs/go)[7](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/providers.md)
- **Zen (Pay as you go):** Models from the OpenCode team, billed per request from prepaid credits. [16](https://opencode.ai/docs/zen)

## When to use Pi or OpenCode

- **You want a small, readable core — Pi:** Four default tools. Pi starts with read, bash, edit and write. Everything else is an option or an extension. [2](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/cli.md)
- **You want to build your own workflow — Pi:** Extensions, skills and packages. Pi leaves subagents and plan mode to TypeScript extensions you write or install, and shares them as npm or git packages. [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)
- **You want to embed an agent in your app — Pi:** SDK and RPC mode. Pi runs as an interactive terminal app, in print or JSON mode, over RPC, or as a TypeScript SDK. [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)
- **You want planning and subagents built in — OpenCode:** Plan, General and Explore agents. OpenCode includes a Plan agent that can’t edit files and two subagents it can hand work to. [18](https://opencode.ai/docs/agents)
- **You want LSP and permission rules — OpenCode:** Built in. Language server diagnostics and allow, ask or deny rules work without extensions. Pi has neither in its core. [21](https://opencode.ai/docs/lsp)[19](https://opencode.ai/docs/permissions)[4](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/security.md)
- **You want a desktop app or GitHub comments — OpenCode:** Desktop app, IDE extension, `/oc`. OpenCode has a desktop app and IDE extension, and a GitHub workflow that answers `/oc` comments. [14](https://opencode.ai/docs)[24](https://opencode.ai/docs/github)

## Features: Openness and models

| Feature | Pi | OpenCode |
| --- | --- | --- |
| License [8](https://github.com/earendil-works/pi)[13](https://github.com/anomalyco/opencode) | **MIT.** Created by Mario Zechner. The repository now lives under earendil-works. | **MIT.** From Anomaly. |
| Model choice [7](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/providers.md)[15](https://opencode.ai/docs/providers) | **Most major providers.** Built-in providers plus custom ones in `models.json`. | **75+ providers and local models.** Through the AI SDK and Models.dev. |
| Claude Pro or Max sign-in [8](https://github.com/earendil-works/pi)[15](https://opencode.ai/docs/providers) | **Billed as extra usage.** Pi’s sign-in screen says this usage is billed per token, not from plan limits. | **Not allowed.** OpenCode’s docs say Anthropic prohibits it; the plugins were unbundled in 1.3.0. |
| Instruction files [6](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/configuration.md)[20](https://opencode.ai/docs/rules) | **`AGENTS.md` or `CLAUDE.md`.** Loaded from the agent folder, parent folders and the current folder. | **`AGENTS.md`; `CLAUDE.md` fallback.** Reads CLAUDE.md when no AGENTS.md exists. |

## Features: Agent features

| Feature | Pi | OpenCode |
| --- | --- | --- |
| Subagents [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)[18](https://opencode.ai/docs/agents) | **Not built in.** Add one with an extension, or run more Pi instances in tmux. | **General and Explore.** Plus custom agents. |
| Plan mode [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)[18](https://opencode.ai/docs/agents) | **Not built in.** Write plans to files, or add plan mode with an extension. | **Plan agent.** A primary agent that can’t edit files. |
| Permission prompts [4](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/security.md)[19](https://opencode.ai/docs/permissions) | **None.** Pi doesn’t ask before tool calls. Its docs recommend a container, VM or sandbox. | **Allow, ask, deny.** Most actions allowed by default; `.env` reads and folders outside the project ask first. |
| MCP [3](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/mcp.md)[22](https://opencode.ai/docs/mcp-servers) | **Local and remote.** Added with `pi mcp add`, over stdio or streamable HTTP. | **Local and remote.** Configured in opencode.json. |
| Language servers [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)[21](https://opencode.ai/docs/lsp) | **Not built in.** No LSP integration in the core. | **Built in.** Diagnostics are fed back to the agent. |
| Sessions [5](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/sessions.md)[25](https://opencode.ai/docs/tui) | **Tree with branches.** `/tree`, `/fork` and `/clone` branch from any earlier message. | **Resume, undo and redo.** `/undo` and `/redo` roll back messages and file changes. |

## Features: Interfaces

| Feature | Pi | OpenCode |
| --- | --- | --- |
| Ways to run it [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)[14](https://opencode.ai/docs)[23](https://opencode.ai/docs/server) | **Terminal, JSON, RPC, SDK.** Interactive, print or JSON output, RPC for other processes, and a TypeScript SDK. | **Terminal, desktop, IDE, server.** Plus a server with an OpenAPI spec. |
| Customizing [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)[18](https://opencode.ai/docs/agents) | **Extensions and packages.** TypeScript extensions, skills, prompt templates and themes, shared through npm or git. | **Config, agents, plugins.** Config files, custom agents, commands, skills and plugins. |
| GitHub [1](https://github.com/earendil-works/pi/blob/main/packages/coding-agent)[24](https://opencode.ai/docs/github) | **Not built in.** No GitHub integration in the core. | **`/oc` comments.** `opencode github install` adds a workflow that answers comments. |

## Running Pi or OpenCode in the cloud

Both agents run on your own computer by default, so they stop when it sleeps or shuts down. Replicas runs each task in its own cloud VM with your repositories cloned.

- **Pick either agent:** Choose Pi or OpenCode for a chat, an automation, or a task started from the CLI or API. [26](https://docs.replicas.dev/features/coding-agents/pi)[27](https://docs.replicas.dev/features/coding-agents/opencode)
- **Share one set of credentials:** Both use the same OpenCode Go, Aster, OpenRouter or OpenAI-compatible credentials. [26](https://docs.replicas.dev/features/coding-agents/pi)
- **Start tasks from your tools:** Tasks can start from the dashboard, Slack, Linear, GitHub, the CLI, the API and more, and the agent opens the pull request.
- **Use your MCP servers and skills:** Pi in Replicas can use your organization’s MCP servers and skills. [26](https://docs.replicas.dev/features/coding-agents/pi)

Disclosure: Replicas publishes this comparison and supports both agents. It runs Pi, OpenCode, Claude Code, Codex and Cursor in a dedicated Linux VM per task, so you can send the same task to each and compare the pull requests. Try both on Replicas: https://app.replicas.dev/auth?mode=signup

## FAQ

### What is the Pi coding agent?
Pi is an open-source, MIT-licensed terminal coding agent created by Mario Zechner. It ships four default tools (read, bash, edit and write) and leaves out subagents, plan mode and permission prompts, which you can add with TypeScript extensions or Pi packages.

### Is Pi or OpenCode more popular?
By GitHub stars, OpenCode: about 224,000 against about 119,000 on November 2, 2026. By npm downloads, Pi: 18.2 million in October 2026 against 13.8 million, counting both packages for each. Pi is also an SDK inside other apps, such as OpenClaw, so its downloads include installs that never run the Pi CLI.

### Does Pi support MCP servers?
Yes. Pi connects to local and remote MCP servers over stdio or streamable HTTP, added with pi mcp add. OpenCode also supports local and remote MCP servers.

### Can I use a Claude subscription with Pi or OpenCode?
Pi can sign in with Claude Pro or Max, but its sign-in screen says that usage is billed per token as extra usage rather than drawn from plan limits. OpenCode stopped bundling Claude subscription plugins in version 1.3.0. Both work with an Anthropic API key, and both work with OpenCode Go and Zen keys.

### Which version of OpenCode should I install?
OpenCode now has a version 2 that uses the same opencode command. The opencode-ai npm package and OpenCode’s install script still install version 1, and Homebrew’s main formula installs version 2. This page describes version 1.

### Can I run Pi and OpenCode in the cloud?
Yes. Replicas runs both in their own cloud VM per task with your repositories cloned, using OpenCode Go, Aster, OpenRouter or OpenAI-compatible credentials. Tasks can start from the dashboard, Slack, Linear, GitHub, the CLI, the API and more.

## Sources

1. [Pi coding agent README](https://github.com/earendil-works/pi/blob/main/packages/coding-agent) (GitHub)
2. [Pi CLI reference](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/cli.md) (Pi)
3. [Pi MCP servers](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/mcp.md) (Pi)
4. [Run Pi safely](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/security.md) (Pi)
5. [Pi sessions](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/sessions.md) (Pi)
6. [Pi configuration](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/configuration.md) (Pi)
7. [Pi providers](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/providers.md) (Pi)
8. [earendil-works/pi repository](https://github.com/earendil-works/pi) (GitHub)
9. [@earendil-works/pi-coding-agent download counts](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@earendil-works/pi-coding-agent) (npm)
10. [@mariozechner/pi-coding-agent download counts](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@mariozechner/pi-coding-agent) (npm)
11. [opencode-ai download counts](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/opencode-ai) (npm)
12. [@opencode/cli download counts](https://api.npmjs.org/downloads/range/2026-01-01:2026-10-31/@opencode/cli) (npm)
13. [anomalyco/opencode repository and license](https://github.com/anomalyco/opencode) (GitHub)
14. [OpenCode intro and install](https://opencode.ai/docs) (OpenCode)
15. [OpenCode providers](https://opencode.ai/docs/providers) (OpenCode)
16. [OpenCode Zen](https://opencode.ai/docs/zen) (OpenCode)
17. [OpenCode Go](https://opencode.ai/docs/go) (OpenCode)
18. [OpenCode agents](https://opencode.ai/docs/agents) (OpenCode)
19. [OpenCode permissions](https://opencode.ai/docs/permissions) (OpenCode)
20. [OpenCode rules (AGENTS.md)](https://opencode.ai/docs/rules) (OpenCode)
21. [OpenCode LSP servers](https://opencode.ai/docs/lsp) (OpenCode)
22. [OpenCode MCP servers](https://opencode.ai/docs/mcp-servers) (OpenCode)
23. [OpenCode server](https://opencode.ai/docs/server) (OpenCode)
24. [OpenCode GitHub integration](https://opencode.ai/docs/github) (OpenCode)
25. [OpenCode TUI commands](https://opencode.ai/docs/tui) (OpenCode)
26. [Pi in Replicas](https://docs.replicas.dev/features/coding-agents/pi) (Replicas)
27. [OpenCode in Replicas](https://docs.replicas.dev/features/coding-agents/opencode) (Replicas)

## Related docs


