A plugin for Claude Code
Claude does
the work. You keep
the decisions.
Claude drafts the plan.
/mandatum:start sizes the work, reads the repository, asks only the questions that change the outcome, says what it honestly thinks of the idea, and writes a charter.
.mandatum/CHARTER.md
End state, scope, quality bar, constraints, stop rules, and a phase map where every phase has an exit that can fail.
You approve it.
Status: approved
Edit .mandatum/CHARTER.mdASK
From that line on, a hook asks you before any direct edit of the charter. It changes only by a dated amendment you accept.
Claude runs what is safe.
A hook outside the model reads every command and file write before it runs. Most pass without a word. Three kinds of push are refused outright.
- 01
git statusALLOW - 02
npm testALLOW - 03
rm -rf node_modulesALLOW - 04
git commit -m x && git push origin main:mainDENYA push chained after other commands: if an earlier step fails or changes the branch, the push publishes something else. Run the push as its own command.
- 05
git push origin main:mainASK
You decide the rest.
Publishing, deleting, spending, frozen files, e-mail. One command is waiting for you.
Gate PUBLICwaiting for you
git push origin main:main
Pushes commits to a remote. Only the owner decides this.
Nothing is waiting for you.
Claude writes the handoff.
Status, decisions and measurements go to plain Markdown in your repository as the work happens. When a session tries to end with three or more files newer than the status file, a hook stops it and asks.
Stop hook
Mandatum closeout: 4 files changed since .mandatum/STATUS.md was last updated (for example api/slots.py, tests/test_slots.py, docs/report.md). Before stopping, close the loop (/mandatum:closeout): ...
You type one word.
continue
In any later session, on any day. The status file is already loaded, so Claude takes the next unblocked phase. Nothing to explain again, no summary to paste.
Claude checks its own claims.
Every number in a document must exist in a result file. A release check scans what would be published for secrets, addresses and home paths. A reviewer agent with fresh context has one job: to show that the work is wrong.
mandatum trace
report.md:3 0.4% (not in any source)
You read one line.
TRACE FAIL: 1 of 5 numbers in 2 documents have no source
RELEASE-CHECK PASS: 18 files scanned, 0 warnings
PROSE PASS: 0 hits in 2 files
Each check ends in PASS or FAIL with a matching exit code, so the same three commands run in CI without Claude.
Part 02 is a scripted replay: each verdict is the one mandatum check printed for that command when this page was built, and the reason beside it is cut from the same answer. ALLOW runs without a word, DENY is refused outright, ASK waits for you. The other lines are copied from real runs of version 0.1.0. The playground below runs the real classifier on whatever you type.
Mandatum is a Claude Code plugin that stops Claude before anything you cannot undo, and lets any new session pick up exactly where the last one ended. A hook outside the model checks every command and file write; plain files in your repository hold the plan, the decisions and the handoff.
Three hooks, thirteen skills and one reviewer agent, written against the Python 3 standard library. Everything it keeps is plain text on disk, almost all Markdown and JSON. Version 0.1.0, MIT licence.
Install it from inside Claude Code
/plugin marketplace add mohamedbechirkefi/mandatum
/plugin install mandatum@mandatum
It does nothing in a project that has no .mandatum/ directory.
IThe gate, live
Type a command. Watch the gate decide.
This is the plugin's own classifier, the same Python the hook runs, loaded in your browser and called through mandatum check. It reads the text of a command and runs nothing. What you type stays on this page.
Pick a case or type a shell command, then press Enter.
Loading the Python runtime.
Cases to try
Look-alikes included: some of these pass, on purpose.
Pushes
Deletes
Frozen paths
Network and spend
People and controls
.mandatum/config.json
The playground runs in a virtual project. Change its config and the verdict follows.
IIHow it works
A charter, phases, gates, and a handoff.
The plan lives in plain files, not in the conversation. Three hooks run outside the model, so the steps that are hard to undo do not depend on the model remembering an instruction.
What ends up on disk
.mandatum/
- CHARTER.md
- end state, scope, quality bar, constraints, stop rules, phase map
- STATUS.md
- phase states, gate ledger, open questions, the current handoff
- DECISIONS.md
- append-only: what was chosen, what was rejected, who decided
- phases/
- one doc per phase: tasks, acceptance, exit criteria
- journal/
- one entry per measurement or finding, negative results included
- CLAIMS.md
- every public claim, its evidence and its limit
- INCIDENTS.md
- where the process itself caught or missed something
- HANDOFFS.md
- archive of past handoffs
- sheets/
- decision sheets: pending choices you answer with letters
- config.json
- gates, frozen paths, spend patterns, release identity
- grants.json
- your standing approvals
Plain text, almost all Markdown and JSON, meant to be committed and read by people.
Checks that end in one line
Each prints a single PASS or FAIL line with a matching exit code, so it can run in CI without Claude.
mandatum trace- Every number a document reports must exist in a result file.
mandatum release-check- Scans tracked files for e-mail addresses, home paths, secrets and env files. Checks the tree, and the branch and commit identity when you have set them.
mandatum prose- Counts the phrases you banned from your documents.
What ships
Thirteen skills, typed as /mandatum:name:
- start
- continue
- phase
- build
- verify
- review
- audit
- decide
- release
- design
- report
- closeout
- grant
One agent, refuter: a reviewer with fresh context and no edit tools, instructed to change nothing, whose only job is to show that a plan, a diff or a claim is wrong. The command-line tool needs nothing but Python 3 and its standard library.
IIIEnforced versus instructed
What a hook guarantees, and what is only an instruction.
The distinction matters, so it is drawn plainly. The last line of defence should not be a sentence in a prompt.
Enforced
By hooks: code that runs outside the model
A hook fires whether or not the model remembers the rule.
- Gate hook before every shell command and file write
- Classifies the action. At a gate it asks you, with the reason. Three push patterns are refused outright. Writes to the approved charter, the gate config and the grants file ask too.
- Session-start hook
- Loads the working rules and the status file into context, so no session starts cold.
- Stop hook
- If three or more files are newer than the status file, it stops the session from ending and asks for the handoff, at most once every 45 minutes.
Instructed
By skills: the model follows them, nothing forces it
Each skill explains why its rule exists, so the model can apply it to cases the text did not anticipate.
- The interview and the charter
- Phase docs and their exit criteria
- Journaling and decision records
- Verification discipline
- The design bar and the report rules
- The RIGHTS gate: no command shape exists for it
Enforced has a boundary of its own: the gate hook reads the text of a command. See the limits.
IVThe gates
Six gates. The hook asks; you answer.
Each gate has a mode in the config: ask (the default), deny, or off. Press an example to send it through the playground.
git push, GitHub API writes, package publishes, deploys, uploads
git reset --hard, git clean, force-push, git filter-branch and git filter-repo, killing processes by name, database drops
terraform apply, cloud instance creation, batch jobs, plus your own patterns
Three pushes are refused, not asked
Each of these shapes comes from a real incident. The hook denies them outright.
-
A push that names no ref
The published commit would depend on which branch happens to be checked out. Name the remote and both sides.
-
A push chained with a command that changes something
If an earlier step fails or changes the branch, the push publishes something else. Run the push as its own command. Behind commands that only read, such as
git status, a push asks like any other. -
A push inside a loop
Push one repository per command, so each one is seen and approved on its own.
A single named push, , still asks you every time, unless you have set a standing grant for it.
VQuick start
Install, start, then one word per session.
-
Install
Two lines, typed inside Claude Code. The plugin stays inert until a project opts in.
/plugin marketplace add mohamedbechirkefi/mandatum/plugin install mandatum@mandatum -
Start
Say what you want to build. Claude sizes the work, asks a few questions, and writes the charter and a phase map for your approval.
/mandatum:start <what you want to build> -
Continue
In any later session, one word. The status file is already loaded; Claude takes the next unblocked phase and writes a handoff before it stops.
continue -
Grant
Pre-approve an exact command, with an expiry or a use count if you wish. Only you can create a grant; the model cannot.
/mandatum:grant add "git push origin main:main" --gate PUBLIC
VILimits
What it does not do, stated plainly.
-
The gate hook is a guard rail, not a sandbox.
It reads the text of a command. A command assembled at run time, or a script that pushes from inside, passes unnoticed. It catches mistakes and drift; it does not contain an adversary. Use Claude Code's own permissions and sandboxing for that.
See it miss:
-
No controlled comparison has been run.
There is no measured evidence yet that projects run with Mandatum turn out better than projects run with another workflow, or with none. The protocol for that comparison is written down; it has not been run.
-
It was developed on macOS.
Linux is covered by the test suite in CI. Windows is untested, and the hooks call
python3, which a default Windows install may not provide. -
It supports Claude Code only.
The hooks, the skills and the install path are those of Claude Code.