Expand description
Inline --settings JSON for gw-spawned Claude sessions, and the entry
builders used by gw setup-claude to register .claude/settings.json hooks.
Hook commands use the bare name gw rather than an absolute path. Claude
Code resolves the command through the user’s PATH, which is what makes
.claude/settings.json portable across machines (Homebrew, cargo, manual
installers, CI) and safe to commit to a repo.
Functions§
- guard_
settings_ json - Build the
--settingsJSON payload that registersgw guardas a PreToolUse(Bash) hook. - pre_
tool_ use_ bash_ entry - One PreToolUse(Bash) hook entry — used by both
--settingsinline injection andsetup-claude’s.claude/settings.jsonmerge. - worktree_
create_ entry - One WorktreeCreate hook entry (no matcher — Claude Code does not support matchers for worktree lifecycle events).
- worktree_
remove_ entry - One WorktreeRemove hook entry (no matcher — Claude Code does not support matchers for worktree lifecycle events).