# Repository Briefing: gi-dellav/zerostack
> Source: https://repoforai.com/repo/gi-dellav/zerostack (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/gi-dellav/zerostack
- **Official Docs / Website**: https://gi-dellav.github.io/zerostack/
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Rust
- **License**: GPL-3.0
- **Engineering Health**: A (83/100 · Maintenance 35/35 · Adoption 17/25 · Releases 20/20 · License 11/20)
- **Latest Release**: v1.8.6 (2026-11-11) — https://github.com/gi-dellav/zerostack/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: CLI, MCP
- **Momentum**: 1,765 ★ total (+1 24h / +6 7d) · 157 forks
- **Topics**: `agent`, `agentic-ai`, `agentic-coding`, `agents`, `ai`, `claude-code`, `coding-agent`, `llm`, `rust`, `rust-lang`
- **When to Use**: Best for: Terminal-first developers who want to switch model providers, review agent edits, and add selected MCP tools without replacing their editor. Skip if: Inline completion is central to your workflow, you need company-wide policy enforcement out of the box, or you need a hardened boundary for running untrusted code.

## Overview
```text
### Architecture & Core Mechanics
zerostack is a single Rust 2024 crate with no Cargo workspace. `src/main.rs` dispatches modes, and `src/cli.rs` defines arguments with `clap`. `src/auth.rs` resolves credentials, while `src/provider.rs` uses type-erased client, model, and agent enums to keep provider-specific implementations out of the main agent lifecycle. The builder in `src/agent/` constructs a `rig` agent and injects tools; the runner streams output as `AgentEvent`s, separately from the TUI's `UserEvent`s.

The built-in tool layer covers file reads, writes, and edits, bash, grep, file and directory discovery, and todos. Two integrations extend different sides of that boundary: `rmcp` lets zerostack act as an MCP client to child-process or streamable HTTP servers, whereas the opt-in `agent-client-protocol` dependency enables an ACP JSON-RPC agent server for editors. MCP is a compile-time feature but is enabled by default, alongside Git worktrees, subagents, archmd, status signals, and logging.

### Key Capabilities & Differentiators
The same CLI can route work to OpenRouter, OpenAI-compatible endpoints such as vLLM or LiteLLM, Anthropic, Gemini, or Ollama. Custom providers use a configured base URL and a named API-key environment variable. Interactive sessions use a crossterm TUI with Markdown rendering, scrollback, mouse selection and copy, and a reasoning visibility toggle. One-shot prompts and resumable sessions cover shorter and longer jobs respectively; automatic compaction manages context-window pressure during a session.

Runtime prompts such as `plan`, `code`, `review`, and `debug` shape how the agent approaches a task, while five permission modes and per-tool rules govern what it can do. `/review` runs a read-only pass and then restores the previous prompt; `/worktree` switches the agent's Git worktree. Optional builds add Markdown memory across sessions, lifecycle hooks that run external commands, or an advisor model. These features address different needs: a saved transcript resumes a job, while injected memory carries selected context into a new session.

### Trade-offs & Limitations
zerostack is a terminal-first alternative to evaluate alongside Claude Code. Its provider configuration, prompt modes, and tool permissions give teams control over the working setup, but teams also have to own credentials, model selection, and permission policy. ACP offers an editor integration path, not a drop-in replacement for the inline workflows a team may choose Cursor, Windsurf, or GitHub Copilot for. Published client figures are a 26 MB binary and roughly 16 MB average RAM with 24 MB peaks; those are not a capacity estimate for local inference or external tool processes.

Permissions, prompts, and the shell sandbox solve different problems. Standard mode already permits in-worktree writes and edits and some shell commands, so use read-only mode when the goal is inspection. Git worktrees separate working copies, not privileges. The sandbox only covers bash commands, retains the host network by default, and is not a security boundary for untrusted code. Hosted APIs reduce inference maintenance but send model inputs to the configured provider; self-hosting shifts that cost to your own infrastructure. GPL-3.0-only is chiefly a planning consideration when redistributing binaries or modified builds.

### Hardware & Deployment Guide
Choose a release tarball, Cargo, Homebrew, or Nix. `cargo install zerostack` gives the standard feature set; pass `--features acp,memory,hooks,advisor` only if those capabilities are needed. Provider configuration lives under `$XDG_DATA_HOME/zerostack/config.yaml` (normally `~/.local/share/zerostack/config.yaml`). The default OpenRouter route uses `OPENROUTER_API_KEY`. An Ollama or self-hosted OpenAI-compatible backend can keep inference on infrastructure you control; offline operation still requires locally available models and no tools configured to reach external services.

For optional shell containment, use bubblewrap on Linux or configure zerobox on macOS. Without `--sandbox-required`, a missing backend leaves bash running unsandboxed with a warning; with it, bash is refused. Home Manager config links are immutable, so interactive config edits can fail, and API keys in Nix-managed TOML can end up in the world-readable store. In v1.8.6, repeated-read denial became opt-in and ACP session loading and TUI span normalization were fixed. Since v1.8.5, the `lite` builds have shipped with default features, and `/loop` has been deprecated and left out of the default feature set.
```

## Key Capabilities
```text
- Provider routing: OpenRouter is the default; OpenAI-compatible endpoints, Anthropic, Gemini, Ollama, and custom URLs cover hosted and self-hosted setups.
- Permission model: Five modes, per-tool glob rules, and session allowlists control when operations require approval.
- Protocol roles: Default-enabled MCP adds tools over child-process or streamable HTTP transports; opt-in ACP exposes the agent to editors.
- Session continuity: Save, load, and resume sessions with automatic context compaction; opt-in memory injects relevant Markdown notes into new sessions.
- Repository workflow: `/worktree` moves the agent between Git worktrees, and `/review` runs a one-shot read-only review before restoring the previous prompt.
- Shell containment: `--sandbox-required` refuses bash calls if the backend is unavailable; host networking remains on in the sandbox unless explicitly disabled.
```

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