Pi Web is a browser-based interface for the pi coding agent, allowing users to manage conversations, models, resources, project files, and Git worktrees through a local web application. It is for developers who want to browse and resume agent sessions, run new turns, configure providers, and inspect project files in a browser. The catalogue entry is an instruction for using Pi Web.
Borrowing it
Nothing to install: this file belongs to agegr/pi-web. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/agegr/pi-web/main/AGENTS.mdgit clone --depth 1 https://github.com/agegr/pi-webWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/agegr/pi-web/agents-md)<a href="https://agentmods.dev/instructions/agegr/pi-web/agents-md"><img src="https://agentmods.dev/badge/instructions/agegr/pi-web/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/agegr/pi-web/agents-md"><img src="https://agentmods.dev/badge/instructions/agegr/pi-web/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.09067 | $0.09067 |
| Opus 5.5 | $0.03627 | $0.03627 |
| Sonnet 5.5 | $0.01813 | $0.01813 |
| Haiku 4.5 | $0.00907 | $0.00907 |
Grade B, and why
pi-web AGENTS.md scanned grade B with 1 finding 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 2d ago.
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.
Reads MCP configurationmediumAgent snooping
mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.
mcp-undo.ts removed mcp.json entries kept 60 s for undo; only a token reaches the browser How it starts
The opening of the file, as written. The whole thing — 322 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pi Web - Development Notes
Quick Start
npm run dev # port 30141
Typecheck: node_modules/.bin/tsc --noEmit · Lint: npm run lint
Never run next build during dev: it pollutes .next/ and breaks npm run dev.
Dev server troubleshooting
- First run
lsof -nP -iTCP:30141 -sTCP:LISTENand reuse a healthy Pi Web process. A secondnext devon another port is no workaround: both contend for.next/dev/lock. - A browser-only
Module ... factory is not availableoverlay usually means that tab has a stale Turbopack/HMR graph, not a broken server or source. Use the browser's explicit reload, then compare the server log and a direct HTTP/API request. - Restart only when the failure reproduces from a fresh page and the server-side checks fail too: stop that exact dev process gracefully, move
.nextinto amktemp -dbackup, restart withnpm run dev. - Never fall back to
next dev --webpack: the dev graph can fail onundiciimports such asnode:console. Development uses Turbopack. next devmay append a generatedBEGIN:nextjs-agent-rulesblock toAGENTS.md. It is tooling output: checkgit statusand keep it out of unrelated commits.
Upgrading pi
pi's packages up to 1.2.0 depend on each other with ^ ranges (1.3.0 pins them exactly), and the published pi-web's dependencies resolve afresh on install (no lockfile ships). Install every @earendil-works/* package the tree holds, the SDK's own dependencies included (pi-codemode, pi-mcp, pi-telemetry, …), with npm install --save-exact, so npm reuses those exact versions for the SDK's ranges. lib/pi-packages.test.mjs fails on any pi package that is not pinned that way; pi-web 0.12.0 pinned four, and installs after pi 1.2.0 paired pi-coding-agent 1.1.0 with pi-codemode 1.2.0.
Architecture
- Browsing (read-only, no AgentSession):
GET /api/sessionslists~/.pi/agent/sessions/;GET /api/sessions/[id]reads the.jsonlthrough SDKSessionManagerhelpers andlib/session-reader.ts, or an open wrapper's in-memorySessionManager.GET /api/agent/runningsnapshots the running ids. - Sending:
POST /api/agent/[id]→startRpcSession()(lib/rpc-manager.ts) creates the AgentSession in-process (createAgentSessionFromServices());session.send(cmd)→session.prompt(). - Events:
GET /api/agent/[id]/eventsstreams SSEdata: {...}fromsession.onEvent(), fed bysession.subscribe(). - Product scope: a light web wrapper around pi, not an IDE or a platform of its own. Before adding a feature, check the out-of-scope list in CONTRIBUTING.md.
- Extension compatibility (principle): extensions written for the pi CLI must behave the same here. Fix display problems in the web client; never add pi-web-only options or fields to the extension API (
ctx.ui.*options,extension_ui_request). pi's TUI (node_modules/@earendil-works/pi-tui) is the reference for what an extension asking for something means.
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.
- 2d ago Changed · +1 lines · +71 tokens per session b7cee8343e39
- 3d ago Changed · +15 lines · +541 tokens per session e5e4f78fc248
- 7d ago Changed · +13 lines · +567 tokens per session a9769e8f5ffd
- 17d ago Changed · +4 lines · +212 tokens per session fa75b4b817f5
- 19d ago Changed · +31 tokens per session fe1e4ed27dcb
- 22d ago Changed · +11 lines · +485 tokens per session 5ff1bd041ea8
- 23d ago Changed · +1 lines · +49 tokens per session 8c5685a0bca6
- 24d ago Changed · +4 lines · +164 tokens per session 3d02bc030eae
- 26d ago Changed · +9 lines · +376 tokens per session 031abfec5e2c
- 27d ago First seen · 264 lines · 6,571 tokens per session scan B 0cf81d70023f
pi-web AGENTS.md is an instructions file published in the GitHub repository agegr/pi-web (8,063 stars, last pushed 2d ago), licensed MIT. It adds 9,067 tokens to every session, about $0.0363 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads mcp configuration). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
pi-web AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pi-web AGENTS.mdagegr/pi-web | Instructions file | 8.1k | 2d ago | MIT | B | 9,067 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |