mana
Mana is the medium for coding agent work: it gives that work structure, verification, dependencies, and memory.
It turns work that would normally disappear into prompts and scrollback into durable units that can be verified, retried, decomposed, and built on over time.
Plain Markdown files in .mana/. Any agent that can read files and run shell commands is fluent in mana.
Contents
- Why mana exists
- The core model
- Install
- Quick start
- How mana works
- Working with agents
- Fail-first development
- Decomposition and dependencies
- Facts and memory
- Command reference
- Configuration
- Documentation
Why mana exists
Coding agents are powerful, but their work is usually ephemeral.
- The plan lives in a prompt
- "Done" is often vague
- Retries start cold
- Dependencies stay implicit
- Useful lessons vanish into logs
Mana gives that work a durable shape.
A unit says what to do. A verify gate says how to know it's done. Dependencies say what it relies on. Attempts, notes, and facts record what was learned.
Agents come and go. Mana keeps the work legible.
The core model
Mana is built from a few simple ideas:
Unit
A unit is one bounded piece of work.
It has:
- an ID
- a title
- a status
- a verify command
- optional description, acceptance criteria, paths, labels, and notes
Verify gate
Every unit has a verify gate: a shell command that must exit 0 before the unit can close.
This makes "done" machine-checkable.
Graph
Units form a graph through:
- parent / child relationships for decomposition
- dependencies for ordering
- produces / requires for artifact-based coordination
Memory
Mana keeps context with the work itself:
- failed attempts
- notes
- verified facts
- related files
- dependency context
Medium
Everything lives in .mana/ as plain files.
That means the system is:
- local-first
- git-friendly
- inspectable
- agent-agnostic
- resilient when any one tool or process dies
Install
Quick start
Initialize a project:
Create a unit:
Create another:
Dispatch ready work to your agent:
Watch what happens:
Manual workflow:
How mana works
Work lives in Markdown units inside .mana/:
.mana/
├── 1-add-csv-export.md
├── 2-add-tests.md
├── 2.1-unit-tests.md
└── archive/2026/01/
A unit looks like this:
---
id: "1"
title: Add CSV export
status: in_progress
verify: cargo test csv::export
attempts: 0
---
Add a `--format csv` flag to the export command.
**Files:** src/export.rs, tests/export_test.rs
When you run mana close 1:
- Mana runs the verify command
- Exit
0→ the unit closes and archives - Non-zero exit → the unit stays open and the failure is recorded for the next attempt
That simple loop is the foundation:
define → attempt → verify → learn → retry or close
Working with agents
Configure an agent once, then dispatch units to it:
Or set the run template directly:
{id} is replaced with the unit ID.
Dispatching
Batch verify
When parallel agents share the same verify command (e.g. cargo build), each agent running it independently causes lock contention and redundant work. Enable batch verify to run each unique command once:
With batch verify enabled:
- Agents skip verify and exit after calling
mana close - The runner collects all completed units
- Groups them by verify command and runs each command once
- Passing units close normally; failing units reopen for retry
Monitoring
Agent context
mana context <id> produces a complete briefing for an agent:
- unit spec
- previous attempts
- project rules
- dependency context
- file structure
- relevant file contents
This is how agents stay grounded in the work instead of re-deriving context from scratch.
Fail-first development
Mana defaults to fail-first.
Before a unit is created, the verify command runs and must fail.
- If it already passes, the unit is rejected
- If it fails, the unit is accepted
- Later,
mana closeruns the same verify command and it must pass
# Rejected: verify already passes
# Accepted: real failing check
Use --pass-ok (-p) when fail-first is not appropriate, like refactors or safety checks:
Decomposition and dependencies
Parent / child units
Break large work into smaller units:
Parents can auto-close when all children close.
Dependencies
Coordinate units explicitly:
Mana blocks work until its dependencies are satisfied.
Sequential chaining
Each next unit automatically depends on the previous one.
Planning
Use planning when a unit is too large or underspecified for a single attempt.
Facts and memory
Mana can also store verified project facts.
Facts appear in context and can go stale if their verification expires or fails.
This gives agents a durable memory that lives outside chat history.
Command reference
Unit lifecycle
Orchestration
Inspecting the graph
Dependencies and memory
Maintenance and integration
Pipe-friendly usage
|
|
|
|
Configuration
Project configuration lives in .mana/config.yaml.
| Key | Default | Description |
|---|---|---|
run |
— | Command template for agent dispatch. {id} = unit ID. |
plan |
— | Command template to split large units. |
max_concurrent |
4 |
Max parallel agents. |
max_loops |
10 |
Max agent loops before stopping (0 = unlimited). |
poll_interval |
30 |
Seconds between loop mode cycles. |
auto_close_parent |
true |
Close parent when all children close. |
verify_timeout |
— | Default verify timeout in seconds. |
rules_file |
— | Path to rules file injected into mana context. |
file_locking |
false |
Lock unit paths files during concurrent work. |
extends |
[] |
Parent config files to inherit from. |
batch_verify |
false |
Batch shared verify commands: run each once after agents complete. |
auto_commit |
false |
Commit all changes on close. Skipped in worktree mode. |
commit_template |
feat(bean-{id}): {title} |
Template for auto-commit messages. Vars: {id}, {title}, {parent_id}, {labels}. |
on_close |
— | Hook after close. Vars: {id}, {title}, {status}, {branch}. |
on_fail |
— | Hook after verify failure. Vars: {id}, {title}, {attempt}, {output}, {branch}. |
post_plan |
— | Hook after mana plan creates children. |
review.run |
— | Review agent command. Falls back to run. |
review.max_reopens |
2 |
Max review reopen cycles. |
Config inheritance
# .mana/config.yaml
extends:
- ~/.mana/global-config.yaml
project: my-app
run: "claude -p 'read unit {id}, implement it, then run mana close {id}'"
Child values override parent. Multiple parents are applied in order; later values win.
Use extends for shared non-secret defaults such as agent command templates or concurrency settings. Do not use it as a secret-distribution mechanism.
Documentation
- Agent Skill — Quick reference for AI agents
- Best Practices — Writing effective units for agents
mana --help— Full command reference
Contributing
Contributions welcome. Fork the repo, create a branch, and open a pull request.