{"slug": "zerostack-an-agent-that-s-less-sloppy-than-elon-s-attempts", "title": "Zerostack – An agent that's less sloppy than Elon's attempts", "summary": "Zerostack, a minimal coding agent written in Rust, has been released as an open-source tool for developers. The agent offers multi-provider support, a permission system, session management, and a terminal UI, with a small footprint of ~30k lines of code and ~16MB RAM usage. It aims to provide a performant alternative to larger coding agents like OpenCode.", "body_md": "Minimal coding agent written in Rust, inspired by [pi](https://pi.dev/docs/latest/usage) and [opencode](https://opencode.ai/).\n\n*blogposts:* [what we built in 2 weeks](https://rocketup.pages.dev/posts/what_we_built_in_2_weeks/) [memory design](https://rocketup.pages.dev/posts/how-zerostack-memory-works/) [subagents design](https://rocketup.pages.dev/posts/how-zerostack-subagents-work/) [xavier's memory analysis](https://xavierforge.dev/en/posts/zerostack-memory-design/)\n\n*note:* Want to support? Consider [donating here](https://ko-fi.com/gidellav); if you are a company interested in sponsoring zerostack, [contact me here](mailto:giuseppe.dellavedova8+sponsor@gmail.com).\n\n**Multi-provider**: OpenRouter, OpenAI, Anthropic, Gemini, Ollama, plus custom providers** Standard tools**: all of the standard tools exposed to coding agents, as described by the opencode documentation.** Permission system**: five configurable modes with per-tool patterns, session allowlists, and configurable mode-to-rule application policies** Session management**: save/load/resume sessions, auto-compaction to stay within context windows** Terminal UI**: crossterm-based, markdown rendering, mouse selection/copy, scrollback, reasoning visibility toggle** Prompts system**: switch between system prompt modes at runtime (`code`\n\n,`plan`\n\n,`review`\n\n,`debug`\n\n, etc.) to tailor the agent's behavior to the task without having to manage Skills.**MCP support**: connect MCP servers for extended tooling (exposed as an optional compile-time feature)** Integrated Exa search**: allows for WebFetch and WebSearch tools** Integrated Ralph Wiggum loops**: looping capabilities for long-horizon tasks** Integrated Git Worktrees integration**: Use`/worktree`\n\nto move the agent from one worktree to another.**ACP support**(gated): Agent Communication Protocol server — lets editors (Zed, etc.) connect to zerostack as an ACP agent** Persistent memory**(gated): plain-Markdown memory across sessions: a global MEMORY.md plus per-project daily logs, scratchpad, and notes, injected into the system prompt each session**Lifecycle hooks**(gated): observe or gate tool calls, prompts, and session lifecycle events via external commands, using a`settings.json`\n\nschema largely compatible with Claude Code hooks**Advisor**(gated): a second model the agent can consult mid-session for strategic guidance, with an optional human-handoff mode** Multimodal input**(gated): attach images and PDFs to messages** Subagents**: Parallel and fast, used for exploring the codebase** ARCHITECTURE.md**: Our own companion file for AGENTS.md, it allows to offer a shared core knowledge for all agents working on the same codebase**Prompt chaining**: offers to advance brainstorm → plan → code → review as each phase finishes, config-gated per transition** Status signals**: emits start/stop/git-conflict events over a Unix socket for external status bars or tooling\n\n**NOTE**: Windows support is not tested is any way, but feel free to try and open an issue if you encounter any bugs!\n\n*zerostack* is one of the smallest and most performant coding agents on the market.\n\n- Lines of code: ~30k LoC (core, excluding tests)\n- Binary size: 26MB\n- RAM footprint: ~16MB on average, with peaks at ~24MB (vs ~300MB with peaks at ~700MB for opencode or other JS-based coding agents)\n- CPU usage: 0.0% on idle, ~1.5% when using tools (measured on an Intel i5 7th gen, vs ~2% on idle and ~20% when working for opencode)\n\nYou can now read a complete *Get Started* guide for zerostack [here](https://github.com/gi-dellav/zerostack/blob/main/docs/GET_STARTED.md)!\n\n```\ncurl -fsSL https://raw.githubusercontent.com/gi-dellav/zerostack/main/install.sh | bash\n```\n\nOr pick a tarball manually from [GitHub Releases](https://github.com/gi-dellav/zerostack/releases).\n\n```\n# Default: loop, git-worktree, mcp, subagents, archmd, status-signals, multithread\ncargo install zerostack\n\n# With all features\ncargo install zerostack --all-features\n\n# With specific features\ncargo install zerostack --features acp,memory,hooks,advisor\nbrew tap gi-dellav/tap\nbrew trust gi-dellav/tap   # required for Homebrew 6.0.0+\nbrew install zerostack\n# brew install multistack   # Run this to also install multistack (parallel agent manager)\n```\n\nRun directly with [ nix-run](https://tangled.org/weethet.eurosky.social/nix-run/):\n\n``` bash\n$ nix-run https://github.com/gi-dellav/zerostack/archive/refs/heads/main.tar.gz\n```\n\nAdd to profile:\n\n``` bash\n$ nix profile add --file https://github.com/gi-dellav/zerostack/archive/refs/heads/main.tar.gz\n```\n\nAdd as an overlay to your system/project:\n\n``` python\nlet\n  pkgs = import nixpkgs {\n    overlays = [\n      # src thru input pinning mechanism, or use builtins.fetchTarball\n      (import \"${zerostack-src}/nix/overlay\")\n    ];\n  };\nin\npkgs.zerostack\n```\n\nOnce installed, run `/prompt autoconfig`\n\ninside zerostack to explore the documentation and configure the tool interactively.\n\n*note:* If you have questions or you want to collaborate on the project, please join the [dedicated Matrix chatroom](https://app.element.io/#/room/#zerostack-general:matrix.org).\n\nIf you want to orchestrate multiple zerostack agents from the terminal, also install [multistack](https://github.com/gi-dellav/multistack).\n\nInstall [bubblewrap](https://github.com/containers/bubblewrap) for `--sandbox`\n\n,\nwhich runs every bash command inside an isolated environment to protect your\nsystem from accidental or malicious damage:\n\n```\n# Debian/Ubuntu\napt install bubblewrap\n\n# Fedora\ndnf install bubblewrap\n\n# Arch\npacman -S bubblewrap\n```\n\nThere is also support for zerobox as an alternative sandbox backend.\n\n```\n# Set your API key (OpenRouter is default)\nexport OPENROUTER_API_KEY=\"[api_key]\"\n\n# Interactive session (default prompt: code)\nzerostack\n\n# Monochrome TUI\nzerostack --no-color\n\n# One-shot mode\nzerostack -p \"Explain this project\"\n\n# Continue last session\nzerostack -c\n\n# Explicit provider/model\nzerostack --provider openrouter --model deepseek/deepseek-v4-flash\n```\n\nSee [docs/CONFIG.md](/gi-dellav/zerostack/blob/main/docs/CONFIG.md) for config file location, accepted keys, provider\naliases, permission rules, and MCP server configuration.\n\nYou can run `/prompt autoconfig`\n\nin order to use a specialized agent that allows to navigate the documentation and customize your zerostack setup.\n\n*zerostack* includes a set of built-in system prompts that change the agent's behavior and tone.\nThe idea is to build a complete suite of prompts that can fully substitute skills like [superpower](https://github.com/obra/superpowers) or the [Claude's official skills](https://github.com/anthropics/claude-plugins-official/tree/main).\nYou can switch between different prompts or list all registered prompts using `/prompt`\n\n.\n\nBuilt-in prompts:\n\n| Prompt | Description |\n|---|---|\n(default)`code` |\nCoding mode with full file and bash tool access, TDD workflow |\n`plan` |\nPlanning-only mode — explores and produces a plan without writing code |\n`review` |\nCode review mode — reviews for correctness, design, testing, and impact |\n`debug` |\nDebug mode — finds root cause before proposing fixes |\n`ask` |\nRead-only mode — only read/grep/find_files permitted, no writes or bash |\n`brainstorm` |\nDesign-only mode — explores ideas and presents designs without code |\n`frontend-design` |\nFrontend design mode — distinctive, production-grade UI |\n`review-security` |\nSecurity review mode — finds exploitable vulnerabilities |\n`simplify` |\nCode simplification mode — refines for clarity without changing behavior |\n`write-prompt` |\nPrompt writing mode — creates and optimizes agent prompts |\n`refactor` |\nRefactoring mode — restructures code for design and maintainability while preserving behavior |\n`autoconfig` |\nConfiguration mode — reads docs and edits your config/prompts, writes no code |\n`orchestrator` |\nOrchestration mode — combines direct tool use with parallel `zerostack` subprocess invocations for heavier work |\n`write-text` |\nProse-writing mode — drafts and reviews non-code writing (docs, posts, emails) |\n\nYou can also create custom prompts by placing markdown files in\n`$XDG_CONFIG_HOME/zerostack/prompts/`\n\nand referencing them by name.\n\nAdditionally, the agent automatically loads `AGENTS.md`\n\nor `CLAUDE.md`\n\nfrom the\nproject root or any ancestor directory, injecting their contents into the\nsystem prompt. When enabled (feature `archmd`\n\n), `ARCHITECTURE.md`\n\nis also loaded\nthe same way, providing high-level design context to speed up exploration.\nUse `-n`\n\n/ `--no-context-files`\n\nto disable all context file loading.\n\nWhen `brainstorm`\n\n, `plan`\n\n, or `code`\n\nfinishes, zerostack can offer to advance\nto the next phase (`brainstorm`\n\n→ `plan`\n\n→ `code`\n\n→ `/review`\n\n), asking\n`Continue to plan? [Y/N/B]`\n\n-style at each step: `Y`\n\nadvances, `N`\n\nstays put,\nand `B`\n\n(\"but ...\") advances with an extra instruction appended. Each\ntransition is enabled independently in config.\n\nzerostack has five permission modes:\n\n| Mode | CLI flag | Behavior |\n|---|---|---|\nrestrictive |\n`-R` / `--restrictive` |\nAsk for every operation. Config rules are ignored by default (can be enabled via `permission-modes` ). |\nreadonly |\n`--read-only` |\nAllow read/grep/find_files/list_dir. Deny writes, edits, bash, and everything else. Config rules ignored by default. |\nguarded |\n`--guarded` |\nAllow read tools. Ask for writes, edits, bash, and everything else. Config rules apply. |\nstandard |\n(default) | Allow path tools (read/write/edit/list_dir) within CWD and subdirectories. Safe bash commands (ls, cat, git log, cargo check) auto-allowed. Ask for external paths and unrecognized commands. Config rules apply and override mode defaults. |\nyolo |\n`--yolo` |\nAllow everything, but prompt for destructive bash commands (rm, dd, mkfs, etc.). Config rules apply. |\n\nThe `--dangerously-skip-permissions`\n\nflag completely bypasses all permission\nchecks, allowing every tool operation without any guard. This is not a mode\nand cannot be toggled at runtime.\n\nPermissions can be configured per-tool with granular glob patterns in the\nconfig file. For example, you can allow `write **.rs`\n\nautomatically while\nalways asking before writing to other files.\n\nA **session allowlist** persists approved decisions for the duration of the\nsession, so you don't have to repeatedly confirm the same operation.\n\n**Doom-loop detection**: identical tool calls repeated 3+ times trigger a\nwarning prompt (or denial depending on your config), preventing runaway agents\nfrom spamming destructive operations.\n\nThis is a list of the most important slash commands:\n\n`/model`\n\n— Switch model`/thinking`\n\n— Set thinking level`/clear`\n\n— Clear conversation`/session`\n\n— List/save/load sessions`/loop`\n\n— Schedule recurring prompts`/prompt`\n\n— List or change the agent's prompt`/mode`\n\n— Set the permission system's mode`/queue`\n\n— Manage input queued while the agent is busy`/btw`\n\n— Ask a quick side question in parallel without interrupting the agent`/review`\n\n— Run a one-shot code review in readonly mode, then restore the previous prompt`/hooks`\n\n(gated) — Show whether a hook dispatcher is installed and what it's configured for`/advisor`\n\n(gated) — Show or change advisor status (enabled, mode, model, max uses)\n\nTo see all of the commands, use `/help`\n\n.\n\nYou can keep typing while the agent is running. Plain text is not sent right\naway and never starts a second concurrent run; it is queued and replayed as the\nnext prompt once the current run finishes. Each queued line is shown as\n`queued: <text>`\n\n.\n\nManage the queue with `/queue`\n\n, which works even while a run is active:\n\n`/queue ls`\n\nlists the pending inputs (bare`/queue`\n\ndoes the same)`/queue clear`\n\nempties the queue`/queue pop`\n\nremoves the last queued input, to undo a mis-typed line\n\nSelecting `/queue`\n\nin the command picker opens a second-level menu with these\nthree subcommands, so you do not need to remember them.\n\nCommands (input starting with `/`\n\n, `.`\n\n, or `!`\n\n) are not queued while a run is\nactive: wait for it to finish, or press Ctrl-C. Ctrl-C cancels the running agent\nfor real, including any child processes it spawned, and clears the queue.\n\n`/btw <message>`\n\nasks a quick \"by the way\" question in parallel with the main\nagent, without interrupting it. Like `/queue`\n\n, it works even while the agent is\nbusy. It forks the current context (including a trace of the agent's in-flight\nturn, when one is running) and answers using four read-only tools (`read`\n\n,\n`grep`\n\n, `find_files`\n\n, `list_dir`\n\n); it cannot write files or run commands. It then\nprints the reply inline.\nNothing is written to conversation history, and its token usage is tracked\nseparately in the status bar as `btw:…`\n\n. Press Ctrl-C to cancel an in-flight\n`/btw`\n\nwithout disturbing the main agent.\n\nYou can point a question at a specific file with `@`\n\n: pick `/btw`\n\nfrom the\ncommand menu, then type `@`\n\nto open the file picker (for example `/btw`\n\nthen\n`@src/main.rs`\n\nthen \"how does this work?\"), and `/btw`\n\nreads the file you\nreference.\n\nSessions are saved to `$XDG_DATA_HOME/zerostack/sessions/`\n\n. Use `-c`\n\nto\nresume the most recent session, `-r`\n\nto browse and select one, or\n`--session <id>`\n\nto load a specific session.\n\n**NOTE:** Memory is gated behind the `memory`\n\nfeature and is not included in the\ndefault build. Install with `cargo install zerostack --features memory`\n\n.\n\nWith the `memory`\n\nfeature, zerostack keeps plain-Markdown notes on disk and\ninjects the relevant ones into the system prompt at the start of every session,\nso it remembers your preferences and recent context across runs.\n\nGlobal memory files are stored in `$XDG_DATA_HOME/zerostack/agent/memory/`\n\n.\n\n**NOTE:** Hooks are gated behind the `hooks`\n\nfeature and are not included in the\ndefault build. Install with `cargo install zerostack --features hooks`\n\n.\n\nWith the `hooks`\n\nfeature, external commands can observe or gate agent behavior\nat defined lifecycle events: a tool call (`PreToolUse`\n\n/`PostToolUse`\n\n), a user\nprompt (`UserPromptSubmit`\n\n), the agent finishing a turn (`Stop`\n\n), a session\nstarting/ending, or a subagent starting/stopping. Hooks use the same\n`settings.json`\n\nshape, stdin envelope, and exit-code/stdout-JSON contract as\nClaude Code, so an existing CC hooks setup is largely compatible.\n\nHook config lives in `settings.json`\n\nat up to three locations (global,\nproject, and an admin-managed file), merged in that order. The project-level\nfile is untrusted by default; zerostack asks for confirmation (tracked by\nhash) before running project hooks for the first time. Use `--no-hooks`\n\nto\ndisable all non-managed hooks, or `--hooks-test <tool>`\n\nto dry-run\n`PreToolUse`\n\nhooks for a tool without starting a session. See\n[docs/CONFIG.md](/gi-dellav/zerostack/blob/main/docs/CONFIG.md#hooks) for the full configuration reference.\n\n**NOTE:** Advisor is gated behind the `advisor`\n\nfeature and is not included in\nthe default build. Install with `cargo install zerostack --features advisor`\n\n.\n\nWith the `advisor`\n\nfeature, the agent can consult a second model mid-session\nfor strategic guidance (architecture calls, edge cases, course correction)\nwithout derailing the main coding session. Enable it with `--advisor`\n\n, or\ntoggle it at runtime with `/advisor on`\n\n/ `/advisor off`\n\n. An optional\nhuman-handoff mode (`/advisor handoff on`\n\n) routes advisor calls to you\ninstead of a model. See [docs/CONFIG.md](/gi-dellav/zerostack/blob/main/docs/CONFIG.md#advisor) for\nconfiguration.\n\n**NOTE:** Multimodal input is gated behind the `multimodal`\n\nfeature (images)\nand `pdf`\n\nfeature (PDFs, implies `multimodal`\n\n), neither included in the\ndefault build.\n\nWith these features enabled, you can attach images and PDFs to your messages (up to 20 MB per file) and the agent processes them via the underlying provider's multimodal support.\n\n**NOTE:** Status signals require the `status-signals`\n\nfeature, which is\nincluded in the default build.\n\nPass `--status-socket <path>`\n\nto have zerostack emit `start`\n\n, `stop`\n\n, and\n`git-conflict`\n\nevents over a Unix domain socket, for external status bars or\ntooling to watch.\n\nIf you want to make multiple agents work on the same repository without having to work with git worktrees,\nzerostack now ships with `--parallel`\n\n, which enables full management of a temporary git worktree that will\nbe merged and removed before exiting the agent.\n\n*zerostack* includes an iterative coding loop for long-horizon tasks. The agent repeatedly reads the task, picks an item from the plan, works on it, runs tests, updates the plan, and loops until the task is complete or the iteration limit is reached.\n\n**NOTE** The loop system is an *experimental* feature.\n\n```\n/loop Implement the user authentication system\n/loop stop\n/loop status\n```\n\n`/loop <prompt>`\n\n— Start a loop with the given prompt`/loop stop`\n\n— Stop the active loop`/loop status`\n\n— Show current loop state\n\nEach iteration includes the original task, the evolving `LOOP_PLAN.md`\n\n, a summary of the previous iteration, and any validation output. Non-slash input is blocked while a loop is active.\n\n```\nzerostack --loop --loop-prompt \"Refactor the API\" --loop-max 10 --loop-run \"cargo test\"\n```\n\n| Flag | Description |\n|---|---|\n`--loop` |\nEnable headless loop mode |\n`--loop-prompt <text>` |\nPrompt for each iteration |\n`--loop-plan <path>` |\nCustom plan file path (default: `LOOP_PLAN.md` ) |\n`--loop-max <N>` |\nMaximum iterations (default: unlimited) |\n`--loop-run <cmd>` |\nValidation command to run after each iteration |\n\n*zerostack* provides a branch-per-task workflow using git worktrees. You can create, work in, merge, and exit worktrees entirely from the chat UI.\n\n**NOTE** The git worktrees integration is an *experimental* feature.\n\nThe worktrees integrations offers 3 slash commands:\n\n| Command | Description |\n|---|---|\n`/worktree <name>` |\nCreate a git worktree on branch `<name>` and move into it (skips creating it if it already exists) |\n`/wt-merge [branch]` |\nMerge the worktree branch into `[branch]` (default: `main` /`master` ), push, clean up, and return to the main repo |\n`/wt-exit` |\nReturn to the main repo without merging |\n\n**Create**—`/worktree feature-x`\n\ncreates a new branch and worktree directory and moves you there.**Work**— Use zerostack normally; changes stay on the feature branch.** Merge**—`/wt-merge`\n\ntells the agent to merge the branch, push, clean up, and return to the main repo.**Exit**—`/wt-exit`\n\nimmediately returns to the main repo without merging.\n\nWhen you quit zerostack while in a worktree, the `--wt-auto-merge`\n\nflag\n(or `--parallel`\n\n, which implies it) causes zerostack to attempt merging the\nworktree branch before exiting.\n\n**Clean merge**: completes silently (merge, push, remove worktree, delete branch).** Merge conflicts**: zerostack lists conflicting files and prompts:\n\n```\n[a]bort  [l]eave for manual resolution  [h]elp (agent resolves)\n```\n\n`a`\n\n– abort the merge, restore clean state, do not delete the worktree.`l`\n\n– leave the conflict state in the main repo for manual`git mergetool`\n\n.`h`\n\n– abort the merge, then spawn the agent to redo the merge with interactive conflict-resolution guidance (same as`/wt-merge`\n\n).\n\n| Flag | Description |\n|---|---|\n`--worktree <name>` |\nCreate a worktree on branch `<name>` and `cd` into it. |\n`--wt-auto-merge` |\nAuto-merge worktree branch on exit. |\n`--parallel` |\nCreate a timestamped worktree with auto-merge on exit. |\n`--wt-force` |\nForce worktree remove and branch delete (`-D` ) even if dirty. |\n`--wt-base-dir <dir>` |\nBase directory for worktrees (default: parent of repo). |\n\n**ACP** is a JSON-RPC based protocol that standardizes communication between code editors\n(IDEs, text-editors, etc.) and coding agents. With the `acp`\n\nfeature enabled, zerostack\nacts as an ACP **Agent** server, allowing editors like **Zed** to connect to it as a\ncoding agent backend.\n\n**NOTE:** ACP support is gated behind the `acp`\n\nfeature and is not included in the\ndefault build.\n\n```\n# Start zerostack in ACP stdio mode (editor spawns this as a subprocess)\nzerostack --acp\n\n# Start zerostack in ACP TCP mode (listen on 0.0.0.0:7243)\nzerostack --acp --acp-host 0.0.0.0 --acp-port 7243\n```\n\nIn `~/.local/share/zerostack/config.yaml`\n\n:\n\n```\nacp_servers:\n  my-editor:\n    host: 127.0.0.1\n    port: 7243\n```\n\nACP mode requires setting up an LLM provider (the standard `--provider`\n\n, `--model`\n\n,\nand API key env vars apply). Without it, zerostack cannot process prompts.\n\n- OpenRouter (default)\n- OpenAI-compatible (vLLM, LiteLLM, etc.)\n- Anthropic\n- Gemini\n- Ollama\n\nCustom providers can be configured with any base URL and API key environment\nvariable in `~/.local/share/zerostack/config.yaml`\n\n.\n\nGPL-3.0-only", "url": "https://wpnews.pro/news/zerostack-an-agent-that-s-less-sloppy-than-elon-s-attempts", "canonical_source": "https://github.com/gi-dellav/zerostack", "published_at": "2026-07-15 22:29:44+00:00", "updated_at": "2026-07-15 22:55:34.137108+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-tools", "artificial-intelligence", "large-language-models"], "entities": ["Zerostack", "OpenRouter", "OpenAI", "Anthropic", "Gemini", "Ollama", "OpenCode", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/zerostack-an-agent-that-s-less-sloppy-than-elon-s-attempts", "markdown": "https://wpnews.pro/news/zerostack-an-agent-that-s-less-sloppy-than-elon-s-attempts.md", "text": "https://wpnews.pro/news/zerostack-an-agent-that-s-less-sloppy-than-elon-s-attempts.txt", "jsonld": "https://wpnews.pro/news/zerostack-an-agent-that-s-less-sloppy-than-elon-s-attempts.jsonld"}}