Pi and Claude Code are both terminal coding agents that can be pointed at an endpoint you choose, but they are not the same kind of product. Pi is MIT-licensed software that leaves out most agent scaffolding on purpose; Claude Code is proprietary software built around an enforced permission system and the Anthropic Messages protocol. Those two facts decide the comparison more than any feature list, because one of them is built to run whatever models your endpoint serves, while Anthropic documents the other as unsupported for that.
One disambiguation first, since the name collides. "Pi" here is the coding agent published at pi.dev by Earendil Inc. — not Pi by Inflection AI at pi.ai, not the Pi Network coin, and not Raspberry Pi. Its CLI is @earendil-works/pi-coding-agent, MIT, latest version 0.86.1 published September 20, 2026 on the npm registry, and its repository earendil-works/pi is MIT, not archived, and was last pushed to on September 21, 2026 (GitHub API). Claude Code installs from @anthropic-ai/claude-code, latest version 2.1.278 published September 19, 2026, and its LICENSE.md reads in full: "© Anthropic PBC. All rights reserved. Use is subject to Anthropic's Commercial Terms of Service". Both clients ship frequently, so treat these as the numbers on September 21, 2026 rather than as current; the documentation checks below are dated September 19, 2026.
Which one should you pick
Answer these in order. The first one that gives you a firm answer is the decision.
- Do you need permission rules someone else can rely on? Then Claude Code. Its permissions documentation defines six modes —
default(labelled Manual),acceptEdits,plan,auto,dontAskandbypassPermissions— and states that "Permission rules are enforced by Claude Code, not by the model", with allow, ask and deny rules you can check into version control or set in managed settings. Pi's security page says the opposite in plain terms: "Pi does not include a built-in sandbox", and built-in tools that "read files, write files, edit files, and run shell commands with the permissions of the pi process". Its usage page separately lists permission popups among the things it leaves out. - Do you need to run models from more than one lab in one client? Then Pi. Its custom-provider schema accepts
openai-completions,openai-responses,anthropic-messagesandgoogle-generative-ai. Anthropic's gateway page says it "doesn't support routing Claude Code to non-Claude models through any gateway". - Do you want MCP, subagents, plan mode and to-dos without building them? Then Claude Code. Pi's own feature page states that "It intentionally does not include built-in MCP, sub-agents, permission popups, plan mode, to-dos, or background bash", and points you at extensions, packages, containers and tmux instead.
- Does the agent itself need to be open? Then Pi: MIT on npm and in the repository, forkable, and drivable from another process through
--mode rpc. Claude Code's licence reserves all rights. - Do you need the desktop app, the web surface or Remote Control? Then Claude Code, and not through your own endpoint. Its overview says "Most surfaces require a Claude subscription or Anthropic Console account. The Terminal CLI, VS Code, and JetBrains also support third-party providers", and the desktop tab adds that a paid subscription is required. Remote Control is the separate case: Anthropic's environment-variable reference states that "As of v2.1.196, Remote Control is disabled when this points at a host other than
api.anthropic.com".
What none of this decides is which writes better code. No controlled comparison of the two was run for this page, and nothing below should be read as one.
Side by side
| Pi coding agent | Claude Code | |
|---|---|---|
| Licence | MIT, on npm and in the repository | Proprietary; all rights reserved |
| Maker | Earendil Inc. | Anthropic |
| Version checked | 0.86.1, published September 20, 2026 | 2.1.278, published September 19, 2026 |
| Surfaces | Terminal, plus scripted and RPC modes | Terminal, VS Code, JetBrains, desktop app, web |
| Permission system | None built in; runs with the user's own permissions | Six modes, enforced outside the model |
| MCP, subagents, plan mode, to-dos | Left out on purpose; add as extensions | Built-in features |
| Rollback | Use git or another checkpointing workflow | /rewind restores conversation and code to a checkpoint |
| Repository instructions | Loads AGENTS.md or CLAUDE.md | Reads CLAUDE.md, and can read AGENTS.md |
| Non-interactive mode | pi -p, with --mode json and --mode rpc | claude -p |
| Default way to pay | Sells no subscription of its own; per token unless you sign in to another vendor's plan | A Claude subscription, or a Console account |
Rows read from Pi's quickstart, usage and security pages and from Claude Code's overview, permissions and cost documentation, September 19, 2026.
The execution model is the real difference
Read Pi's omission list as a specification rather than as missing features: the six things it names are the six most buyers assume every agent has. If your workflow depends on an MCP server, a planning step before edits, or a permission prompt you can say no to, Pi asks you to build or install that, not to configure it.
Claude Code sits at the other end. The rules are evaluated by the client, deny takes precedence, and a PreToolUse hook cannot override a deny rule — so they survive whatever the prompt or CLAUDE.md says, which is what makes them useful to an organization rather than to one developer. Pi's nearest concept, project trust, is narrower by its own description: "Project trust is only an input-loading guard. It prevents a repository from silently changing pi's settings or extensions before you approve it. It does not make untrusted code, untrusted prompts, or untrusted model output safe."
Neither posture is wrong, but only one of them answers an audit question. Settle it before comparing prices: configuration cannot close this gap.
Pointing each client at your own endpoint
This is the second structural difference, and it runs the other way. Claude Code takes an environment variable and one protocol family; Pi takes a JSON file and four.
| Claude Code | Pi coding agent | |
|---|---|---|
| Where the endpoint goes | ANTHROPIC_BASE_URL, plus a credential variable | ~/.pi/agent/models.json |
| Protocols accepted | Anthropic Messages, Bedrock InvokeModel, Agent Platform rawPredict | OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, Google Generative AI |
| Non-Claude models | Not supported through any gateway, per Anthropic | Whatever the endpoint serves |
| Model list | Opt-in discovery only; keeps ids containing "claude" or "anthropic" | You write the models array yourself |
| Cost readout | Computed locally from token counts at list price | Zeros until you type the rates in |
| Unknown model id | Assumes a 200K context window, or 1M when the id carries [1m] | Defaults to 128,000 context and 16,384 output tokens |
| What the switch turns off | MCP tool search, Remote Control and fine-grained tool streaming, each by default | Pi's documentation names no feature that adding a custom provider turns off |
| Effect on a subscription | A gateway credential replaces it for that session | Pi's own /login subscription providers are separate entries; a custom provider sits beside them |
The Claude Code column comes from its environment-variable reference and gateway compatibility guide, checked September 19, 2026. The "turns off" row is worth spelling out, because each item is a feature you lose quietly rather than an error you see. A non-first-party ANTHROPIC_BASE_URL disables MCP tool search by default, re-enabled with ENABLE_TOOL_SEARCH=true if the proxy forwards tool_reference blocks; as of v2.1.196 Remote Control is disabled when that variable points anywhere other than api.anthropic.com; fine-grained tool streaming is off by default; and model discovery is opt-in, with CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 sending GET /v1/models?limit=1000 on a three-second timeout, treating any redirect as failure, and keeping only entries whose id contains claude or anthropic. Two checks bypass the variable entirely and call api.anthropic.com directly — the fast-mode availability check and the WebFetch domain safety check — so a network that blocks that host breaks them even while inference works.
The credential line matters for billing, not just for auth. Anthropic's gateway page is explicit: while a gateway credential is active "the credential replaces the subscription login for that session, and the subscription's usage limits don't apply", and that traffic is billed per token to whoever owns the credential. Setting only the base URL does not do that — a saved claude.ai login stays the active credential and its limits still apply.
# Claude Code: two environment variables, and whatever answers at that
# origin has to speak the Anthropic Messages API.
export ANTHROPIC_BASE_URL=https://api.kunavo.com # origin only, no /v1
export ANTHROPIC_AUTH_TOKEN=sk-kn-... # replaces the subscription
export ANTHROPIC_MODEL=claude-sonnet-5The origin has no /v1: Anthropic-style clients append /v1/messages themselves, so https://api.kunavo.com/v1 produces requests to /v1/v1/messages and a 404. See the base-URL page and the Claude Code setup guide. One more Kunavo-specific consequence: this API serves no /v1/messages/count_tokens route, and Claude Code's compatibility guide says token-counting endpoints are the only optional ones — without it, "Claude Code falls back to a character-based estimate of context usage", so /context shows approximate counts.
Pi's version of the same job is a file, and because it accepts OpenAI-shaped APIs it can take the route Claude Code has no option for:
{
"providers": {
"kunavo": {
"baseUrl": "https://api.kunavo.com/v1",
"api": "openai-completions",
"apiKey": "$KUNAVO_API_KEY",
"models": [
{
"id": "claude-sonnet-5",
"name": "Claude Sonnet 5",
"cost": {
"input": 2,
"output": 10,
"cacheRead": 0.2,
"cacheWrite": 2.5
}
}
]
}
}
}Watch the trailing /v1. An openai-completions provider wants https://api.kunavo.com/v1. For the anthropic-messages shape, Pi's models documentation shows both spellings in its own examples — https://proxy.example.com/v1 under custom headers, and a bare https://proxy.example.com under Anthropic Messages compatibility — so it does not settle the question, and if a first call 404s this is the line to change. Two more Pi-specific traps from the same page: a custom model's cost block defaults to zero across every rate category, so a provider you add reports $0 in the footer, which Pi documents as showing session cost, until you type the rates in; and contextWindow and maxTokens silently default to 128,000 and 16,384, so set both to the window published on the model's page in the catalog. Credential precedence is documented and worth knowing when a stale key wins: the CLI --api-key flag, then auth.json, then an environment variable, then models.json.
Plans and token bills on the same page
Neither client charges for itself, so the whole difference in cost is which layer you buy. Pi has nothing to buy at all: it is MIT-licensed, and pi.dev publishes no plan, tier, seat or hosted service. Claude Code is free to install and then needs access from somewhere.
| What you are buying | Published price | Where that comes from |
|---|---|---|
| Pi coding agent | $0, MIT-licensed, nothing to subscribe to | pi.dev and the npm package metadata |
| Claude Code, the software | $0 to install; access needs a subscription, a Console account, a cloud provider or a third-party endpoint | Claude Code's overview page |
| Claude Pro | "$17 Per month with annual subscription discount ($200 billed up front). $20 if billed monthly." | claude.com/pricing |
| Claude Max | "From $100 Per month", with 5x or 20x more usage than Pro; no separate 20x figure is published | claude.com/pricing |
| Claude Team, standard seat | $20 per seat / month billed annually; $25 billed monthly | claude.com/pricing |
| Claude Team, premium seat | $100 per seat / month billed annually, $125 monthly — but Anthropic's enterprise-deployment page shows $150 per Premium seat; confirm in checkout | Two Anthropic pages that disagree |
| Claude Enterprise | "Seat price + usage at API rates", with the seat shown as "$20/seat/month, billed annually" | claude.com/pricing |
| Kunavo | Prepaid credit, billed per token, minimum top-up $10 | The catalog and billing |
All Anthropic plan figures quoted from claude.com/pricing on September 19, 2026. Two honest gaps: the Max page publishes no separate price for the 20x tier, so any "$200 for Max 20x" you read elsewhere is not from that page; and the premium-seat figure genuinely differs between the pricing page and the enterprise deployment overview, which shows "Teams: $150/seat (Premium) with PAYG available". Neither is resolved here — check the number checkout actually quotes you. No Anthropic page found in this check publishes hours, messages or token counts for Pro, Max 5x or Max 20x, so no usage figure appears on this page either.
What the tokens cost
Put both clients on the same endpoint and they pay the same rate per token; what differs between them is how much context each re-sends per step, which depends on your repository far more than on the tool and was not measured here.
The table below is illustrative token arithmetic, not a measured task cost and not a bill ceiling. Assume one working day of agent use: 12 turns, each sending 60,000 uncached input tokens and receiving 3,000 output tokens, for 720,000 input and 36,000 output in total, with no cache reads, no cache writes, no images and no tool charges. Kunavo rates are rendered from the live catalog; the vendor column is claude.com/pricing, checked September 19, 2026.
| Model | Kunavo per 1M in / out | Vendor list per 1M in / out | Day estimate, Kunavo rates | Day estimate, list rates |
|---|---|---|---|---|
| Claude Haiku 4.5 | $0.40 / $2.00 | $1.00 / $5.00 | $0.36 | $0.90 |
| Claude Sonnet 5 | $2.00 / $10.00 | $2.00 / $10.00 | $1.80 | $1.80 |
| Claude Opus 5 | $2.00 / $10.00 | $5.00 / $25.00 | $1.80 | $4.50 |
Read the rows rather than the ranking. Claude Sonnet 5 sits at the same number in both columns, so for that model the route is not a price question at all; Claude Opus 5 is where the two columns separate. Scale by your own working days before treating any of it as a budget — and note that this assumes no caching, which is the single largest omission. Anthropic's own cost page states that the prompt-cache lifetime "is an hour on a subscription and drops to five minutes once you're drawing on usage credits; on an API key or cloud provider, it's five minutes by default", so how you pay changes the cache hit rate and therefore the bill. Kunavo cache charges are documented at caching; whether Pi's PI_CACHE_RETENTION=long reaches this endpoint has not been tested.
For a published anchor rather than arithmetic, Anthropic's cost documentation reports that "Across enterprise deployments, the average cost is around $13 per developer per active day and $150-250 per developer per month, with costs remaining below $30 per active day for 90% of users", with background processes typically under $0.04 per session. That is Anthropic's figure for Claude Code on its own billing; no equivalent figure exists for Pi, because nobody publishes one. Kunavo's catalog amount is a billing floor rather than a cap — when the upstream reports its charge, the bill is the greater of catalog cost and upstream cost times the applicable markup, as billing explains — and the minimum top-up is $10 in prepaid credit, a funding minimum rather than a task fee or a subscription.
The subscription question nobody can settle for you
Both clients can be signed in with a Claude plan, and three official sources describe what that does differently. They are quoted here with their dates rather than resolved, because resolving them from outside would be a guess.
| Source | Date | What it says |
|---|---|---|
| Pi's provider documentation | Checked September 19, 2026 | Third-party harness usage "draws from extra usage and is billed per token, not against Claude plan limits" |
| Anthropic's login article | May 19, 2026 | API key authentication is "the preferred way" for third-party tools; Anthropic may allow subscribers with usage credits to use certain ones, and reserves the right to draw that use from usage credits rather than subscription limits |
| Anthropic's Agent SDK article | Last updated June 16, 2026 | The planned change is paused: "Claude Agent SDK, claude -p, and third-party app usage still draw from your subscription's usage limits" |
Nothing on any Anthropic page names Pi specifically, and the login article's permission is discretionary rather than a guarantee. The one part all three agree on is the direction of travel: an API credential is the route Anthropic prefers for a third-party client, and in Claude Code a gateway credential removes the subscription from the session entirely. Check Settings then Usage in your own account before routing paid work through a plan. Claude plan limits covers the subscription side, and Pi pricing goes further into Pi's four ways to pay.
What moving between them actually costs
Less than the feature lists suggest, in one direction. Repository context transfers unchanged: Pi loads AGENTS.md or CLAUDE.md from the current and parent directories, with ~/.pi/agent/AGENTS.md for global instructions, so a repo already set up for Claude Code needs no edits to be read by Pi. Scripted usage has a counterpart on both sides too — claude -p and pi -p, with Pi adding --mode json and --mode rpc for process integration.
What does not transfer is everything in the execution-model section: permission rules, MCP servers, subagent definitions and plan mode have no built-in Pi counterpart to migrate to — Pi's usage page points at extensions, packages, containers and tmux instead — and the desktop and web surfaces have none at all. Going the other way, a Pi extension has no Claude Code counterpart to install. No hour or day estimate for the switch is offered here, because there is no basis for one — run one bounded, real task on each before moving scheduled work.
If you are shortlisting more broadly, Pi vs OpenCode and OpenCode vs Claude Code cover the two adjacent pairs, and Claude Code alternatives separates the tool question from the billing question first. For the endpoint itself, the Claude Code setup guide is the published configuration reference, and creating a Kunavo account gets you a key to test one task against.
FAQ
What is the difference between the Pi coding agent and Claude Code?
Licence, execution model and protocol reach. Pi is MIT-licensed software from Earendil Inc., and its own documentation says it intentionally ships without built-in MCP, sub-agents, permission popups, plan mode, to-dos or background bash — you add those as extensions or use containers and tmux. Claude Code is proprietary; its LICENSE.md reserves all rights, and it ships a six-mode permission system whose allow, ask and deny rules are enforced by Claude Code rather than by the model, plus MCP, subagents and plan mode as built-in features. On protocol, Pi accepts four API shapes, including OpenAI-compatible ones; Claude Code accepts Anthropic Messages, Amazon Bedrock InvokeModel or Google Cloud's Agent Platform rawPredict, and Anthropic's own gateway documentation says it does not support routing Claude Code to non-Claude models through any gateway.
Is the Pi coding agent better than Claude Code?
No comparison of output quality is published here, because none was run — no controlled task set, no scored diffs, no timings. The choices that can be decided from documentation are different ones: whether you need permission rules that an organization can lock down, whether you want the agent itself to be MIT and forkable, whether you need to run models from more than one lab inside one client, and whether the surfaces matter to you. Claude Code's overview says most of its surfaces require a Claude subscription or an Anthropic Console account, that the desktop app requires a paid subscription, and that the Terminal CLI, VS Code and JetBrains are the surfaces that also support third-party providers.
Can Claude Code use non-Claude models through a gateway?
Anthropic's gateway documentation states that any gateway exposing a supported API format works, and that Anthropic “doesn't endorse, maintain, or audit third-party gateway products, and doesn't support routing Claude Code to non-Claude models through any gateway” (checked September 19, 2026). The client-side machinery points the same way: gateway model discovery, when a developer opts in with CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1, keeps only entries whose id contains “claude” or “anthropic” and ignores the rest. Pi's documentation describes no equivalent filter: you write the models array in models.json yourself.
Is Pi a drop-in replacement for Claude Code?
Not in the sense of feature parity, and Pi does not claim to be. Its own documentation lists built-in MCP, sub-agents, permission popups, plan mode, to-dos and background bash as things it intentionally omits, and its security page says “Pi does not include a built-in sandbox” and that its built-in tools run “with the permissions of the pi process”. What does transfer is repository context: Pi loads AGENTS.md or CLAUDE.md from the current and parent directories, so a repository set up for Claude Code keeps its project instructions without edits. Pi also has a non-interactive mode, pi -p, with --mode json and --mode rpc for scripting.
Does a Claude Pro or Max subscription work inside Pi?
Three official sources describe this differently and they are not fully reconcilable from outside. Pi's provider documentation says third-party harness usage “draws from extra usage and is billed per token, not against Claude plan limits”. Anthropic's login article, dated May 19, 2026, says API key authentication is the preferred way for third-party tools, that Anthropic may at its discretion allow subscribers with usage credits enabled to use certain third-party tools, and that it reserves the right to draw that use from usage credits rather than subscription limits. Anthropic's Agent SDK article, last updated June 16, 2026, says the planned change was paused and that Agent SDK, claude -p and third-party app usage still draw from subscription usage limits. Check Settings then Usage in your own Anthropic account before you route paid work this way.
Which one is cheaper to run?
Neither charges for the software: Pi is MIT-licensed with no plan or hosted tier, and Claude Code costs nothing to install. The bill is model tokens, and if both clients are pointed at the same endpoint they pay the same per-token rate, so a price difference between them comes from defaults rather than from the tools. What differs is the default path: Claude Code's is a Claude subscription, and Anthropic publishes an average of around $13 per developer per active day and $150-250 per developer per month across enterprise deployments; Pi has no subscription of its own, so it is per-token from the first request unless you sign in with someone else's plan.
Can one Kunavo key serve both clients?
Structurally yes, and by different routes. Claude Code takes ANTHROPIC_BASE_URL set to the origin https://api.kunavo.com, with no /v1, because the client appends /v1/messages itself. Pi takes a provider block in ~/.pi/agent/models.json, and its schema accepts both the anthropic-messages and the OpenAI-compatible shapes, so either route at this endpoint is expressible; the OpenAI-compatible one is https://api.kunavo.com/v1. Neither client has been runtime-tested against Kunavo, and a published setup guide is a configuration reference rather than a compatibility test, so keep a working route available while you try it.
Documentation and plan prices checked September 19, 2026 and re-confirmed September 21, 2026: pi.dev's quickstart, usage, models, providers and security pages; code.claude.com's overview, permissions, costs, environment-variable, gateway and gateway-compatibility pages; claude.com/pricing; and two support.claude.com articles. Version numbers, the anthropics/claude-code licence file and the GitHub API for earendil-works/pi were re-fetched September 21, 2026. Kunavo token rates are rendered from the live catalog and every dollar figure here is illustrative token arithmetic, not a measured task cost. Neither client has been runtime-tested against Kunavo, and no quality, speed or benchmark comparison between them was run.