Skip to main content
Coding AIs start building the moment you ask. This hook makes your AI decide first: until it has finished a Trillion decision in the current turn, it cannot edit a file inside a code project or save work with git commit. A reminder to decide first gets skipped; a refusal at the moment of the change holds every time.

What counts as deciding

  • A call to decide that comes back with a decision (the option chosen, the reason, the next step and how success will be measured), or
  • A call to export_decision on a case that is already decided, whose answer shows Status: Decided and a Decision section.
Opening a decision with start_decision or answering its questions does not count: those only work the method. A “turn” is everything since your last message, so each new request needs its own decision or an export of one already made. When a change is refused, your AI sees this message and can carry on by deciding:
Deciding never needs a file change, so a refused AI can always decide and continue.

What it checks and what it leaves alone

A helper AI started by your AI (a subagent) is judged by its own conversation, so it needs its own decision.

Install

Add this to hooks.PreToolUse in ~/.claude/settings.json:

Change what it checks

Everything the hook looks for lives in decide-before-building.json: which tools change files, which calls count as deciding, and which folders are free. To let your AI change files somewhere without deciding, add that folder to free_folders. To cover a new AI app’s file tool, add its name to file_tools.
Last modified on October 1, 2026