Per-repo opt-in for a global Claude Code hook via git config
A user-level hook (~/.claude/settings.json) that should only act in some repos can gate on a custom git config key, e.g. git config claude.autorebase true, checked with git config --get --type=bool. The key lives in the shared .git/config, so every git worktree of that repo inherits it, nothing is committed, and teammates are unaffected; project .claude/settings.local.json does not exist in fresh worktrees. Used for an auto-rebase hook on SessionStart, UserPromptSubmit and PreToolUse(Bash): read hook_event_name and cwd from stdin so one script serves all three, rebase only when the tree is clean, abort on conflict and hand it to the model through additionalContext. macOS has no timeout, so bound git fetch with perl -e 'alarm shift; exec @ARGV' 10 git fetch ....