[BUG] Permission prompts repeatedly triggered for paths containing spaces (iCloud "Mobile Documents")

Resolved 💬 7 comments Opened Mar 9, 2026 by hihiboss Closed Apr 15, 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?

When working in a directory whose path contains spaces — specifically iCloud paths like /Users/<user>/Library/Mobile Documents/com~apple~CloudDocs/... — the permission matching logic appears to treat the space as a token separator rather than part of the path.

  • Even after pre-granting permissions in settings.json, paths with spaces fail to match, causing permission prompts to reappear every time.
  • When an Explore subagent scans project files, it triggers an individual permission prompt for every single file/folder, making the tool practically unusable.
  • Already-allowed bash commands like cd /Users/myname/Library/Mobile Documents/My-Work/ are re-prompted for permission due to the space.

What Should Happen?

Paths containing spaces should be properly matched in the permission system. Once a path is allowed (via "Always allow" or settings.json), it should not prompt again regardless of whether the path contains spaces.

Error Messages/Logs

_No specific error messages — the issue manifests as repeated permission prompts._

Steps to Reproduce

  1. Place a project inside an iCloud Drive subfolder (path will contain Mobile Documents)
  • Example: /Users/myname/Library/Mobile Documents/com~apple~CloudDocs/my-project
  1. Launch claude from that directory
  2. Perform an action that triggers a permission prompt (e.g., read or write a file)
  3. Select "Always allow"
  4. Perform the same type of action on a different file → permission is prompted again
  5. Launch an Explore subagent to scan the project → every file/folder triggers an individual permission prompt

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.71 (Claude Code)

Platform

Other

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • Terminal: cmux (Ghostty)
  • Platform detail: Claude Max subscription (not using API directly)
  • Related closed issues: #1726 (bash path escaping with iCloud), #24865 (permission scope with spaces) — similar problems were reported but the root cause appears unresolved.
  • Root cause hypothesis: the permission pattern matching logic does not properly handle spaces in file paths (missing quoting/escaping).
  • The iCloud path ~/Library/Mobile Documents/com~apple~CloudDocs/ is set by macOS and cannot be changed by the user.
  • Setting allow rules in settings.json also fails to match paths containing spaces.

View original on GitHub ↗

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