pub struct HookSpec {
pub event: String,
pub matcher: Option<String>,
pub command: PathBuf,
}Expand description
One per-agent Claude Code hook declared in compose (#383 Phase 2).
Maps onto Claude Code’s settings.json hook shape: an event bucket
(PreToolUse, PostToolUse, Stop, …) holding entries of
{ matcher, hooks: [{ type: "command", command }] }. teamctl does not
enumerate the runtime’s event names — event is passed through
verbatim so a new Claude Code event works without a teamctl release.
Fields§
§event: StringClaude Code hook event the command fires on, e.g. PreToolUse.
matcher: Option<String>Optional tool-name regex (Bash, Edit|Write). Omitted → the
hook matches every tool for the event, matching Claude Code’s own
behavior when matcher is absent.
command: PathBufCompose-root-relative path to the hook command, resolved the same
way as role_prompt: roles/x.md and rendered into the settings
file as an absolute path. v1 is a single executable path (no
inline args) — matching the issue’s command: hooks/guard.sh
shape.