Files
ccpm-claude-code-pm/.claude/settings.json.example
J. Kirby Ross 3f3c19c232 fix: improve bash worktree hook robustness and documentation
- Fix critical bugs in worktree detection and command parsing:
  * Distinguish between git worktrees and submodules (check for /worktrees/ in gitdir path)
  * Fix TAB pattern bug using proper tokenization instead of brittle globbing
  * Fix overly broad dot-prefix skip that broke ./script.sh execution
  * Add proper path quoting to handle spaces and special characters
  * Capture all arguments with $* instead of just $1

- Improve documentation:
  * Remove personal paths from examples
  * Restructure troubleshooting steps for clarity
  * Switch from jq to python -m json.tool for wider compatibility
  * Clarify that hook config goes in main .claude/settings.json

- Simplify configuration:
  * Remove redundant config.json
  * Add settings.json.example showing proper integration
  * Fix background process detection for both "cmd &" and "cmd&" patterns

These changes prevent false positives on commands like "cdbuild", ensure
relative scripts work in worktrees, and handle paths with spaces correctly.
2025-08-21 07:28:09 -07:00

12 lines
287 B
JSON

{
"hooks": {
"pre-tool-use": {
"Bash": {
"enabled": true,
"script": ".claude/hooks/bash-worktree-fix.sh",
"description": "Automatically prepends worktree path to Bash commands when in a worktree",
"apply_to_subagents": true
}
}
}
}