[BUG] Search/Grep permissions in settings.json not being respected

Status Closed — not planned
Maintainer reply None cached
Activity 6 comments · opened Jan 10, 2026 · closed Feb 28, 2026

Description

Search/Grep permission rules in ~/.claude/settings.json are not being respected. Despite having multiple permission patterns configured, Claude Code still prompts for permission when using the Grep tool on directories covered by these rules.

Steps to Reproduce

  1. Add Search/Grep permissions to ~/.claude/settings.json:
{
  "permissions": {
    "allow": [
      "Grep(*)",
      "Grep(**)",
      "Grep(~/Projects/myproject/**)",
      "Search(~/Projects/myproject/**)",
      "Search(~/Projects/myproject)",
      "Search(*)",
      "Search(**)"
    ]
  }
}
  1. Restart Claude Code
  2. Ask Claude to search for a pattern in ~/Projects/myproject
  3. Claude Code still prompts for permission:
Read file

  Search(pattern: "foo", path: "~/Projects/myproject")

 Do you want to proceed?

Expected Behavior

The Grep operation should proceed without prompting since the path is covered by multiple permission rules.

Actual Behavior

Permission prompt appears despite matching rules being configured.

Environment

  • Platform: macOS (Darwin 24.6.0)
  • Settings location: ~/.claude/settings.json

Notes

  • Tried both Search(...) and Grep(...) permission formats
  • Tried with and without ** glob patterns
  • Tried both ~/ home-relative paths and absolute paths
  • Other permissions in the same file (like Read, Bash) work correctly

View original on GitHub ↗

6 Comments

github-actions[bot] · 9 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5140
  2. https://github.com/anthropics/claude-code/issues/6881
  3. https://github.com/anthropics/claude-code/issues/17213

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

travispulley · 8 months ago

I've said "yes" to allowing grep in places I've already granted read access to so many times this month!

mrclrchtr · 8 months ago
"allow": [
   "Search"
]

~~helped me~~

Edit:

Nop, I was wrong

github-actions[bot] · 7 months ago

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

mrclrchtr · 7 months ago

@claude Why is it closed? It still happens.

Especially because other tickets were closed as duplicates because of this one!

github-actions[bot] · 7 months ago

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.