# Zerostack

> A terminal coding agent in Rust with a tiny memory footprint

- Category: AI Coding / Autonomous Coding Agents
- Language: Rust
- Licence: GPL-3.0
- Repository: https://github.com/gi-dellav/zerostack
- Website: https://gi-dellav.github.io/zerostack/
- Canonical page: https://ai-tldr.dev/tools/zerostack/
- Updated: 2026-05-16

## In short

Zerostack is a minimal coding agent written in Rust, described by its author as inspired by pi and opencode. It sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in Rust and licensed GPL-3.0. To get started: install Zerostack.

## Overview

Zerostack is a minimal coding agent written in Rust, described by its author as inspired by pi and opencode. It gives you the usual agent loop — read files, write files, run shell commands, search — inside a crossterm-based terminal UI with Markdown rendering, mouse selection and copy, and scrollback, and it is built to stay small: roughly 30,000 lines of core code, a 26MB binary, about 16MB of RAM in normal use and 0.0% CPU while idle.

Control over what the agent may do is explicit. Five permission modes — restrictive, readonly, guarded, standard and yolo — set the baseline, with granular overrides on top, and an optional sandbox isolates execution through bubblewrap on Linux or zerobox on macOS. For parallel work it supports a branch-per-task flow using git worktrees, and sessions can be saved, loaded and resumed with automatic compaction so a long task survives a restart.

It is provider-agnostic: OpenRouter, OpenAI, Anthropic, Gemini, Ollama and any custom OpenAI-compatible endpoint, selected per run from the command line. Prompt modes such as code, plan, review and debug can be switched at runtime, a Markdown memory system persists notes across sessions, and MCP and ACP support let you extend the tool set.

## What it does

- Small by design: ~30,000 lines of core code, a 26MB binary, ~16MB average RAM and 0.0% CPU at idle
- Five permission modes — restrictive, readonly, guarded, standard, yolo — with granular control
- Optional sandboxing via bubblewrap (Linux) or zerobox (macOS)
- Git-worktree branch-per-task workflow for parallel work
- Sessions save, load and resume with auto-compaction
- Runtime-switchable prompt modes: code, plan, review, debug
- MCP and ACP support for extra tooling, plus a persistent Markdown memory system
- Providers: OpenRouter, OpenAI, Anthropic, Gemini, Ollama and custom OpenAI-compatible endpoints

## Getting started

Install the binary through the install script, cargo, Homebrew or Nix, then set the API key for whichever provider you want to use.

1. Install Zerostack

   The install script is the documented recommendation; cargo, Homebrew and Nix are all supported.

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

# or
cargo install zerostack
cargo install zerostack --all-features

# or
brew tap gi-dellav/tap
brew install zerostack
```

2. Set a provider key

   Export the API key for your chosen provider as an environment variable. Ollama needs no key.

3. Start a session

   Run it interactively, or pass a one-shot prompt. `-c` resumes your last session.

```bash
zerostack                    # interactive session
zerostack -p "Prompt text"   # one-shot mode
zerostack -c                 # resume last session
```

4. Pick a provider and model per run

   Both are command-line flags, so switching backends does not need a config edit.

```bash
zerostack --provider openrouter --model deepseek/deepseek-v4-flash
```

## When to use it

- Run a coding agent on a small or resource-constrained machine where an Electron or Node-based agent is too heavy
- Keep tight control over what an agent may touch, using readonly or guarded permissions plus a sandbox
- Work several tasks in parallel on one repository with git-worktree branch-per-task sessions
- Switch between hosted and fully local models — the same agent runs against OpenRouter or a local Ollama endpoint

## Version history

- 2026-05-16 1.0: Zerostack shipped 1.0: a Rust terminal coding agent running in roughly 8 to 12 MB of RAM, with OpenRouter, OpenAI, Anthropic, Gemini and Ollama support, git-worktree workflows, MCP and runtime prompt modes.
