Skip to main content

write_hook_config

Function write_hook_config 

Source
pub fn write_hook_config(worktree: &Path, apm_bin: &str) -> Result<()>
Expand description

Write a PreToolUse hook entry to <worktree>/.claude/settings.json that intercepts Edit, Write, and Bash tool calls by running apm path-guard.

The function is idempotent: if an entry with the same command already exists, it is not duplicated.