pi, fully loaded. Nothing forked.
A harness for pi, the terminal coding agent. Six sub-agents that research, review and build in parallel. Web, GitHub and screenshot tools. Edits you can undo. A TUI built for all-day sessions. And a pi that starts as fast as stock, with every patch inside.
37 tools · 6 sub-agents · 20 MCP servers · 13 skills · 0.25 s to start with every extension · on stock pi 1.7.0
git clone https://github.com/humblemuzzu/muzzpi.git && cd muzzpi
./install.sh pi --with-deps # installs what is missing, then the harnessThe installer checks your pi before it touches anything, backs up whatever it
overwrites, and ends with an audit that prints the exact fix for anything that
did not land. --with-deps installs the Homebrew formulae it needs, pi at the
version its patches were made on, and Rust if searchd is to be built. Without
it, the installer installs nothing you are missing and names what it is;
--dry-run prints every change and makes none.
Built and used daily by Muzzammil since March 2026.
The last 30 days, one machine:
| Sessions | 148, on all 30 days |
| Tool calls | 28,396 |
| Sub-agent runs | 1,154: delegate 557 · chad 405 · review_code 91 · read_web_page 66 · librarian 21 · oracle 7 · finder 7 |
| Screenshots | 412 |
| Web searches | 77 |
Every number in this README comes from the repo, those sessions, or a benchmark on an M4 Pro (48 GB, macOS 27).
| patched pi, the old way | muzzpi now | |
|---|---|---|
| Open pi until you can type | 447 ms | 272 ms |
| Each sub-agent start | 348 ms | 186 ms |
| Full start, all 17 extensions | 376 ms | 211 ms |
pi --version |
269 ms | 111 ms |
| Memory per pi process | 163 MB | 138 MB |
Medians of 11–15 runs, alternated between versions so load hits both equally,
measured on pi 1.3.0 with 17 extensions. On pi 1.7.0 with all 20
(perf-baseline.ts, median of 15): a full
start takes 250 ms and a sub-agent 200 ms.
- pi's own build recipe, on our patched files. pi ships a fast prebuilt
copy of itself, but it was built before any patch, so a patched pi had to run
its slow loose files.
build-pi-bundle.mjsruns pi's own recipe on the patched files instead. On stock pi it reproduces 75 of pi's 80 files byte for byte; the other 5 are newer dependencies npm resolved. It matches stock speed exactly (111 vs 109 ms) and refuses to build when pi changes its recipe. - MCP servers connect when first used. Stock pi connects every server at startup; its own prebuilt copy takes 733 ms to start with this setup.
- Each extension ships as one prebuilt file. Sub-agents load the 5 they need, not all 19.
- Every transcript row caches its render. A 700k-token session types at 10 ms per keystroke; it was 180.
- Long replies and long sessions stay light. A streaming reply is lexed from its last blocks instead of in full every frame: a 60,000-character answer costs 10.7 s of CPU, it was 23.2. A 40-prompt session holds 453 MB, it was 1,314: macOS no longer keeps pi's freed buffers.
Opening pi went from 1.1 s to 0.44 s to 0.27 s since March.
find and grep are answered by searchd, a small Rust daemon built on
ripgrep's own crates, and fall back to rg whenever it cannot vouch for an
answer.
rg, every call |
searchd | |
|---|---|---|
find **/*.ts, this repo (443 files) |
8.2 ms | 1.1 ms |
find **/AGENTS.md, 63k files of projects |
109 ms | 14 ms |
| rare identifier, 63k files of projects | 1.87 s | 18 ms |
find **/AGENTS.md, all of ~ (1.5M files) |
5.1 s | 22 ms |
rare identifier, all of ~ |
over 60 s | 83 ms |
find **/AGENTS.md, the whole Mac |
25 s | 23 ms |
- The same answers as
rg. It walks with ripgrep'signorecrate and searches with its matcher and JSON printer.searchd selftestcompares 1,296 queries against thergon your machine, and it serves nothing until they agree. - Never stale. A repo-sized scope is checked against the disk folder by
folder before each answer;
~or/waits for macOS's change feed to deliver everything that happened before the question. - Only what you search. System folders, apps,
~/Library, toolchains, package caches, agent transcripts, and dependency or build folders outside git repos are never indexed (the whole disk's 3.6M entries became 190k). A search inside one goes torg; a search of~or/says how many it left out. A repo is answered exactly or handed torg, never approximated. - Content index: which 3-byte chunks each text file in
~holds. It only narrows the files read; every match comes from reading the file. 270 MB on disk here, 155k files, warmed in about three minutes in the background. A file is read for it only once it has been still for two minutes. Credential files (.env, keys,auth.json,credentials/) never enter it: they are read at query time instead. - Costs pi nothing. No work at startup; a call is a one-line socket round
trip (0.3 ms for a small listing), where starting
rgcosts 7 ms. A common pattern with a small match limit can be a wash — searchd reads some files in order first, asrgdoes. - Optional, and macOS-only. One native binary the installer builds from
searchd/. Without Rust, or on another OS,findandgreprunrgexactly as before.PI_SEARCHD=0turns it off. - Quiet on battery. Idle it uses 0.03% CPU and a 23 MB footprint; a start walks the disk in about 3 s and the index warms behind it, at macOS's lowest priority. No Full Disk Access, and it answers only processes macOS attributes to the app it was started from, so it lends no other app that app's folder access.
- Budgets it is held to: under 0.2% CPU and 50 MB at idle, under 300 MB at peak, and an index kept under a 1 GiB cap that never takes the volume below a 5 GiB free-space floor.
- Removing it:
~/.pi/agent/bin/searchd uninstallstops the daemon and deletes its data dir and its binary.
Each is a fresh pi process with a short prompt naming exactly the tools it has. Pick by what you need back:
| Agent | Returns | Default model |
|---|---|---|
finder |
file paths and line ranges | DeepSeek Flash |
chad |
an answer with path:line evidence, verified vs inferred |
DeepSeek Flash |
oracle |
one verdict, its trade-offs and effort | Sonnet 5.5 |
delegate |
finished work | Sonnet 5.5 |
librarian |
how code works across GitHub repos you have not cloned | DeepSeek Flash |
review_code |
a structured review of a diff described in plain words | Sonnet 5.5 |
- They run in the background. A call returns at once and the answer
arrives as a message that wakes the main agent; agents that finish together
arrive as one. Pass a
continueIdback to redirect a running agent or to follow up a finished one;agentslists or stops them. In the main session an agent call never blocks;Ctrl+Bsends a waiting bash command to the background. - Say it, get it. "Three chads on deepseek flash, medium thinking, in
parallel" runs exactly that. Models live in one file,
agent-models.json; a name not on it is refused, never swapped for the nearest one. Every result ends with the model and thinking level that actually ran./agents models mainmoves delegate, oracle and review_code onto whatever model your main session is on;/agents models list(the default) puts them back. - chad cannot write. No
editorwrite, and its bash runs under an allowlist that refuses redirection,sed -i, interpreters and every git command that mutates. Finding out is chad; doing is delegate. - No fork bombs. Only delegate can start another agent (finder). A chad swarm cannot spawn a swarm.
- A stalled child is killed, never left hanging: 900 s without output.
edit and write are pi's own tools with a thin layer on top.
- Every change is saved to disk first, so
undo_editandredo_editwork across restarts. They refuse when a later change or an outside edit touched the file. - A failed match names the first differing line, column and character.
permissions.json: no shelling out to other agents. Localrmis refused and points attrash; over ssh, deletes run.- Git that is safe with parallel sessions in one checkout.
commitstages exactly the files the agent names and commits only those.git add .,git add -A,git commit -aand force pushes are refused;git hunksstages part of a file. No skill to load: the rules are in the tools. - A comment gate refuses a patch that is mostly commentary.
- Every command declares a timeout, 1–3600 s.
- A command still running after a minute moves to the background as a job. The
agent gets its output so far and keeps working or ends its turn; the result
wakes it when the command ends, or as soon as a line matches its
wake_onpattern. Jobs show in the agents dock. Sub-agents get the same, and wait for their jobs and agents before they report. Agents always run in the background, and never from a codemode script. - A test, build or install piped into
tail/head/grep, or sent to a file, is refused: the pipe hides its progress and replaces its exit code. So is a baresleepof 30 s or more. - No output and no CPU for 300 s: killed. A command busy at 100% CPU is left alone; a machine that slept is not counted as hung.
- A failed command is reported as failed, exit code and stderr intact.
web_searchruns Claude's own web search on your plan first, then Context.dev, DeepSeek and Parallel, and says which one answered and why the others did not.read_web_pagereads a page through crawlapi (rendered, as markdown or structured JSON), or asks a question about it and gets the answer from a child agent. We use crawlapi for this tool: sign up at crawlapi.dev to get an API key for it.x_search: X posts, accounts and threads through Grok's own X tools on your Grok subscription. Grok picks the posts; their full text and counts load straight from FxTwitter, so a search takes ~5 s and no post is retyped by a model.- 7 GitHub tools read, search, glob, list and diff any repo
ghcan see, without cloning. screenshotcaptures a window, a screen region or a whole web page, sized to Claude's vision limits so small text stays readable. The harness refuses a request that would cross the API's 32 MiB limit, which pi does not check and which breaks every later turn.mpl_rendercharts data from a codemode script through mpl, a pixel-exact JS port of matplotlib, in a gruvbox theme that matches the terminal. The agent sees the PNG and fixes what overlaps; files land in~/.pi/agent/charts/, with an SVG or a hover-to-read HTML page on request.search_sessionsfinds a past conversation;read_sessionhands the whole of it to one reader model with no tools: every prompt, reply and sub-agent answer in full, secrets redacted first.askputs the agent's open questions to you in a picker.
codemode runs one script that makes dozens of tool calls, and reaches the
MCP servers too: Chrome DevTools (isolated, telemetry off), Cloudflare, Paper,
Astro, Xcode builds. 7 are on by default and connect only when a script names
them; /mcp turns on the other 13.
Claude Opus 5.5 on a Max subscription is the default. A request whose system
prompt carries certain phrases bills as extra usage instead, so
anthropic-sub.ts keeps them out, and
every pi update runs a canary that proves requests still bill to the plan.
One hook that rewrote the message list every turn once wrote 83,658,669 cache tokens and burned 19% of a $200 plan's week in a day. The system prompt and tool schemas are now frozen at session start, and the working rules (scope, evidence, no comments by default, stop before anything that destroys or publishes) ship inside it. The whole investigation.
Every tool result is scrubbed before the model sees it: vault values, Stripe, GitHub, AWS and Anthropic key formats, private keys, bearer tokens, URL passwords, and random-looking values next to secret names. Code that merely mentions a token stays readable.
Every commit and push is checked inside git, on exactly what it publishes: a value of your own secrets or a real provider key stops it and the agent fixes it itself, while a fake key in a test or a password in a doc goes through with a note. Nothing stops an overnight run on a false alarm.
- A box-drawn editor with model, context and git branch on the border, and a cache line under it: hit rate, reads, writes.
/helplists every command, shortcut and skill in one searchable list and runs what you pick. Every command typed on its own opens a small menu that says where things stand and what each choice does; words after it are suggested as you type, and settings you change are remembered across sessions./stats: nine tabs over every session pi, Claude Code, Codex and OpenCode left on the machine: cost, tokens, cache, models, tools, sub-agents, projects matched to commits, your rhythm, and a yearly-review card. Local and read-only./theme: preview pi themes and your Ghostty theme, font, cursor and opacity live. Esc reverts, Enter keeps.- A dock for the agents running in the background and a full-screen view of any one's conversation, pinned sessions, sessions named by DeepSeek Flash, desktop notifications, and a DeepSeek peak-price clock; DeepSeek replies made in peak hours are costed at its 2× rate.
- Hindi, Bengali and emoji cannot smear the screen: pi-tui is patched to never undercount a character's width.
| Command | Key | Does |
|---|---|---|
/help |
Ctrl+Shift+P |
every command, shortcut and skill, searchable; enter runs it |
/stats |
Ctrl+Shift+S |
usage dashboard, reports, a monthly budget |
/theme |
Ctrl+Shift+K |
live theme and Ghostty preview; /theme <name> switches straight away |
/hud |
Ctrl+Shift+I |
more detail under the prompt |
/focus |
Ctrl+Shift+H |
focus mode: the chat area shows your prompts and the agent's answers, the work one tab away, every prompt of the session searchable (before compactions, on every /tree branch); pi's own prompt stays below, so everything still works; /focus on starts every session in it |
/agents |
Ctrl+Shift+A |
background agents: list, full-screen view of each, steer / stop / continue; /agents models picks their models |
/ysk |
Ctrl+Shift+Y |
a side agent that flags what you missed; off until /ysk on |
/idea |
park an idea for this project (pi: in front files it under the harness); /idea alone lists them (more) |
|
/goal |
a long-running goal, audited before it is marked done; /goal strict <task> has the agent write it |
|
/md |
this chat as markdown, with or without tool calls and thinking | |
/deepseek |
DeepSeek peak and off-peak clock | |
/local |
run a local model (Inkling 2 Mini) through Ollama | |
/psst |
the secrets vault: names, add a secret, which ones the agent gets | |
/resume |
Ctrl+B |
pin a session to the top |
13 skills load on demand: review, dig (debugging), mat-tdd,
mat-design, c-sqr (strict code review), dm-antislop, design-port,
server-ops, tmux, chrome-cdp, paper-chrome, dataforseo, jev.
| Files | read · edit · write · undo_edit · redo_edit · grep · find · ls |
| Shell | bash · codemode |
| Git | commit |
| Agents | finder · chad · oracle · delegate · librarian · review_code · agents |
| Web | web_search · x_search · read_web_page |
| GitHub | read_github · search_github · list_directory_github · list_repositories · glob_github · commit_search · diff |
| Screen | screenshot |
| Memory | search_sessions · read_session · skill |
| You | ask |
| Goals | get_goal · create_goal · update_goal |
| stock pi 1.5 | muzzpi | |
|---|---|---|
| Tools on by default | 4: read, bash, edit, write |
35 |
| Sub-agents | none, by design | 6, each on its own model |
| Edits | edit + write |
the same tools, plus undo across restarts, permission rules, a comment gate |
| Bash | timeout optional | timeout required, hung commands killed, long ones moved to the background |
| MCP | every server connects at start | each connects on first use |
| Web, GitHub, screen | none | built in |
| Secrets in tool output | sent as is | scrubbed |
| Search | rg per call |
an index: milliseconds across ~ and the whole Mac |
| Start | 0.16 s with no extensions | 0.24 s with all 19 |
pi moves fast. 19 releases, from 0.82 to 1.5, each have a written migration record; muzzpi started on 0.67.
bash pi-setup/update-pi.sh <version> # update pi; never `pi update --self`
bash pi-setup/verify-patches.sh # audit: every patch, config and build in place
git pull && ./install.sh pi # update muzzpiupdate-pi.shbacks pi up, refuses a release that changed a file we patch, installs, re-patches, rebuilds pi, then makes a real model call and runs the Claude-plan canary. Any failure prints the one-line rollback.install.shcompares your pi with the version the patches were made on. If pi changed those files, it stops before writing anything and prints the command that installs the right pi.verify-patches.shchecks every patch, every config, the extension bundles, the sub-agent models, and that pi runs a build of the current patched files. Each FAIL prints its fix; a WARN is a login still to do.bundle-fidelity.mjsre-proves the build recipe against pi's own on each release.
- The cache drain. See 07: 99% of everything metered was cache writes.
- A pi update killed every sub-agent. pi 0.84 made bare model ids an error, and every spawn died on start. Fixed at the single spawn point; updates now call a real sub-agent before calling it clean.
- Custom tools never reached Claude, for months. The OAuth shim dropped every tool not named like Claude Code's, so Claude wrote tool calls as plain text and made up the results.
- Hindi broke the screen. pi-tui measured
क्त्रas 1 column, Ghostty drew 3, and the TUI desynced. Patched in every pi-tui copy. - 3 GB of duplicates. Three npm roots held 18 stale pi packages and 24 copies of pi-tui. Now there is one, patched.
pi update --selfsilently disables every patch by pointingpiat its prebuilt copy. Updates go throughupdate-pi.sh.- Patching pi cost half its startup, until we ran pi's own build recipe on the patched files (see Fast).
23 packages were installed, used and removed. The audit fails if one comes back.
| Package | Why it went |
|---|---|
@tomooshi/condensed-milk-pi |
reported failed git commands as successes |
pi-autoresearch |
its prompt guidelines changed mid-session, rewriting the prompt cache |
pi-tool-display |
rewrote stored messages, then spliced the whole context on every request |
pi-tasks |
array parameters arrived as JSON strings; task_plan always failed |
pi-web-access |
every search provider key rejected or rate-limited |
@marckrenn/pi-sub-bar, pi-sub-core |
+324 ms per start for a widget with every provider off |
pi-token-burden |
+143 ms per start for one diagnostic command |
pi-mcp-adapter |
+33 ms per start and a 3.8k-character tool on every request; pi's own MCP client replaced it |
pi-claude-bridge, claude-agent-sdk-pi, pi-claude-code-use |
replaced by native Claude OAuth and one small extension |
pi-codex-goal |
vendored as /goal, trimmed |
pi-context, @sting8k/pi-vcc |
pi's own compaction covers it |
pi-computer-use |
its tools never registered |
lsp-pi, pi-powerline-footer, pi-anycopy |
installed where pi never loads them |
pi-gpt-config, pi-ask, pi-grok-cli, todos |
unused |
Needs: macOS, and unless you use --with-deps, node ≥ 22.19, bun, and pi
at the version in base-version.
--with-deps installs exactly those with Homebrew, pi at that version, and
Rust for searchd. A newer pi works if it left the patched files alone; the
installer checks. Homebrew, nvm and any other npm prefix work.
Without --with-deps, the two commands it would run are
npm install -g @earendil-works/pi-coding-agent@"$(cat pi-setup/pi-core-patches/base-version)"
and brew install oven-sh/bun/bun ripgrep gh trash.
Logins and keys, one feature each; the installer and the audit say what is missing:
| turns on | |
|---|---|
/login anthropic in pi |
Claude, the default model, and web_search (its own search runs on the plan) |
DEEPSEEK_API_KEY |
cheap sub-agents (chad, finder, librarian, read_web_page), read_session and session names, which run on your main model without it; /ysk needs it |
RIVER_API_KEY |
DeepSeek V4.1 Flash via River, cheaper in DeepSeek's peak hours |
CONTEXT_DEV_API_KEY, DEEPSEEK_API_KEY, PARALLEL_API_KEY |
web_search's fallbacks, used when the Claude plan has no login; whichever are set, in that order |
CRAWLAPI_API_KEY (get one at crawlapi.dev) |
read_web_page |
grok login (Grok CLI, SuperGrok or X Premium+) |
x_search |
gh auth login |
the GitHub tools |
ripgrep, trash |
grep and find, safe deletes |
Rust (cargo) |
searchd, the index behind grep and find (macOS only); without it they run rg. --with-deps installs it |
To use another default model, change defaultProvider and defaultModel in
settings.json.
Ghostty. The repo began as a Ghostty config and still ships one: 22 dark
themes, 11 fonts, live switchers. ./install.sh ghostty; see
ghostty/. Each half installs on its own.
herdr (optional), two separate setups. herdr runs
your agents in one window, either inside Ghostty or as its own Mac app; they
share no settings. ./install.sh herdr-ghostty makes Ghostty's ⌘ keys drive
herdr (⌘T tabs, ⌘O open a project, ⌘] next agent, ⌘W close, ⌘I park an idea).
./install.sh herdr-app gives the Mac app the same keys, a look, and pi's
state in its agents list. Nothing else installs either; which is which, every
key and how to turn each off are in herdr/.
agy (optional). For Google's Antigravity CLI: no permission prompts, a
status line with quota and context, and telemetry off. ./install.sh agy; it
shares nothing with pi. See agy/.
muzzpi/
├── install.sh ./install.sh pi | ghostty | herdr-ghostty | herdr-app | agy
├── AGENTS.md the rules every agent reads first
├── pi-setup/
│ ├── extensions/ 19 extensions; tools/ holds the 33 tools
│ ├── agents/ system prompt, working rules, sub-agent prompts
│ ├── agent-models.json which model each sub-agent runs on
│ ├── permissions.json what bash may never do
│ ├── pi-core-patches/ 6 patched pi files, the pi-tui width patch, the speed patches
│ ├── pi-bundle/ pi's build recipe, run on the patched files
│ ├── searchd/ the search index daemon behind find and grep
│ ├── config-skills/ 14 skills
│ ├── port-harness/ benchmarks and the Claude-plan canary
│ └── pi-migrations.md one record per pi release
├── ghostty/ themes, fonts, switchers
├── herdr/ optional, two separate setups:
│ ├── in-ghostty/ herdr inside Ghostty: ⌘ keys, ⌘O picker, ⌘W close, ⌘I ideas
│ └── app/ the Herdr Mac app: the same keys, a look, pi's state
└── agy/ optional: Antigravity CLI settings, status line, telemetry off
Read next: AGENTS.md for how it fits together and what not to
break, and pi-setup/README.md for the full inventory.
- pi by Mario Zechner, the engine all of this runs on.
- Amp: the system prompt started as a port of Amp's,
which is why its files are named
*.amp.*. - bdsqqq/dots: sub-agent wiring and
delegatebegan as a port from there. /goalis pi-codex-goal, vendored. MCP ran through pi-mcp-adapter until pi shipped its own client. Claude Max support began with Ben Vargas's pi-claude-code-use.- Skills adapted from Matt Pocock (
mat-*), dmmulroy (dm-*) and Cursor (c-*). - Ghostty palettes inspired by opencode.
- searchd stands on ripgrep's crates; its macOS change-feed code is adapted from fsearch.
MIT.