claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude code keeps asking for permission despite already having it.

Open suvodeep-pyne opened this issue 6 months ago • 2 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [X ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.34 (Claude Code)
  • Operating System: 14.7.6 (23H626)
  • Terminal: Terminal App

Bug Description

Despite claude having access to find command, it will continously ask for permission. Happens the same with grep and a bunch of other tools.

{
  "permissions": {
    "allow": [
      ...
      "Bash(find:*)",
...
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command                                                                                                                                   │
│                                                                                                                                                │
│   find /Users/spyne/repo/pinot -name "*.java" -exec grep -l "CONFIG_OF_ZOOKEEEPER_SERVER\|CONFIG_OF_CONTROLLER_PORT" {} \;                     │
│   Find files that contain these constants                                                                                                      │
│                                                                                                                                                │
│ Do you want to proceed?                                                                                                                        │
│ ❯ 1. Yes                                                                                                                                       │
│   2. Yes, and don't ask again for similar commands in /Users/spyne/repo/startree-pinot                                                         │
│   3. No, and tell Claude what to do differently (esc)            

Steps to Reproduce

  1. Jusk ask to build something.

Expected Behavior

It should continue given that it has the permissions

Actual Behavior

It stops and waits for user input

Additional Context

Using Claude 4 sonnet using Bedrock APIs

suvodeep-pyne avatar Jun 24 '25 23:06 suvodeep-pyne

Same here, for almost any command

fellnerse avatar Jun 25 '25 06:06 fellnerse

If Claude Code has a way to do something without asking permission, it will find another way so as to require permission.

There must be a "productivity" setting set really low by default somewhere...

chadananda avatar Jun 29 '25 14:06 chadananda

This is constantly happening to me with grep and rg commands. It is very annoying. I have multiple claude.json files set up to allow them but it still asks me to approve them manually, like every 15 seconds.

keithslater avatar Jul 03 '25 02:07 keithslater

I have Bash(find:*) and it's constantly asking me for permission.

ChadMoran avatar Jul 03 '25 04:07 ChadMoran

Yep, "Yes, and don't ask again for similar commands..." doesn't actually take effect.

macdonjo avatar Jul 05 '25 07:07 macdonjo

You can use: claude --dangerously-skip-permissions to byass this.

macdonjo avatar Jul 06 '25 16:07 macdonjo

You can use: claude --dangerously-skip-permissions to byass this.

I'm using this all the time, does not work for me.

fellnerse avatar Jul 07 '25 07:07 fellnerse

I tell it to be --dangerously-skip-permissions and then it becomes the head of HR/Legal like, do we really even know you? Lol

iocframework-darren avatar Jul 07 '25 20:07 iocframework-darren

I agree, I have not found any good way to make it respect any kind of globbing in permissions. When it's running unit tests I have to give it permission CONSTANTLY. It seems to find new and ever more creative ways to invoke a unit test that require new permissions.

shopsinc avatar Jul 09 '25 17:07 shopsinc

I'm also running into this issue, and it's incredibly painful. I've tried every combination of allows in settings.local.json but nothing is working.

elliot-graebert-skydio avatar Jul 11 '25 20:07 elliot-graebert-skydio

facing the same issue. It breaks any automated workflow

itinance avatar Jul 13 '25 12:07 itinance

+1'ing this, there doesn't seem to be a way to bypass it

tituspeterson avatar Jul 15 '25 00:07 tituspeterson

3 weeks since this and no evidence that anyone is even working it. Is Anthropic even using this tool themselves?

tennyson-mccalla avatar Jul 15 '25 17:07 tennyson-mccalla

Since the parents @bcherny and kat left, could be some orphan time.

I am working around this in 3 ways:

  • "# Prefer internal tools vs command line commands like find and grep" - reduces some permission noise
  • Using dev containers to run with --dangerously-skip-permissions - https://docs.anthropic.com/en/docs/claude-code/devcontainer
  • Lastly, cc introduced hooks ❤️ - https://docs.anthropic.com/en/docs/claude-code/hooks if you want to code up your own security management/audit tool

Take help of cc to set up the last 2 :)

suvodeep-pyne avatar Jul 15 '25 18:07 suvodeep-pyne

Same here, very annoying and reduce productivity.

Please priority this.

malikdavid87 avatar Jul 22 '25 06:07 malikdavid87

Hi, thanks for reporting this. I spent some time looking at this issue today. The permission system seems to be working correctly on my setup, so I need more details to repro it.

How permissions work today

  • Permission rules like Bash(find:*) use prefix matching
  • Complex commands are split in some cases and each part is checked separately for better security
  • Commands with potential injection patterns may trigger permission prompts even if prefix is allowed

Please provide:

  1. Your exact settings.json permissions config
  2. Specific user prompt that being used
  3. Specific command being issued by Claude Code that required a permission prompt

kushal-thakkar avatar Jul 27 '25 00:07 kushal-thakkar

Hi @kushal-thakkar

Thanks for sharing. I think some of the major bugs has been addressed already. This was reported a month back. 1 request is to please review the information shared in the issue above before responding.

Thank you to you and your team for building this amazing tool! 🙏

suvodeep-pyne avatar Jul 30 '25 17:07 suvodeep-pyne

Hi, thanks for reporting this. I spent some time looking at this issue today. The permission system seems to be working correctly on my setup, so I need more details to repro it.

How permissions work today

  • Permission rules like Bash(find:*) use prefix matching
  • Complex commands are split in some cases and each part is checked separately for better security
  • Commands with potential injection patterns may trigger permission prompts even if prefix is allowed

Please provide:

  1. Your exact settings.json permissions config
  2. Specific user prompt that being used
  3. Specific command being issued by Claude Code that required a permission prompt

I'm not sure if your 3rd point is causing it, but here is an example:

I have this set in the project .claude/settings.local.json and ~/.claude.json

{
  "permissions": {
    "allow": [
      "Bash(find:*)",
      "Bash(ls:*)",
      "Bash(grep:*)",
      "Bash(npm install:*)",
      "Bash(npm test:*)",
      "Bash(node:*)",
      "Bash(npm run lint)",
      "Bash(npm run build:*)",
      "Bash(mkdir:*)",
      "Bash(npx tsc:*)",
      "Bash(npx jest:*)",
      "Bash(rg:*)",
      "Bash(npm run lint:*)",
      "Bash(npx eslint:*)",
      "Bash(npm run test:*)",
      "Bash(sed:*)"
    ]
}

This is the typical response I get when it's searching for files or text. These all happened back to back. It prompted me 4 times to hit Yes (probably would have done it more but I exited), even though I have permissions for Bash(rg:*) and Bash(grep:*) allowed.

 Bash(rg -n "api/time|api/v2/time" --type ts --type tsx --type js --type jsx)
  ⎿  Running…

╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command                                                                                                                                                                                                       │
│                                                                                                                                                                                                                    │
│   rg -n "api/time|api/v2/time" --type ts --type tsx --type js --type jsx                                                                                                                                           │
│   Search for api/time calls in JavaScript/TypeScript files                                                                                                                                                         │
│
│ Do you want to proceed?
│
│ ❯ 1. Yes
⏺ Bash(rg -n "api/time|api/v2/time" -t ts -t js)
  ⎿  Running…

╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command                                                                                                                                                                                                       │
│                                                                                                                                                                                                                    │
│   rg -n "api/time|api/v2/time" -t ts -t js                                                                                                                                                                         │
│   Search for api/time calls in JS/TS files                                                                                                                                                                         │
│
│ Do you want to proceed?
│
│ ❯ 1. Yes
⏺ Bash(rg -n "api/time|api/v2/time" -t php)
  ⎿  Running…

╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command                                                                                                                                                                                                       │
│                                                                                                                                                                                                                    │
│   rg -n "api/time|api/v2/time" -t php                                                                                                                                                                              │
│   Search for api/time calls in PHP files                                                                                                                                                                           │
│                                                                                                                                                                                                                    │
│ Do you want to proceed?
│
│ ❯ 1. Yes
 Bash(grep -r "api/time\|api/v2/time" --include="*.php" . | head -20)
  ⎿  Running…

╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command                                                                                                                                                                                                       │
│                                                                                                                                                                                                                    │
│   grep -r "api/time\|api/v2/time" --include="*.php" . | head -20                                                                                                                                                   │
│   Search for api/time in PHP files                                                                                                                                                                                 │
│                                                                                                                                                                                                                    │
│ Do you want to proceed?                                                                                                                                                                                            │
│ ❯ 1. Yes

I've also had it do similar things with the grep command and npm run test commands. I think that last one might be because i don't have permissions for head, which I will add. But it seems like the others shouldn't be asking for permission.

keithslater avatar Jul 30 '25 18:07 keithslater

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.

github-actions[bot] avatar Aug 07 '25 14:08 github-actions[bot]