Zerostack ships a tiny Rust-native coding agent with Unix instincts
A crates.io debut touts multi-model support, a TUI, sandboxed bash, and a permission system in an 8.9MB binary that idles near zero CPU.
By Ryan Merket ยท
Why it matters
Agent tooling is drifting toward heavy runtimes and big footprints. Zerostack pushes the opposite direction: a small, permissioned, Unix-style agent that runs fast, works with multiple model backends, and can sandbox shell actions. For teams experimenting with agents in real codebases, the combination of low resource use and explicit guardrails could make prototyping and adoption less risky.

Zerostack, a minimal coding agent written in Rust, is live on crates.io with a Unix-flavored toolchain and a focus on speed and restraint, according to its crate listing.
The project bills itself as a small, fast developer companion rather than a sprawling framework. It is openly inspired by pi and opencode, but leans hard on native performance and a permissioned execution model. The result reads like a CLI-first take on coding agents: a crossterm terminal UI, built-in prompts you can swap at runtime, and tight control over what the agent is allowed to touch.
What shipped
- Multi-provider model support out of the box: OpenRouter is the default, with options listed for OpenAI, Anthropic, Gemini, Ollama, and custom providers.
- File and shell tools: read, write, edit with diffs, grep, find_files, list_dir, plus bash execution behind permission gates.
- A terminal UI: markdown rendering, mouse selection/copy, scrollback, and a toggle to reveal or hide reasoning.
- A prompt system: switch modes like
code,plan,review,debug, oraskwithout juggling separate skills; custom prompts can be dropped in a config directory. - MCP support to connect external tool servers, integrated search (including WebFetch and WebSearch), and Git worktree hopping via
/worktreefor multi-branch flows. - Looping for long-horizon tasks and a nod to stability with built-in checks to avoid doom loops.
Safety and control by default
Zerostack ships with four permission modes, from restrictive to yolo. The defaults auto-approve obviously safe actions (think ls, cd, cargo check) but require consent for writes or destructive steps, and you can dial that up or down per tool using glob patterns. A session allowlist remembers approvals so you are not re-confirming every minute.
For shell execution, the agent can isolate itself using --sandbox, which runs commands via bubblewrap. The README links directly to the project for setup: bubblewrap. There is also doom-loop detection that flags repeated identical tool calls after three tries, a simple guardrail against runaway agents.
Performance posture
The author highlights resource use as a first-class goal. The crate notes roughly 7k lines of Rust, an 8.9MB binary, and around 8MB RAM on an empty session climbing to roughly 12MB while working. Idle CPU is listed as 0.0%, with about 1.5% when tools are active on an older Intel i5. The README contrasts that with JS-based agents like opencode at roughly 300MB RAM and higher CPU.
Getting started
Installation targets the Rust toolchain. If you have Cargo and git installed:
cargo install zerostack
Quick start examples from the README:
# set an API key (OpenRouter is default)
export OPENROUTER_API_KEY="[api_key]"
# interactive session
zerostack
# one-shot
zerostack -p "Explain this project"
# continue last session
zerostack -c
# explicit provider/model
zerostack --provider openrouter --model deepseek/deepseek-v4-flash
Developer ergonomics
Zerostack treats prompts like modes you can flip mid-session. In addition to code, plan, review, and debug, there are focused options like ask (read-only), brainstorm, frontend-design, review-security, simplify, and write-prompt. The agent will auto-load AGENTS.md or CLAUDE.md from the project tree to enrich system context, which you can disable with a flag.
Sessions persist under your XDG data directory, with commands to list, save, load, and resume. Slash commands cover model switching, thinking level, prompt selection, loop scheduling, and permission mode changes.
The bet
Rather than chase every integration, Zerostack makes a narrower bet: keep the agent small, fast, and explicit about what it can do, while still working across major model providers and local engines. For developers who want an agent that feels like a familiar Unix tool instead of a heavyweight app, this Rust build reads like a clear invitation to try a different tradeoff.