The hooks for this plugin use Claude Code's native hook system (shell commands in settings.json), not YAML files.
Run the install script which will merge hooks into your settings:
curl -sL https://raw.githubusercontent.com/j-morgan6/elixir-phoenix-guide/main/install.sh | bash- Copy the hooks configuration:
cat hooks-settings.json-
Merge it into your
~/.claude/settings.jsonor.claude/settings.json -
If you already have hooks, merge the
PreToolUsearrays together
-
Missing @impl true - Blocks callback functions without
@impl trueannotation- Catches:
def mount(,def handle_event(, etc. - Message: "Missing @impl true before callback function"
- Catches:
-
Hardcoded file paths - Blocks hardcoded paths like
/uploads/orpriv/static/- Message: "Use Application.get_env(:app, :config_key) instead"
-
Hardcoded file sizes - Blocks hardcoded large numbers (file size limits)
- Message: "Move to Application config"
-
Nested if/else - Warns about nested conditionals
- Message: "Consider using pattern matching or case statements"
-
Inefficient Enum chains - Warns about multiple Enum.map/filter
- Message: "Consider using a for comprehension"
-
String concatenation in loops - Warns about
<>in Enum operations- Message: "Consider using IO lists or Enum.join"
Create a file with anti-patterns:
# Should block (missing @impl)
def handle_event("save", params, socket) do
# Should block (hardcoded path)
path = "/uploads/images"
# Should block (hardcoded size)
max_size = 10000000
# Should warn (nested if)
if user do
if admin do
:ok
end
end
{:noreply, socket}
endThe hooks should fire on Write or Edit operations.
Remove the hooks section from your ~/.claude/settings.json or .claude/settings.json.
Claude Code hooks run shell commands when tools are used:
- PreToolUse: Before Write, Edit, Bash, etc.
- PostToolUse: After tool completes
- exit 0: Allow the action
- exit 1: Warning (shows message, allows action)
- exit 2: Block (shows message, prevents action)
Environment variables available:
$CLAUDE_HOOK_FILE_PATH: File being edited/written$CLAUDE_HOOK_TOOL_NAME: Tool being used (Write, Edit, etc.)