blog.dopana

Back

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:

PromptDescription
codeDefault - full tool access with TDD workflow
planPlanning-only - no code writing
reviewReview code for correctness, design, testing
debugFind root cause before proposing fixes
askRead-only - no writes or bash
brainstormDesign-only - no code
frontend-designProduction-grade UI design
review-securityFind security vulnerabilities
simplifyOptimize code for clarity
write-promptCreate and optimize agent prompts
refactorRestructure code for maintainability
autoconfigInteractive configuration
orchestratorCombine tool use with parallel subprocess
write-textWrite 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#

curl -fsSL https://raw.githubusercontent.com/gi-dellav/zerostack/main/install.sh | bash
bash

Cargo#

cargo install zerostack
bash

Homebrew#

brew tap gi-dellav/tap
brew trust gi-dellav/tap
brew install zerostack
bash

Nix#

nix-run https://github.com/gi-dellav/zerostack/archive/refs/heads/main.tar.gz
bash

Quick 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-flash
bash

Comparison with Other AI Coding Agents#

FeaturezerostackJavaScript agents
RAM (average)~16MB~300MB
RAM (peak)~24MB~700MB
CPU (idle)0.0%~2%
CPU (active)~1.5%~20%
Binary size26MBN/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.

References#