fix: Claude Code hook commands break when the global hook path contains whitespace
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with claudeHookCommand in internal/agents/claude.go (around lines 244-249), then compare it with the single-quoted form in internal/agents/codex_pretooluse.go (lines 57-66) and the hook setup in internal/agents/claude_pretooluse.go (lines 44-49). Reproduce with HOME set to a path containing a space and run codegraph install --target claude --location global. Done when the global hook command is quoted, an existing unquoted entry is replaced rather than duplicated on install and upgrade, and tests cover a path with a space.
Written by the indexing model from the issue text.
Description
What happens
For a global install, codegraph install registers Claude Code's SessionStart and PreToolUse hook commands as unquoted absolute paths. If $HOME contains whitespace, the shell splits the path before the guard runs, and Claude Code shows a hook error. Codex's command is single-quoted (shellSingleQuote), so it does not have this problem.
What you expected instead
The hook command is quoted (or uses exec form). An existing unquoted entry is recognised as codegraph's and replaced, not duplicated.
Steps to reproduce
With HOME="/tmp/a b", run codegraph install --target claude --location global, then start a Claude Code session.
Version
main at d384473e
Platform
any
How did you install it?
Built from source
Evidence
internal/agents/claude.go:244-249(claudeHookCommand)internal/agents/claude_pretooluse.go:44-49internal/agents/codex_pretooluse.go:57-66(the quoted form)
Acceptance criteria
- Global hook commands are quoted; local
${CLAUDE_PROJECT_DIR}commands are checked as well. -
installandupgradereplace a pre-existing unquoted entry; tests cover a path containing a space.
Source (GSD planning files, archived at d384473e): .planning/milestones/v0.14.0-MILESTONE-AUDIT.md (AR-06-08); .planning/STATE.md Blockers/Concerns (Phase 6)
🤖 Generated with Claude Code
- Dominant language
- Go
- Stars
- 0
- Forks
- 0
- Avg merge
- 5h 16m
- Merged PRs (30d)
- 107
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from seanb4t/codegraph-go
-
area:indexer bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seanb4t/codegraph-go#385 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
seanb4t/codegraph-go#380 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seanb4t/codegraph-go#379 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
seanb4t/codegraph-go#362 ·
Maintainers usually reply within 1 day
-
area:query bug priority:low spec-needed
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
seanb4t/codegraph-go#355 ·
Maintainers usually reply within 1 day
All issues in seanb4t/codegraph-go
Similar issues
-
enhancement exporter/awskinesis needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
open-telemetry/opentelemetry-collector-contrib#53334 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
erigontech/erigon#26523 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
SocialGouv/iterion#3376 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
seaweedfs/seaweedfs#12740 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day