Skip to content

fix(hooks): remove single quotes from command paths for Windows compatibility - #659

Closed
mvanhorn wants to merge 1 commit into
obra:mainfrom
mvanhorn:osc/644-fix-windows-hook-single-quotes
Closed

mvanhorn wants to merge 1 commit into
obra:mainfrom
mvanhorn:osc/644-fix-windows-hook-single-quotes

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces single quotes with double quotes in hook command paths in hooks/hooks.json
  • On Windows, cmd.exe interprets 'C: as the command name instead of recognizing single quotes as path delimiters
  • Double quotes are used (not bare paths) to handle spaces in paths like C:\Program Files\...
  • The fix works on both Windows (cmd.exe) and Unix (bash)

Fixes #644

This contribution was developed with AI assistance (Claude Code).

… for Windows compatibility

On Windows, cmd.exe doesn't recognize single quotes as path
delimiters, causing the SessionStart hook to fail with "'C:' is not
recognized". Double quotes are used instead to preserve space handling
in paths like C:\Program Files\...

Fixes obra#644

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@coderabbitai

coderabbitai Bot commented Mar 9, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fe456f7b-6cfc-4ccb-9422-c2654dac16c5

📥 Commits

Reviewing files that changed from the base of the PR and between e4a2375 and 08b73d5.

📒 Files selected for processing (1)
  • hooks/hooks.json

📝 Walkthrough

Walkthrough

The SessionStart hook command in hooks.json was modified to use escaped double quotes instead of single quotes around the script path, resolving Windows compatibility issues where cmd.exe does not recognize single quotes as path delimiters.

Changes

Cohort / File(s) Summary
Hook Configuration
hooks/hooks.json
Changed command quoting from single quotes to escaped double quotes around the ${CLAUDE_PLUGIN_ROOT} path to enable proper command execution on Windows systems.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 A rabbit hops through Windows paths,
Where single quotes caused wrath,
Double quotes, escaped and true,
Make cmd.exe sing "I do!"
Hooks now flow without a fight—
Windows dreams are finally bright! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing single quotes with double quotes in command paths for Windows compatibility.
Description check ✅ Passed The description clearly explains the problem, solution, and cross-platform compatibility, directly relating to the changeset.
Linked Issues check ✅ Passed The PR directly addresses issue #644 by fixing the Windows compatibility issue with single quotes in hooks.json command paths.
Out of Scope Changes check ✅ Passed The changes are limited to hooks.json and directly address the scope of issue #644 with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@obra

obra commented Mar 10, 2026

Copy link
Copy Markdown
Owner

Closing in favor of #585 which was merged — same fix (single quotes → escaped double quotes in hooks.json). Thanks for the contribution!

— Claude Opus 4.6, Claude Code 2.1.72

@obra obra closed this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SessionStart hook fails on Windows due to single quotes in command path

2 participants