Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
non-existent `~/.claude/hooks/ck/` directory after the `ck` -> `specwright` rename.
- `/sd:setup` Phase 7 (and Phase 1.5) now verify every hook `command` path in
`.claude/settings.json` resolves to a file on disk, warning loudly when a hook is not firing.
- `hooks/powershell/subagent-retro.ps1`, `prompt-router.ps1`, and `spec-gate.ps1` no longer assign
parsed hook JSON to `$input` - PowerShell's reserved automatic pipeline variable. Assigning to it
threw a non-terminating `ParameterBindingException` on every real (piped/redirected) stdin
invocation, leaving it unbound and causing every PowerShell hook to exit silently before reading
any input. Renamed to `$hookInput` in all three files.

---

Expand Down
8 changes: 4 additions & 4 deletions hooks/powershell/prompt-router.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ function Get-InProgressSpecs {

# ---- main ----

$input = Read-StdinJson
if ($null -eq $input) { exit 0 }
$hookInput = Read-StdinJson
if ($null -eq $hookInput) { exit 0 }

$prompt = $input.prompt
$cwd = $input.cwd
$prompt = $hookInput.prompt
$cwd = $hookInput.cwd
if ([string]::IsNullOrWhiteSpace($prompt) -or [string]::IsNullOrWhiteSpace($cwd)) { exit 0 }
if (-not (Test-Path -LiteralPath $cwd)) { exit 0 }

Expand Down
10 changes: 5 additions & 5 deletions hooks/powershell/spec-gate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ function Write-BlockDecision {

# ---- main ----

$input = Read-StdinJson
if ($null -eq $input) { exit 0 }
$hookInput = Read-StdinJson
if ($null -eq $hookInput) { exit 0 }

$toolName = $input.tool_name
$toolName = $hookInput.tool_name
if ($toolName -ne 'Edit' -and $toolName -ne 'Write' -and $toolName -ne 'MultiEdit') { exit 0 }

$cwd = $input.cwd
$cwd = $hookInput.cwd
if ([string]::IsNullOrWhiteSpace($cwd)) { $cwd = (Get-Location).Path }

$config = Get-ProjectConfig -Cwd $cwd
Expand All @@ -188,7 +188,7 @@ $mode = 'warn'
try { if ($config.hooks.specGate.mode) { $mode = [string]$config.hooks.specGate.mode } } catch { }
if ($mode -eq 'off') { exit 0 }

$filePath = $input.tool_input.file_path
$filePath = $hookInput.tool_input.file_path
if ([string]::IsNullOrWhiteSpace($filePath)) { exit 0 }

$rel = ConvertTo-RelativePath -Cwd $cwd -FilePath $filePath
Expand Down
8 changes: 4 additions & 4 deletions hooks/powershell/subagent-retro.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ function Remove-StaleStateFiles {

# ---- main ----

$input = Read-StdinJson
if ($null -eq $input) { exit 0 }
$hookInput = Read-StdinJson
if ($null -eq $hookInput) { exit 0 }

$cwd = $input.cwd
$cwd = $hookInput.cwd
if ([string]::IsNullOrWhiteSpace($cwd)) { $cwd = (Get-Location).Path }
if (-not (Test-Path -LiteralPath $cwd)) { exit 0 }

$sessionId = $input.session_id
$sessionId = $hookInput.session_id
if ([string]::IsNullOrWhiteSpace($sessionId)) { $sessionId = 'no-session' }

$config = Get-ProjectConfig -Cwd $cwd
Expand Down
Loading