Minimalist autonomous agent runner
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Zen Mode 🧘
A minimalist, file-based autonomous agent runner.
Orchestrates claude to scout, plan, code, and verify tasks using the file system as memory.
The Philosophy:
- Files are Database: No SQL, no vector stores, no hidden state.
- Markdown is API: Plans, logs, and context are just markdown files you can read and edit.
- Aggressive Cleanup: Designed for legacy codebases. It deletes old code rather than deprecating it.
- Contract First: Enforces architectural rules via a "psychological linter."
- Slow is Fast: Upfront planning costs tokens now to save thousands of "debugging tokens" later.
TLDR: Treat LLMs as stateless functions and check their work. Run zen docs/feature.md --reset.
Quick Start
1. Prerequisites You need the Claude CLI installed and authenticated.
npm install -g @anthropic-ai/claude-cli
claude login
2. Install Zen
pip install zen-mode
# OR copy 'scripts/zen.py' and 'scripts/zen_lint.py' to your project root.
3. Run a Task
# Describe your task
echo "Refactor auth.py to use JWTs. Remove session logic." > task.md
# Let Zen take the wheel
zen task.md
How it Works
Zen Mode breaks development into five distinct phases. Because state is saved to disk, you can pause, edit, or retry at any stage.
.zen/
├── scout.md # Phase 1: The Map (Relevant files & context)
├── plan.md # Phase 2: The Strategy (Step-by-step instructions)
├── log.md # Phase 3: The History (Execution logs)
├── backup/ # Safety: Original files are backed up before edit
└── ...
- Scout: Parallel search strategies map the codebase.
- Plan: The "Brain" (Opus) drafts a strict implementation plan.
- Implement: The "Hands" (Sonnet) executes steps atomically.
- Verify: The agent runs your test suite (pytest/npm/cargo) to confirm.
- Judge: An architectural review loop checks for safety and alignment.
Human Intervention
Since state is just files, you are always in control:
- Don't like the plan? Edit
.zen/plan.md. The agent follows your edits. - Stuck on a step? Run
zen task.md --retryto clear the completion marker. - Total restart? Run
zen task.md --reset.
The Constitution (CLAUDE.md)
When you run zen init, it creates a CLAUDE.md file in your root (if you don't have one). This is the Psychological Linter.
Put your non-negotiable rules here. The agent reads this every single step.
- "Always use TypeScript strict mode."
- "Prefer composition over inheritance."
- "Never use 'any'."
The Hidden Token Economy
At first glance, Zen Mode's five-phase process seems token-intensive. In practice, it is net-positive because it eliminates the "Debug Spiral."
| Approach | Typical Token Flow | Cost |
|---|---|---|
| "Shotgun" Chat | Generate code -> Debug -> Fix -> Debug -> Fix | ~4,700 tokens |
| Zen Mode | Scout -> Plan -> Implement -> Judge | ~2,800 tokens |
The Result: You spend ~40% fewer tokens to achieve architectural coherence that would usually take 3-4 manual iterations.
Advanced
Configuration
Tune the behavior via environment variables:
export ZEN_MODEL_BRAIN=claude-3-opus-20240229 # Planning/Judging
export ZEN_MODEL_HANDS=claude-3-5-sonnet-20241022 # Coding
export ZEN_SHOW_COSTS=true # Print per-call cost and token counts
export ZEN_TIMEOUT=600 # Max seconds per step
export ZEN_RETRIES=2 # Retries before "Stuck"
The Eject Button
If you installed via pip but want to hack the source code:
zen eject
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zen_mode-1.0.3.tar.gz.
File metadata
- Download URL: zen_mode-1.0.3.tar.gz
- Upload date:
- Size: 64.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b6e0f78a3dbc4a6dc3fdd7e93a3a6a6ccb3021e6347f3706ca205bf7e60e8dd
|
|
| MD5 |
7b07fb597f7a1f81c57af0d28d38e93f
|
|
| BLAKE2b-256 |
210fe7273fdbdc10d3672e32ea1caf80c0e19d602824701f2177db9db5708437
|
File details
Details for the file zen_mode-1.0.3-py3-none-any.whl.
File metadata
- Download URL: zen_mode-1.0.3-py3-none-any.whl
- Upload date:
- Size: 27.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc9f041c894f58443857046cbe9444ea835c3dc4b5c322d52b26436c02c0f54a
|
|
| MD5 |
e1f3694985e1069efde6e2cbb936a957
|
|
| BLAKE2b-256 |
53923f2e2beb8ec84ff547578cc42768550d2025aaaaae3ede40cb8c4e438195
|