How can I stop Claude Code from constantly asking for permission?
Asked by
SunnyPenguin42
Hey all! I'm currently using Claude Code to automate scripts and workflows, but it's a hassle because it keeps asking for permission to execute certain actions. This issue becomes even more tedious when I'm running batches or tasks that don't require oversight. I'm looking for solutions to either completely disable the permission prompts or set up an allowlist to pre-authorize specific commands or directories. Any advice, helpful documentation, or workarounds that have worked for you would be greatly appreciated! Thanks in advance!
Answers
There's actually a risky way to sidestep those permission prompts. You can start Claude Code with the command `claude --dangerously-skip-permissions`, but just be careful with this option! Make sure to read the security documentation before you do that.
Reply to this answer
You might want to adjust your settings as well! Check out the documentation on configuring Claude. You can create a `~/.claude/settings.json` file if you haven't done so already. Hereโs an example of how to set up permissions:
```
{
...
"permissions": {
"allow": [
"Bash(npm run lint)",
"Bash(npm run test:*)",
"Read(~/.zshrc)"
],
"deny": [
"Bash(curl:*)"
]
},
...
}```
This way, you can specify which actions are allowed and which are denied.
TechWhiz03: For sure! You can generalize the 'allow' rules too. Like just allowing all Bash commands and then specifically denying dangerous ones like `Bash(rm*)`. But personally, I prefer letting Git handle deletions and keeping Claude in its own directory.
Reply to this answer
Add your answer
Answers are reviewed before publication.
CautiousNewbie23: I really wish there was a simple 'approve all' option that let you keep a deny list for potentially dangerous commands like `rm -rf`. That would make things much easier!