Hazzel: the open source terminal coding agent
A tiny AI coding assistant that lives in your terminal — approval-first, bring your own key.
hazzel v1.5.7 · free · AGPL-3.0 · macOS, Linux, Windows · ★ star if useful
Hazzel is a terminal coding agent and CLI harness: it reads code, edits files, runs commands, reviews diffs and reads the web — always with your approval first. Every step is visible, every mutation goes through you.
It is open source (~10k lines of Python you can trace end to end), model-agnostic (Groq, OpenAI, Anthropic, Mistral, Gemini, DeepSeek, OpenRouter, local Ollama), and free — no subscription. You pay your provider directly, or nothing at all on local models.
Install the terminal coding agent
$ pip install hazzel
Requires Python 3.10 or newer. Then:
export GROQ_API_KEY="..." # or skip this and pick a provider inside with /model
cd your-project
hazzel
The whole loop is agent/core.py, every action is in tools/, the undo system is safety.py — and Hazzel stops before every write to show you what is about to happen.
Hazzel 1.5.7 · ~/hazzel
❯ Fix the failing test in tests/test_agent.py
read_file · edit_file (diff approved) · run_command pytest -q — passed
Why Hazzel
- Approval-first: file changes show a diff before they apply, shell commands ask first, destructive ops are checkpointed so
/undoalways works. - Small and inspectable: no deploys, no hidden behavior — a terminal agent you can see through. Verify the safety claims in ~200 lines:
src/hazzel/safety.py,src/hazzel/tools/run_command.py. - Real cost visibility: provider-reported tokens priced into dollars and logged locally —
/usage today|week|month,/budgetwarns but never blocks. - Goal-driven:
/goalpins an objective and every turn steers toward it until done. - Plan and think modes:
/plan onexplores read-only and hands you a numbered plan;/think onreasons step-by-step on hard edits. - Skills and AGENTS.md: drop in a
SKILL.mdor project map and Hazzel follows it every turn. - Sessions that survive restarts: per-project history saves automatically,
/session restorepicks up where you left off. - Model and provider agnostic: Groq, OpenAI, Anthropic, Mistral, Gemini, DeepSeek, OpenRouter, and local Ollama through one key each.
Hazzel vs alternatives
Looking for an Aider alternative or a Claude Code alternative you can run in any terminal with your own key? How the options compare:
| Tool | Open source | Bring your own key | Approval-first diffs | Built-in undo | Local models |
|---|---|---|---|---|---|
| Hazzel | Yes (AGPL-3.0) | Yes — 8 providers | Yes, every write | Yes (/undo) | Yes (Ollama) |
| Aider | Yes (Apache-2.0) | Yes | Yes | Git-based | Yes |
| Cloud agents | Mostly no | Subscription | Varies | Varies | No |
Hazzel's bet: most agents ask you to trust a black box. Hazzel asks you to trust three specific, inspectable mechanisms instead — approved diffs, automatic checkpoints, project-root sandboxing.
Commands
Modes
/model— switch provider and model/plan on|off— read-only exploration with a numbered plan/think on|off— deeper reasoning when a task is hard/goal [@objective]— pin an objective,/goal runexecutes it
Cost
/usage— tokens and dollars this session/usage today|week|month— spend over time,--by-modelper model/budget— warn-only spend limits, never blocks
Git
/review [--staged]— read-only AI review: Summary, Risks, Missing, Before commit/commit— auto-drafted message with diff preview/status·/diff·/log— git without leaving the loop
Transcript
/summary— what the last turn did/export [file]— save the transcript to markdown/copy [code]— copy the last reply/retry— re-run your last message/jobs [id|kill id]— background shell jobs/undo [n]— revert file changes/session restore— pick up where you left off/clear— reset the conversation
Project
/init [file]— generate an AGENTS.md project map/skills [name]— list installed skills, preview one/help— quick overview,/docs— the full usage guide/logout— wipe saved keys,/exit— quit
Type @path to attach a file, !command to run shell directly (& suffix runs it in the background — /jobs polls and kills).
hazzel -p "prompt" answers once and exits — pipe stdin in, -y allows writes, --output-format json for scripts.
Frequently asked questions
- Is Hazzel free?
- Yes. Hazzel is free and open source (AGPL-3.0). You pay your model provider directly for API usage — or nothing at all with local Ollama models. No subscription, nothing metered by Hazzel.
- Which AI models does Hazzel support?
- Groq, OpenAI, Anthropic, Mistral, Gemini, DeepSeek, OpenRouter and local Ollama — one API key each, switched any time with
/model. - Does Hazzel change my files without asking?
- No. Every file edit shows a diff before it applies, shell commands ask first, and every write is checkpointed so
/undoalways restores prior bytes. Commands are sandboxed to your project root. - What do I need to install Hazzel?
- Python 3.10+ on macOS, Linux or Windows.
pip install hazzel, runhazzel, add a key with/model. - How is Hazzel different from Aider or Claude Code?
- Hazzel is ~10k lines of Python you can trace end to end, bring-your-own-key with no subscription, and approval-first on every mutation with automatic undo. See the comparison table.