Skip to content

Stop hook timeout does not kill child process tree #24206

Closed as not planned
Closed as not planned

Description

@GuillaumeBeylouneh

Bug description

When a Stop hook spawns a child process (e.g., Start-Process in PowerShell), Claude Code waits for the entire process tree to finish, ignoring the configured timeout value.

Reproduction steps

  1. Configure a Stop hook in ~/.claude/settings.json:
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "powershell -ExecutionPolicy Bypass -File \"some-script.ps1\"",
            "timeout": 15
          }
        ]
      }
    ]
  }
}
  1. The script spawns a child process (e.g., calling claude -p --model haiku for session summarization):
Start-Process -FilePath "powershell" -ArgumentList $args -NoNewWindow
  1. End a Claude Code session (Ctrl+C or /exit)

Expected behavior

Claude Code should respect the timeout value (15s in this case), kill the hook process and its children, then exit cleanly.

Actual behavior

Claude Code hangs for 15+ minutes after the session ends, waiting for the child process (claude -p --model haiku) to complete. The timeout appears to have no effect on the child process tree.

Workaround

Use -WindowStyle Hidden instead of -NoNewWindow in the hook script to detach child processes from the parent's process tree. This way the hook script exits immediately and Claude Code doesn't wait.

Environment

  • OS: Windows 11
  • Shell: PowerShell
  • Claude Code: latest (as of Feb 2026)

Activity

  1. added
    bug
    has repro
    platform:windows
    on Feb 8, 2026
  2. added
    stale
    on Feb 22, 2026
  3. github-actions commented on Mar 9, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  4. github-actions commented on Mar 18, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  5. locked as resolved and limited conversation to collaborators on Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebughas reproplatform:windowsstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions