mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 20:51:52 +08:00
This threads typed hook settings through runtime config, adds a shell-based hook runner, and executes PreToolUse/PostToolUse around each tool call in the conversation loop. The CLI now rebuilds runtimes with settings-derived hook configuration so user-defined Claude hook commands actually run before and after tools. Constraint: Hook behavior needed to match Claude-style settings.json hooks without broad plugin/MCP parity work in this change Rejected: Delay hook loading to the tool executor layer | would miss denied tool calls and duplicate runtime policy plumbing Confidence: medium Scope-risk: moderate Reversibility: clean Directive: Keep hook execution in the runtime loop so permission decisions and tool results remain wrapped by the same conversation semantics Tested: cargo test; cargo build --release Not-tested: Real user hook scripts outside the test harness; broader plugin/skills parity