Commit Graph

1 Commits

  • fix: resolve Claude Code Bash hook "cannot execute binary file" on Windows
    Root cause in ~/.claude/settings.local.json (user-global):
    1. UTF-8 BOM + CRLF line endings left by patch_settings_cl_v2_simple.ps1
    2. Double-wrapped command "\"bash.exe\" \"wrapper.sh\"" broke Windows
       argument splitting on the space in "Program Files", making bash.exe
       try to execute itself as a script.
    
    Fix:
    - Rewrite settings.local.json as UTF-8 (no BOM), LF, with the hook command
      pointing directly at observe-wrapper.sh and passing "pre"/"post" as a
      positional arg so HOOK_PHASE is populated correctly in observe.sh.
    
    Docs:
    - docs/fixes/HOOK-FIX-20260421.md — full root-cause analysis.
    - docs/fixes/apply-hook-fix.sh — idempotent applier script.