Skip to content

why — which decision explains this file

decree why <file> maps a path to the decisions that govern it — before you edit a line. It is the first question to ask about unfamiliar code: why is this the way it is, and is my change allowed?

Scenario You're about to edit src/auth/tokens.py. Why are tokens hashed, not encrypted?

Without decree

You don’t know. So you git blame, open three stale PRs, grep the wiki, and ping a teammate who left last quarter. Twenty minutes gone, and you’re still guessing whether your change is allowed.

With decree

One command returns the exact governing decision, attached to the file:

Terminal window
$ decree why src/auth/tokens.py
src/auth/tokens.py — 1 governing decision
▸ SPEC-00000000000000000000000001 implemented 2026-05-10 exact
JWT token storage
governs: src/auth/tokens.py
→ exit 0

VALUE The reason behind the code is one query away — not buried in chat history or a teammate’s memory.

HONESTY why answers only from declared governs: frontmatter — never git, never semantic guessing. It cannot tell you the decision is still correct, only that it governs this path.

why queries decree’s provenance index for every decision whose governs: list covers the path you give it. An exact path match outranks a prefix (directory) match, and results are ordered by status priority, then most recent first. You can scope to a symbol with path#symbol. That’s the whole model: declared scope in, governing decisions out.

Human-readable: the governing decision, its status, and its declared scope.

Terminal window
$ decree why src/auth/tokens.py
src/auth/tokens.py — 1 governing decision
▸ SPEC-00000000000000000000000001 implemented 2026-05-10 exact
JWT token storage
governs: src/auth/tokens.py
→ exit 0

When nothing governs the path, that is a real answer — not a failure. why returns an empty result and exits 0. It will not invent a decision to look helpful.

Terminal window
$ decree why src/auth/charge.py
src/auth/charge.py — no governing decisions
→ exit 0
  • Before editing a file you didn’t write — surface the constraint before you break it.
  • In code review — confirm a diff’s files are governed by the decision the PR claims.
  • When an agent proposes a change — give it the governing decision as context, deterministically.

why is a query, not a gate: it exits exit 0 clean · advisory-only whether or not it finds a governing decision. An empty result is a valid abstention, never an error.

All flags

| Flag | What it does | |------|--------------| | <path> | Repo-relative path to query, optionally path#symbol. | | --json | Emit JSON for programmatic consumers. | | --project PATH | Operate on the project at this path (default: cwd). | | --with-abstention | Route through calibrated retrieval; abstain when confidence is below threshold. | | --target-precision P | Desired precision floor for non-abstain responses. |


Next: intent-check — catch a collision before you write a line.