-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.example.yaml
More file actions
25 lines (25 loc) · 1.1 KB
/
Copy pathhooks.example.yaml
File metadata and controls
25 lines (25 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copy to ~/.leveler/hooks.yaml and/or <repo>/.leveler/hooks.yaml
# Both files are loaded when present; project hooks run after global hooks.
#
# TRUST: the global file is yours and always loads. The in-repo file travels
# with a clone and runs commands before every tool call, so it is IGNORED until
# you run `leveler trust` in that repository. Trust is keyed to the file's
# contents — edit it and you must trust it again. `leveler trust show` reports
# the current state.
#
# PreToolUse (pre_tool_use):
# exit 0 → allow
# exit 2 → hard deny (tool blocked)
# any other non-zero / spawn error → also deny
#
# PostToolUse (post_tool_use): observational only; failures are ignored.
# On tool failure the phase env is post_tool_use_error instead of post_tool_use.
#
# Env injected into every hook process:
# LEVELER_HOOK — phase name (pre_tool_use | post_tool_use | post_tool_use_error)
# LEVELER_TOOL — tool name
# LEVELER_TOOL_ARGS_JSON — tool args JSON (may be truncated)
hooks:
pre_tool_use: []
# - command: ["python3", ".leveler/hooks/pre.py"]
post_tool_use: []