dotfiles-agentsRepository
On this page

Decision 025 · Hooks as script + config, never inline

A hook is a directory (config + event-named script), never a raw command string in settings.json.

Context

Claude Code accepts hooks two ways: inline command strings in .claude/settings.json, or script files referenced by config. Inline hooks are undiffable against the packaged hook set, unreviewable in isolation, invisible to the naming lint, and impossible to distribute through the translation service (which ships hook files to claude-code targets).

Decision

Hooks are packaged as script + config: an event-named script file (<plugin>.<Event>.<slug>.sh, stdlib-only per gate H4) plus the JSON config that wires it. settings.json may only reference hook scripts, never carry inline command strings.

Consequences

Affects

primitives-core/hooks/ packaging · repo-meta-structure references/checklist.md HOOK-01 (the check that cites this ADR) · workbench scripts/promote_check.py H2/H4 · docs/naming.md hook grammar.