Mandatum GitHub

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.

  1. 01git statusALLOW
  2. 02npm testALLOW
  3. 03rm -rf node_modulesALLOW
  4. 04git commit -m x && git push origin main:mainDENY

    A 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.

  5. 05git 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.

Try your own commands

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.

mandatum check engine not loaded yet
Pick a case or type a shell command, then press Enter.

Nothing is executed. The classifier only reads the text.

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.

frozen
    gates
    grants

    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.

    How a project runs under Mandatum Four steps across four lanes. Charter: you state the goal, Claude drafts the charter with the start skill, you approve it, and it is written to CHARTER.md. Phases: in any later session you type continue, the session-start hook loads the working rules and STATUS.md, and Claude takes the next unblocked phase. Gates: every command and file write passes the gate hook, which allows, asks you, or denies. Handoff: Claude records decisions, updates the status and writes the handoff, and the stop hook asks for it if the status file was not updated. The next session resumes from the files on disk. YOU the owner HOOKS code outside the model CLAUDE the model ON DISK .mandatum/ 1Charter 2Phases 3Gates 4Handoff the goal goes down, the charter comes back for approval asks you, with the reason before anything runs Next session: the plan is read from disk, not recalled from a conversation. States the goal, approves the charter. continue typed in any later session. Answers at the gate: yes, no, or a standing grant. Session-start hook loads the working rules and STATUS.md. Gate hook each command and file write ALLOW ASK DENY Stop hook asks for the handoff if the status file was not updated. /mandatum:start sizes the work, asks a few questions, drafts the charter. Next unblocked phase works toward exit criteria that can fail. The work commands, file writes, measurements. Closeout decisions recorded, status updated, handoff written. CHARTER.md end state, scope, phase map phases/ tasks and exit criteria journal/ DECISIONS.md measurements and choices STATUS.md HANDOFFS.md where things stand How a project runs under Mandatum Four steps. Charter: you state the goal and approve the charter that Claude drafts with the start skill; it is written to CHARTER.md. Phases: you type continue in any later session, the session-start hook loads the rules and STATUS.md, and Claude takes the next unblocked phase. Gates: Claude runs commands and writes files, the gate hook checks each one and allows, asks you, or denies. Handoff: Claude records decisions, updates the status and writes the handoff; the stop hook asks for it if the status file was not updated. The next session goes back to step two and reads from disk. 1Charter YOU States the goal and approves the charter. CLAUDE /mandatum:start sizes the work, drafts the charter. DISK CHARTER.md 2Phases YOU continuein any later session. HOOK Session start loads the rules and STATUS.md. CLAUDE Takes the next unblocked phase, toward exit criteria that can fail. DISK phases/ 3Gates CLAUDE Runs commands, writes files. HOOK The gate hook checks each one: ALLOW ASK DENY YOU Answer at the gate: yes, no, or a standing grant. DISK journal/ DECISIONS.md 4Handoff CLAUDE Records decisions, updates the status, writes the handoff. HOOK Stop hook asks for the handoff if the status file was not updated. DISK STATUS.md HANDOFFS.md Next session: back to step 2, read from disk.

    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.

    GateReached byExample
    PUBLIC git push, GitHub API writes, package publishes, deploys, uploads
    DESTRUCTIVE recursive deletes, git reset --hard, git clean, force-push, git filter-branch and git filter-repo, killing processes by name, database drops
    FREEZE a write, move, delete or extraction the hook can see on a path you listed as frozen: a test set, a protocol, a released artifact
    SPEND terraform apply, cloud instance creation, batch jobs, plus your own patterns
    CONTACT sending e-mail from the command line
    OWNER changes to Mandatum's own config, grants, or the approved charter

    Three pushes are refused, not asked

    Each of these shapes comes from a real incident. The hook denies them outright.

    1. 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.

    2. 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.

    3. 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.

    1. 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
    2. 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>
    3. 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
    4. 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.

    1. 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:

    2. 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.

    3. 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.

    4. It supports Claude Code only.

      The hooks, the skills and the install path are those of Claude Code.