日本語

When Claude Code breaks silently on Windows

No error, just a wrong result. Each page takes one symptom you meet when running Claude Code or scripts unattended on Windows: a 30-second check, the cause and the fix. Every one happened on the author's machine.

Claude Code hooks

  1. H01
    A Claude Code PreToolUse hook lets the write through when it times out
  2. H02
    A PowerShell hook called with -Command does not block Claude Code
  3. H03
    No Claude Code hook runs at all (disableAllHooks is still set)

PowerShell, Python, cmd

  1. T01
    PowerShell returns exit code 1 when the script exited with 2
  2. T02
    The second value passed with -File disappears without an error
  3. T03
    With -File, a,b stays one string instead of an array
  4. T04
    Non-ASCII text piped to claude -p, python or git arrives as ?
  5. T05
    Output from python or claude turns into mojibake in a variable
  6. T06
    Python works when run by hand but crashes under Task Scheduler or redirection
  7. T07
    PYTHONIOENCODING is set, but python -I ignores it
  8. T08
    A .ps1 with non-ASCII text fails to parse or prints mojibake
  9. T09
    A .cmd / .bat file runs its comment text as commands
  10. T10
    $variables in a powershell -Command one-liner vanish before it runs
  11. T11
    Get-ChildItem -Include is ignored and every file comes back
  12. T12
    Markdown backticks inside "..." turn into newlines and tabs
  13. T13
    A log that is being written shows 0 bytes
  14. T14
    claude -p --allowedTools swallows the prompt after it

cc-win-kit bundles the parts that avoid these traps from the start: a write guard (with onFailure: block), an unattended runner, a doctor that scans your files and hook settings, CLAUDE.md templates and the full test suite.

cc-win-kit ($19 on Payhip)