All symptoms日本語

H03

No Claude Code hook runs at all (disableAllHooks is still set)

Symptom

Your write guard, your notification hook, nothing runs. No error, no warning. A setting you added to pause hooks for a moment may still be there.

Check it in 30 seconds

Paste into Windows PowerShell 5.1. It only creates files under your %TEMP% folder. If the last line says REPRODUCED, it happens on your machine. It calls claude once, so it takes about a minute.

$d = Join-Path $env:TEMP ('cc-trap-' + (Get-Date -Format 'yyyyMMddHHmmss')); New-Item -ItemType Directory $d -Force | Out-Null
foreach ($f in @("$env:USERPROFILE\.claude\settings.json", "$PWD\.claude\settings.json", "$PWD\.claude\settings.local.json")) {
  if (Test-Path -LiteralPath $f) { try { $v = (Get-Content -LiteralPath $f -Raw -Encoding UTF8 | ConvertFrom-Json).disableAllHooks; "your settings: $f -> disableAllHooks=$v" } catch { "your settings: $f -> not valid JSON" } }
}
[IO.File]::WriteAllText("$d\deny.ps1", '[IO.File]::WriteAllText(''MARK'', ''x''); [Console]::Error.WriteLine("denied"); exit 2'.Replace('MARK', "$d\called.txt"))
$hook = 'powershell -NoProfile -ExecutionPolicy Bypass -File \"' + ($d -replace '\\', '/') + '/deny.ps1\"'
[IO.File]::WriteAllText("$d\s.json", '{"disableAllHooks":true,"hooks":{"PreToolUse":[{"matcher":"Write|Edit","hooks":[{"type":"command","command":"HOOK","onFailure":"block"}]}]}}'.Replace('HOOK', $hook))
Push-Location $d
'Use the Write tool once to create the file written.txt with the content hi. Do not retry if it is blocked.' | claude -p --settings s.json --permission-mode acceptEdits | Out-Null
Pop-Location
$w = Test-Path "$d\written.txt"; $c = Test-Path "$d\called.txt"
"deny hook with onFailure block, plus disableAllHooks true: hook called=$c, written=$w"
if ((-not $c) -and $w) { 'REPRODUCED' } else { 'NOT REPRODUCED' }

Why it happens

With "disableAllHooks": true in a settings file, Claude Code runs none of the hooks that file reaches (managed-policy hooks excepted). The value follows settings precedence: true in your user settings (~/.claude/settings.json) is overridden by false in the project's settings. A guard with onFailure: "block" does not help, because it is never called.

Fix

Remove the line (or set it to false). The first lines of the check print the value in each of your settings files. To skip hooks for a single run, pass it on the command line with --settings instead of writing it to a file.

claude -p --settings '{"disableAllHooks": true}'   # skips hooks for this run only; nothing is saved

On the author's machine

a denying hook with onFailure: block, together with disableAllHooks: true, was never called and the file was written

Author's machine: Windows 11 / Windows PowerShell 5.1.26100 / Python 3.13.7 / Claude Code 2.1.304, Japanese Windows (code page 932). Checked 2026-10-20 to 22.

If you searched for

Related

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)

Other symptoms