Skip to content

writ init

Create a writ file.

Terminal window
writ init <name>

The command creates <name>.yaml in the project root. The command stops with an error when the file exists, so the command cannot overwrite your work.

Flag Purpose
--full Include each optional field.
--global Save the writ under ~/.writ/writs/.

Create a global writ:

Terminal window
writ init bug-fixer --global

Edit ~/.writ/writs/bug-fixer.yaml. Fill in the mandate and grants. Then use its name from any project:

Terminal window
writ check bug-fixer
writ plan bug-fixer --agent claude
writ sessions --agent claude
writ start bug-fixer --agent claude --session <session-id>

Writ checks the current project before the global writ directory. A project file with the same name takes precedence. Set WRIT_HOME to move the complete Writ home, including the global writ directory.

The name must start with a lowercase letter. After the first letter, the name can contain lowercase letters, numbers, and single hyphens.

Terminal window
writ init bug-fixer

Without --full, the file contains the three necessary fields and some bounds in comments. These values are the managed operational defaults. They are not authored while they stay in comments:

writ: bug-fixer
mandate: ""
grants: []
# bounds:
# iterations: 25
# cost: $1.00
# wall_clock: 15m

With --full, the file contains each field and the default remedies:

Terminal window
writ init bug-fixer --full
writ: bug-fixer
holder: default
mandate: ""
grants: []
bounds:
iterations: 25
cost: $1.00
wall_clock: 15m
edits:
max_files: 5
max_changed_lines: 200
invariants: []
obligations: []
satisfaction:
all: []
remedies:
on_bound_breach: { do: halt }
on_invariant_breach: { do: inform, inform: holder, strikes: 3 }
on_assent_refused: { do: halt }

Use --full when you want to see each field. Use the short file when you know the fields, because a short writ is easier to read.