Getting Started
Zap is a single Rust binary — no Python venv, no Node, no Docker. Install it and run it from any directory.
Install Rust
Restart your terminal, or run source ~/.cargo/env.
Install zap
Set your API key
Or configure Gemini, OpenAI, or a local model — see Configuration.
Run
Type /init on first use to build the code index and generate a project summary.
Prefer a pre-built binary? Download from releases ↗
Install Rust
Install zap
Set your API key
Run
Pre-built binary available on the releases page ↗
One-line install (PowerShell)
Downloads and installs the pre-built binary. No Rust required.
Set your API key
Run
Prefer Rust? cargo install zap-coding-agent — get Rust here ↗
/init after installing.
This builds the AST code index and generates a project summary. It takes 10–30 seconds and runs once per project. With the index active, zap resolves symbol locations from .zap/code.db instead of grepping — typically 3–5 fewer tool calls per task, and no duplicate files or invented patterns.
After big refactors, run /index to rebuild. See Code Indexing ↓ for how this works and a real-world example.
Configuration
All settings live in ~/.agent.toml. Create the file if it doesn't exist — zap reads it on every startup.
mode = "auto" to let zap run tools without asking for confirmation each time. Useful for trusted projects.
Project Init
Run /init once in a new project and zap goes from blank-slate to fully context-aware in about 30 seconds. It builds the code index, reads your source files, and writes persistent knowledge files the agent loads on every future session.
Detects your stack
Identifies language and framework from manifests (Cargo.toml, package.json, pom.xml) and fires the right skill automatically.
Builds the code index
Runs tree-sitter across your repo and writes the AST symbol index to .zap/code.db. The model queries what exists before writing anything new.
Writes project knowledge
Asks the LLM to read your source and fill in ZAP.md — build commands, architecture, key files, do-not-touch list.
| File | What it contains | Loaded when |
|---|---|---|
ZAP.md | Project overview, build/test commands, architecture, do-not-touch list | Every session |
.zap/understanding.md | Module map, data flows, non-obvious patterns, constraints | Every session |
.zap/context.md | Last session: goal, files touched, what's next (auto-updated on exit) | Session start |
.zap/session_log.md | History of all past sessions indexed by date | On request |
Skill-First Context
Skills are plain markdown files that zap injects into the context window before the model sees your message. The key insight: only relevant skills fire. A greeting costs 31 tokens. A Rust question gets the Rust skill injected automatically.
| Type | When it fires | Example |
|---|---|---|
| Core | Every message, always injected | CLAUDE.md, project context |
| Trigger | When your message matches a keyword trigger | Rust, React, Python, testing skills |
Skills are markdown files with an optional YAML frontmatter block. Files without frontmatter are always-on Core skills.
Project skills
Drop .md files in .zap/skills/ inside your project. Checked in with your repo — shared with your team.
Global skills
Put skills in ~/.zap/skills/ or configure skill_paths in ~/.agent.toml to point at any directory.
Skills created for Claude Code or Gemini work in zap. Point skill_paths at ~/.claude/skills to share them automatically.
/skills in a session to see which skills are loaded and which triggered on the last message.
Code Indexing
Zap builds an AST-level symbol index of your project using tree-sitter and stores it in a local SQLite database at .zap/code.db. The model can query it to find what already exists before deciding what to create.
Takes 10–30 seconds for medium projects. The index is gitignored by default — it's a local cache, not a committed artifact.
Symbols
Functions, structs, enums, traits, impls, classes, and methods — with their file path, line number, and signature.
Files
Every source file with its symbol count and last-indexed timestamp.
Languages
Rust, TypeScript, JavaScript, Python, Go, Java — and more via tree-sitter grammars.
The model queries the index directly with SQLite. No fuzzy search, no hallucination — it either finds the symbol or it doesn't.
Without an index, an agent must grep through files to find where a symbol lives — that's multiple tool calls before it can even start. With the index built, zap resolves it in one SQL query.
Context Visibility
Zap shows you exactly what's in the context window — token counts per message, which skills fired, and total usage. You can inspect, manage, and trim the context without starting a new session.
| Command | What it does |
|---|---|
/context |
List all messages with their index and token count |
/context drop 3 |
Remove message at index 3 (keeps the rest) |
/context drop 3-7 |
Remove messages 3 through 7 |
/context clear |
Wipe the entire context — keeps skills and system prompt |
Casual Messages
Not every message is a coding task. When you greet zap or ask something unrelated to your project, it skips skill injection entirely — saving the tokens for when they count.
The classifier runs locally and adds zero latency — it's a keyword heuristic, not a model call. It errs on the side of injecting skills when uncertain.
Dynamic MCP Loading
Zap supports the Model Context Protocol. MCP servers start pending — their tool schemas don't enter the context until explicitly needed. No 10,000-token schema dump on every turn.
Zap reads MCP config from ~/.zap/mcp.json (global) and .mcp.json (project-local). Both use the same Claude Code-compatible format.
Other agents
Dump all MCP tool schemas into every context window at startup — even tools you never call.
Zap
Servers start idle. Schemas enter context only when the model decides to call that tool — keeping baseline cost near zero.
~/.claude/mcp.json or a Claude Code MCP config, zap reads the same format. No migration needed.
Multi-Provider
Zap works with every major AI provider — and local models. Switch mid-session without restarting.
Security Boundary
Zap is explicit about what it touches. Every shell command and file write is shown before it runs. You confirm — or deny — each action.
Zero telemetry
No usage data, no crash reports, no analytics. Your code and queries stay between you and your chosen model provider.
Keys stay local
API keys live in ~/.agent.toml or environment variables. Never logged, never sent anywhere other than the provider API.
Ask mode default
Tool calls (file edits, shell commands) require confirmation by default. Switch to auto only for trusted projects.
Zap is open source under the MIT License. Read the code, fork it, audit it. The binary you run is built from the public source.
Session Memory
Zap keeps a running log of what was worked on and which files were touched. When you start a new session, the model has context from previous ones — without bloating the live context window.
.zap/context.md
Last session's work, files touched, and what's next. Updated by zap at the end of each session.
.zap/session_log.md
A brief history of past sessions — goal and files per session. Grows incrementally, never overwrites.
You can also create a CLAUDE.md (or .zap/PROJECT.md) with permanent project-level context that fires on every message as a Core skill.
CLAUDE.md concise. It fires on every message — every token in it is spent whether the model needs it or not. Put language-specific context in trigger skills instead.
Autonomous Mode
/goal <condition> runs turns automatically until the model signals it's done or a turn limit is reached. Use it for multi-step tasks you'd otherwise have to shepherd turn-by-turn.
The model runs tool calls autonomously each turn. When it's finished it ends its response with ✓ DONE and the loop stops. The sidebar shows the goal condition, current turn, and elapsed time while it runs. Ctrl+C cancels at any point.
Good for
Multi-file refactors, adding full feature layers (controller + service + tests), fixing all lints, running a test suite and fixing failures.
Permission mode
Goal mode respects your current permission mode. Use /mode auto before /goal to let it run without confirmation prompts on every tool call.
Commands Reference
Type any command at the zap prompt. Tab-completion is available for all slash commands.
| Command | Description |
|---|---|
/init | Build (or rebuild) the code index for the current project |
/skills | List loaded skills and which triggered last |
/context | Show context window with token counts per message |
/context drop N | Drop message at index N |
/context drop N-M | Drop messages from index N through M |
/context clear | Clear all messages (keeps skills and system prompt) |
/model <name> | Switch model for the current session |
/provider <name> | Switch AI provider mid-session |
/mode ask | Require confirmation for every tool call |
/mode auto | Run tools without confirmation prompts |
/help | Show all available commands |
/exit | End the session (Ctrl+C also works) |