Hooks for Enforcement
Hooks enforce the "log before you code" rule by checking for decision graph activity before allowing commits.
The decision graph works best when it is populated in real time—before and during implementation, not after. Hooks turn this best practice into a hard requirement by integrating with git's pre-commit mechanism.
Configuration
Hooks are configured in .deciduous/config.toml. The hooks section defines what checks run before a commit is allowed:
The most common configuration requires an active goal and recent deciduous activity. This catches the case where a developer starts coding without first creating a goal node. The skip_branches setting exempts main/master, where merge commits should not be blocked.
Installing Hooks
The deciduous hooks install command generates git hook scripts and places them in .git/hooks/:
The generated hook script calls deciduous to check the configured conditions. If any check fails, the commit is blocked with a message explaining what is needed.
What a Blocked Commit Looks Like
When you try to commit without meeting the hook requirements:
The error message is actionable—it tells you exactly what commands to run. After creating the goal and action nodes, the commit will succeed:
Checking Hook Status
See what hooks are currently installed and their configuration:
Uninstalling Hooks
Remove the deciduous hooks without affecting other git hooks:
When to Use Hooks
| Situation | Recommendation |
|---|---|
| Solo developer, AI assistant handles logging | Hooks are optional—the assistant follows CLAUDE.md rules |
| Team where some members forget to log | Enable require_active_goal |
| Strict traceability requirements | Enable all checks including require_commit_link |
| Quick prototyping or spike work | Disable hooks or use skip_branches for spike branches |
Git hooks are not committed to the repository (they live in .git/hooks/, which is not tracked). Each developer must run deciduous hooks install on their own machine. The configuration in .deciduous/config.toml is committed, so the hook behavior is consistent once installed.