Zerostack - Lightweight Rust Coding Agent
Discover zerostack - a Rust-based coding agent with only 16MB RAM footprint, multi-provider AI support, and robust permission system.
When thinking about AI coding agents, most of us imagine heavy Node.js-based tools consuming hundreds of megabytes of RAM and requiring powerful machines. But zerostack has completely changed this game.
Why zerostack is different#
zerostack is a minimal coding agent written in Rust, inspired by pi and opencode. The most remarkable feature? The entire application runs on just ~16MB RAM on average, peaking at 24MB. Compared to JavaScript-based coding agents that can consume 300-700MB RAM, this is a significant improvement.
[!TIP] Impressive Performance
- Binary size: 26MB
- RAM: ~16MB (average), ~24MB (peak)
- CPU: 0.0% when idle, ~1.5% when active
- Lines of code: ~30k LoC
Key Features#
Multi-provider Support#
zerostack supports multiple AI providers:
- OpenRouter (default)
- OpenAI
- Anthropic
- Gemini
- Ollama
- Custom providers
You can easily switch between providers using the --provider and --model flags.
Robust Permission System#
One of the most important features is the permission system with 5 modes:
- restrictive: Ask for every operation
- read: Read-only, no writes
- standard: Allow most operations
- permissive: Allow more operations
- dangerous: No restrictions
Supports per-tool patterns, session allowlists, and configurable policies.
Smart Prompts System#
Instead of managing complex skills, zerostack provides 14 built-in prompts switchable at runtime:
| Prompt | Description |
|---|---|
code | Default - full tool access with TDD workflow |
plan | Planning-only - no code writing |
review | Review code for correctness, design, testing |
debug | Find root cause before proposing fixes |
ask | Read-only - no writes or bash |
brainstorm | Design-only - no code |
frontend-design | Production-grade UI design |
review-security | Find security vulnerabilities |
simplify | Optimize code for clarity |
write-prompt | Create and optimize agent prompts |
refactor | Restructure code for maintainability |
autoconfig | Interactive configuration |
orchestrator | Combine tool use with parallel subprocess |
write-text | Write prose (docs, posts, emails) |
Session Management#
zerostack allows:
- Save/load/resume sessions
- Auto-compaction to stay within context windows
- Git worktrees integration for branch-per-task workflow
MCP Support#
Supports Model Context Protocol (MCP) to connect external tool servers, extending agent capabilities.
Installation#
Script (recommended)#
curl -fsSL https://raw.githubusercontent.com/gi-dellav/zerostack/main/install.sh | bashbashCargo#
cargo install zerostackbashHomebrew#
brew tap gi-dellav/tap
brew trust gi-dellav/tap
brew install zerostackbashNix#
nix-run https://github.com/gi-dellav/zerostack/archive/refs/heads/main.tar.gzbashQuick Start#
# Set API key (OpenRouter is default)
export OPENROUTER_API_KEY="[api_key]"
# Interactive session
zerostack
# One-shot mode
zerostack -p "Explain this project"
# Continue last session
zerostack -c
# Explicit provider/model
zerostack --provider openrouter --model deepseek/deepseek-v4-flashbashComparison with Other AI Coding Agents#
| Feature | zerostack | JavaScript agents |
|---|---|---|
| RAM (average) | ~16MB | ~300MB |
| RAM (peak) | ~24MB | ~700MB |
| CPU (idle) | 0.0% | ~2% |
| CPU (active) | ~1.5% | ~20% |
| Binary size | 26MB | N/A (Node.js runtime) |
Advanced Features (gated)#
zerostack also provides advanced features requiring compile-time features:
- ACP support: Agent Communication Protocol for editors like Zed to connect
- Persistent memory: Plain-Markdown memory across sessions
- Lifecycle hooks: Observe/gate tool calls, prompts, session events
- Advisor: Second model for strategic guidance
- Multimodal input: Attach images and PDFs
- Subagents: Parallel codebase exploration
- ARCHITECTURE.md: Shared knowledge for agents on same codebase
- Prompt chaining: brainstorm → plan → code → review workflow
- Status signals: Emit events over Unix socket
When should you use zerostack?#
zerostack is right for you if:
- You want a lightweight, efficient coding agent
- You work on resource-constrained machines
- You need to run multiple parallel sessions
- You care about security with robust permission system
- You prefer Unix philosophy - composable tools
- You want full control via command-line
Conclusion#
zerostack represents a new direction in AI coding agents - focusing on performance, resource efficiency, and Unix philosophy instead of trying to do everything. With its extremely small footprint and full feature set, it’s an excellent choice for developers who want AI assistance without paying the system resource price.