fix: wrap hook commands in bash -c for paths with spaces - #15
Merged
Conversation
Problem: Claude Code hooks fail when $CLAUDE_PROJECT_DIR contains spaces (e.g., "Groove Jones Dropbox"). The shell splits the path on spaces even when quoted in settings.json. Solution: Wrap all commands using $CLAUDE_PROJECT_DIR in bash -c '...' so bash handles variable expansion with proper quoting. Changes: - Wrapped 25 hooks using $CLAUDE_PROJECT_DIR with bash -c - Preserved all timeout values - Left $HOME hooks unchanged (no spaces in home paths) Pattern applied: Before: python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/script.py" After: bash -c 'python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/script.py"'
Lisztos
force-pushed
the
fix/hooks-path-spaces-clean
branch
from
March 25, 2026 15:30
3f60223 to
5002a9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ported from parcadei/Continuous-Claude-v3#47 by @carmandale
Summary
Wraps all 25 hooks using
$CLAUDE_PROJECT_DIRinbash -c '...'to handle paths containing spaces. Fixes hook failures when project path contains spaces.Problem
When
$CLAUDE_PROJECT_DIRcontains spaces, hooks fail because Claude Code strips quotes before shell execution, causing word splitting.Solution
Test plan