[BUG] "Yes, and don't ask for again for ..." ineffective for commands containing space

Status Open
Reported on v2.1.218
Maintainer reply None cached
Activity 0 comments · opened Jul 24, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The "Yes, and don't ask for again for ..." option in command approval prompt is not effective for certain commands.

In my case, the original prompt is Can you use "C:\Program Files\Python313\python.exe" to run a basic hello world script. After the approval, the same prompt keeps coming up.

<img width="1162" height="659" alt="Image" src="https://github.com/user-attachments/assets/bd9588f9-251d-4b81-97d1-96e271790ada" />

Root cause appears to be incorrect "allow" rule generated -- see "Additional Information" below

What Should Happen?

The approval request no longer shows up after the initial one.

Error Messages/Logs

Steps to Reproduce

  1. Put an executable in a folder with space. Python/Node.js installed to "Program Files" would be ready to go.
  2. Ask Claude Can you use "C:\Program Files\Python313\python.exe" to run a basic hello world script or similar
  3. Choose "Yes, and don't ask again for: C:\Program Files\Python313\python.exe *"
  4. Ask Claude "try again"

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.218

Platform

AWS Bedrock

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Claude created a settings.local.json with the following "allow" rule:

Bash(C:\\\\Program Files\\\\Python313\\\\python.exe *)

However, Claude suggested modifying it to

Bash(\"C:\\Program Files\\Python313\\python.exe\" *)

which indeed stopped introducing further prompts.

View original on GitHub ↗