Pi Coding Agent (2026): Setup, Models, and Running It in the Cloud
What the Pi coding agent is, how to install it, sign in, and pick a model, what it skips on purpose, and how to run Pi in the cloud with your laptop closed.
Pi is a free, open-source coding agent that runs in your terminal. It reads, edits, and writes files and runs shell commands, using almost any model you choose. Unlike Claude Code, it ships with no subagents, plan mode, or permission prompts, by design. Install it with one command, run /login, and give it a task.
- Install:
curl -fsSL https://pi.dev/install.sh | sh, then runpiin your project folder. - Models: 15+ providers and hundreds of models. Use a subscription, an API key, or a local model.
- The catch: Pi is minimal on purpose. No subagents, plan mode, or permission prompts unless you add them.
- In the cloud: Pi stops when your laptop sleeps. Run it on a machine that stays on, or in a Cloud thread.
What is the Pi coding agent?
Pi calls itself "a minimal, extensible agent harness that you can make your own." A harness is the program around the model. It sends your task to the model, runs the tools the model asks for, and keeps the conversation.
Pi ships with four tools: read, write, edit, and bash. Its system prompt is short, so more of the context window goes to your code. Everything else is an extension you can add or write.
Mario Zechner created Pi. In May 2026 the project moved to Earendil Works, and the npm package became @earendil-works/pi-coding-agent. It is MIT-licensed, and its GitHub repo had over 114,000 stars in October 2026. This guide uses Pi 1.1.0. OpenClaw is built on it.
How do I install Pi?
On macOS or Linux, use the official installer. It pins Pi's dependencies, and pi update keeps it current:
curl -fsSL https://pi.dev/install.sh | shOr install it from npm. This needs Node.js 22.19 or newer:
npm install -g --ignore-scripts @earendil-works/pi-coding-agentOn Windows, run powershell -c "irm https://pi.dev/install.ps1 | iex". Nix users can run nix run github:earendil-works/pi/stable. Check that it worked:
pi --versionHow do I sign in and pick a model?
Start Pi in the folder you want it to work in, then sign in:
cd /path/to/project
pi
/login/login lists the providers. Pick one and follow its sign-in, or store an API key. Pi supports Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, MiniMax, NVIDIA, OpenRouter, and more.
You can also skip /login and set the provider's key before you start Pi. That's handy on servers and in CI:
export OPENROUTER_API_KEY=...
pi --model openrouter/deepseek/deepseek-v4-proInside Pi, /model searches every model you can use, and Ctrl+P cycles through your favorites. You can switch models mid-session. For local models, /llama runs the llama.cpp router, and Ollama or LM Studio go in models.json.
How do I use Pi day to day?
- Steer while it works: press
Enterto send a message right away, orAlt+Enterto queue one for when it finishes. - Give it project rules: Pi loads
AGENTS.mdfrom your project, its parent folders, and~/.pi/agent/. - Go back in time: sessions are trees.
/treejumps to any earlier message and branches from there. - Pick up later:
pi -ccontinues your last session, andpi -rlets you pick one. - Share a session:
/exportsaves it as HTML, and/shareuploads it as a link. - Script it:
pi -p "fix the failing test"runs one task and exits. Add--mode jsonfor an event stream.
What does Pi skip on purpose?
Pi leaves out features other agents build in. Its site lists them plainly:
- No subagents. Start more Pi instances in tmux, or add them with an extension.
- No plan mode. Write plans to files, or add it.
- No permission popups. Run it in a container, or build your own confirmation step.
- No built-in to-dos. Use a
TODO.mdfile.
The idea: features are extensions. An extension is a TypeScript module that can add tools, commands, shortcuts, and UI. You can ask Pi to write one for you, then run /reload. Or install a package from pi.dev/packages:
pi install npm:@foo/pi-toolsOne change worth knowing: Pi used to ship without MCP. MCP is now built in, so older guides that say "no MCP" are out of date.
Is Pi safe to run on my laptop?
Pi doesn't ask before each tool call. It can read any file your user can read and run any command. That speed is the point, but it means one bad command runs on your real machine.
Pi's own advice is to run it in a container. Also keep ~/.pi/agent/auth.json private: it holds your API keys and sign-in tokens.
How do I run Pi in the cloud?
Pi runs wherever you start it. On a laptop, that means it stops when the lid closes. You have two ways out.
Your own server. Install Pi on a VPS or a Mac mini, sign in there, and run it inside tmux so it survives when you disconnect. You manage the machine, the security, and the copies of your code.
A Cloudroom Cloud thread. Cloudroom is a free, open-source desktop app for coding agents, and Pi is one of the harnesses it runs. Pick Pi and Cloud when you start a thread:
- Each thread gets its own isolated Linux sandbox and its own Git branch. Pi has full rights inside it, and none outside it.
- It keeps working when you close your laptop or quit the app. When it sits idle, it sleeps, and your next message wakes it.
- Pick a model as
provider/model, likeopenai-codex/gpt-6-astra. Sign in to that provider for Pi once. Pi calls the provider directly, with no markup. - Teleport moves a Pi thread between your Mac and the cloud, with its conversation and work.
- Pi has no built-in subagents, but any Cloudroom thread can start them, on Pi or other harnesses:
cloudroom thread spawn --provider pi --model openrouter/deepseek/deepseek-v4-pro \
--title "billing docs" --prompt "Write the billing docs."Cloudroom runs on macOS and Linux. Local threads are free. See Pricing for cloud plans, and Cloud threads for how sandboxes work.
A FEW DETAILS
Questions, answered.
Is the Pi coding agent free?
Yes. Pi is free and open source under the MIT license. You only pay for the model: a subscription you sign in to, an API key, or a local model that costs nothing to run.
Does Pi have subagents?
Not built in. Pi skips subagents on purpose. You can start more Pi instances in tmux, build an extension, or install a package. In Cloudroom, any thread can start subagents on Pi or on other harnesses like Claude Code and Codex.
Does Pi support MCP?
Yes. MCP is now built in, and Codemode lets the agent combine tool calls in a JavaScript sandbox. Older Pi versions shipped without MCP, which is why some guides still say it has none.
Can Pi use local models?
Yes. Pi connects to the llama.cpp router through the /llama command. For Ollama, LM Studio, vLLM, and other compatible servers, add the endpoint to models.json.
Does Pi ask before it runs a command?
No. Pi does not ask before each tool call, so it can read files and run shell commands on its own. Run it in a container or sandbox, or build your own confirmation step with an extension.
Can Pi keep working when my laptop is closed?
Not on the laptop. Pi runs where you start it, and a sleeping laptop runs nothing. Run Pi on a machine that stays on, or in a Cloudroom Cloud thread, which keeps working after you close your laptop.
What is the difference between Pi and Claude Code?
Pi is minimal and works with 15+ model providers. You add features like subagents and plan mode yourself. Claude Code is Anthropic's agent, built around Claude models, with subagents, plan mode, and permission prompts built in.