.claude/settings.json: hook commands break when the checkout path contains a space
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- tooling
Research direction
Open .claude/settings.json and inspect the three hook commands at lines 9, 20, and 30. Quote each $CLAUDE_PROJECT_DIR shell expansion as shown in the issue, then verify the commands work when the checkout path contains spaces. Done means all three hooks can find and run their scripts from such a path.
Written by the indexing model from the issue text.
Description
Package and version
None: repo dev tooling (.claude/settings.json on main, 8e90ba30636745c2b7521c8cf1b7ef8395ab1b60), not a published package
What happened?
The three hook commands in .claude/settings.json pass $CLAUDE_PROJECT_DIR unquoted:
https://github.com/prisma/orm/blob/8e90ba30636745c2b7521c8cf1b7ef8395ab1b60/.claude/settings.json#L9
https://github.com/prisma/orm/blob/8e90ba30636745c2b7521c8cf1b7ef8395ab1b60/.claude/settings.json#L20
https://github.com/prisma/orm/blob/8e90ba30636745c2b7521c8cf1b7ef8395ab1b60/.claude/settings.json#L30
"command": "node $CLAUDE_PROJECT_DIR/.claude/scripts/enforce-tools.mjs"
When the checkout path contains a space (e.g. ~/My Projects/orm, common on macOS and Windows), the shell splits the path and node exits 1 with MODULE_NOT_FOUND. Claude Code treats exit 1 as a non-blocking hook error, so nothing fails loudly. The hooks just stop running:
enforce-tools.mjs: the npm/npx block and the full-test-suite guard are offformat-ts.mjs: edited.tsfiles are not formattedworktree-create.mjs: worktree setup does not run
What did you expect to happen?
The hooks run whatever the checkout path is. The Claude Code hooks docs say: "In shell form, wrap each placeholder in double quotes."
Minimal reproduction
- Clone into a path without a space and ask Claude Code to run
npx --version. The hook blocks it: "Use pnpm, not npx". - Clone into a path with a space (
mkdir "/tmp/my dir" && git clone https://github.com/prisma/orm "/tmp/my dir/orm"), open Claude Code there and repeat.npxruns, and the hook prints a MODULE_NOT_FOUND error.
Environment
Claude Code 2.1.x, Node 22, Linux (also applies to macOS/Windows paths with spaces). No database involved.
Additional context
Suggested fix, applied to all three commands:
"command": "node \"$CLAUDE_PROJECT_DIR\"/.claude/scripts/enforce-tools.mjs"
It's a three-line change. I'm happy to open the PR (with DCO sign-off) if you want it.
- Dominant language
- TypeScript
- Stars
- 47.8k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 227
Getting set up
- Ships a 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 prisma/orm
-
get-platform: distros with ID_LIKE=alpine are not detected as musl, so glibc engines are used on Alpine-based imagesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
prisma/orm#31281 · 1 comment ·
Maintainers usually reply within 1 day
-
adapter-pg: connectToShadowDb connects to the main database when built from a connection stringMay be free again @cestercian claimed this 10 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
prisma/orm#31196 · 1 comment ·
Maintainers usually reply within 1 day
-
[Prisma 8] Type-check time grows exponentially with chained .include() callsPossibly taken @SiKreuz claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
prisma/orm#31161 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
prisma/orm#31125 · 4 comments · 6 reactions ·
Maintainers usually reply within 1 day
-
adapter-better-sqlite3: startTransaction() leaks its mutex when BEGIN throws, every later transaction hangsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
prisma/orm#30881 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tashfeenahmed/freellmapi#2305 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
prime-radiant-inc/evener#8335 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel-labs/ui#1921 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
microsoft/monaco-editor#5626 ·
Maintainers usually reply within 1 day