Bash tool: rejected/cancelled commands still execute (process already started)

Resolved 💬 2 comments Opened Mar 9, 2026 by Alfirine Closed Apr 6, 2026

Description

When Claude calls the Bash tool, the command begins executing immediately. If the user then rejects/cancels the tool call in the UI, the underlying process has already started and continues running. There is no mechanism to kill it.

This is dangerous for commands with immediate irreversible side effects.

Reproduction

  1. Have Claude call Bash with a command that has immediate side effects (e.g., pkill some-process)
  2. When the permission prompt appears, click "Reject" or interrupt
  3. The process has already executed — some-process is already dead

Real-world impact

A script that kills a VPN client (Throne/sing-box) was called via Bash tool. The user rejected it in the UI, but pkill had already executed. The VPN tunnel died, breaking Claude's own connection to the remote server. The user had to manually restore connectivity.

Expected behavior

Either:

  • Option A: Do not start process execution until the user explicitly approves (for commands not in the auto-allow list)
  • Option B: If the process starts immediately, kill it (SIGTERM → SIGKILL) when the user rejects/cancels

Environment

  • Claude Code version: latest (npm)
  • OS: Ubuntu 25.10
  • Shell: bash

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗