A coding-agent harness rewritten from the ground up in Zig. Drop-in replacement for pi — same features, same config, single static binary.
| pi (TypeScript) | pz (Zig) | |
|---|---|---|
| Binary size | ~10 MB + 589 MB node_modules | 1.7 MB |
| Startup time | ~430 ms | 3 ms |
| Memory at idle | ~153 MB | 1.4 MB |
| Source lines | ~139k | ~29k |
| Runtime deps | Node.js / Bun | None |
| Install | bun install -g |
Copy one binary |
Full feature parity with pi, plus some extras:
- Interactive TUI — streaming responses, markdown rendering, syntax highlighting
- Image rendering — Kitty graphics protocol support in terminal
- 24 slash commands —
/model,/fork,/export,/compact,/share,/tree, and more - Autocomplete dropdown — fuzzy-filtered command and file path completion
- 8 built-in tools —
read,write,edit,bash,grep,find,ls,ask - Session management — persist, resume, fork, name, export, share as gist
- OAuth + API key auth — automatic token refresh, multi-provider support
- Thinking modes — adaptive and budget-capped extended thinking
- Prompt caching — automatic cache_control on system messages
- Headless modes —
--print,--json, andrpcfor scripting and integration - Zero-alloc hot path — rendering and input handling avoid heap allocations
- 582 tests — unit, integration, snapshot, and property tests
Requires Zig 0.15+.
zig build -Doptimize=ReleaseFast
The binary lands in zig-out/bin/pz.
# Uses ~/.pi/agent/auth.json and settings.json automatically
pz
# Explicit provider and model
pz --provider anthropic --model claude-sonnet-4-20250514
# Headless
pz --print "explain this codebase"
echo '{"prompt":"hello"}' | pz --json
zig build test
CHANGELOG.mdfor release-by-release notespz --changelogor/changelogin TUI for in-app change visibility
pz reads pi's config files directly:
~/.pi/agent/auth.json— OAuth / API key credentials~/.pi/agent/settings.json— model, provider, tools, thinking modeAGENTS.md/CLAUDE.md— system prompts (project and global)
MIT