How to Run Frequently Used Commands in Claude Code Without Confirmation
Learn how to dramatically improve development efficiency by configuring permissions in ~/.claude/settings.json
Table of Contents
Dramatically Improve Development Efficiency with Claude Code Permissions
Have you ever felt frustrated by the "Are you sure you want to run this command?" confirmation when using Claude Code?
You can actually set permissions in advance in the ~/.claude/settings.json file to run frequently used commands without confirmation.
How to Configure
1. Create/Edit settings.json File
# Create directory if it doesn't exist
mkdir -p ~/.claude
# Edit settings.json
code ~/.claude/settings.json
2. Basic Configuration Example
{
"model": "opus",
"permissions": {
"allow": [
"Bash(git:*)",
"Bash(ls:*)",
"Bash(npm:*)",
"WebFetch(domain:github.com)"
],
"deny": []
}
}
Recommended Permission Settings
Commonly Used Development Commands
{
"model": "opus",
"permissions": {
"allow": [
// Version Control
"Bash(git:*)",
// File Operations
"Bash(ls:*)",
"Bash(cat:*)",
"Bash(pwd:*)",
"Bash(cd:*)",
// Search Tools
"Bash(find:*)",
"Bash(grep:*)",
"Bash(rg:*)", // ripgrep (fast search)
// Development Tools
"Bash(npm:*)",
"Bash(node:*)",
"Bash(python:*)",
"Bash(make:*)",
// Utilities
"Bash(jq:*)", // JSON processing
"Bash(curl:*)", // API communication
"Bash(echo:*)", // Output verification
// Deployment Related
"Bash(vercel:*)", // Vercel CLI
"Bash(gh:*)", // GitHub CLI
// Web References
"WebFetch(domain:github.com)",
"WebFetch(domain:vercel.com)",
"WebFetch(domain:docs.anthropic.com)",
"WebFetch(domain:stackoverflow.com)",
"WebFetch(domain:developer.mozilla.org)",
"WebFetch(domain:npmjs.com)",
"WebFetch(domain:nextjs.org)"
],
"deny": []
}
}
Benefits of Permission Settings
1. Improved Development Speed
- No confirmation dialogs appear
- Uninterrupted flow of thought
- Execute multiple commands consecutively
2. Ensured Security
- Only permitted commands can be executed
- Dangerous commands explicitly excluded
- Configurable per project
3. Improved Work Efficiency
- Preset frequently used commands
- Share settings within teams
- Cleaner work logs
Configuration Tips
Using Wildcards (*)
"Bash(git:*)" // Allow all git subcommands
"Bash(git:add)" // Allow only git add
"Bash(git:add,commit)" // Allow only git add and commit
Domain Specification Examples
"WebFetch(domain:*.github.com)" // All GitHub subdomains
"WebFetch(domain:api.github.com)" // Specific subdomain only
Important Notes
-
Consider Security
- Avoid destructive commands like
rm -rf - Be careful when executing in production environments
- Avoid destructive commands like
-
Add Gradually
- Start with basic commands
- Add more as needed
-
For Team Development
- Use team-agreed settings
- Separate settings per project
Summary
Permission settings in ~/.claude/settings.json greatly enhance the Claude Code development experience. By pre-authorizing frequently used commands, you can eliminate confirmation prompts and achieve a smooth development flow.
Start configuring now and get a more comfortable development environment!
Loading images...
📢 Share this discovery with your team!
Help others facing similar challenges discover AI collaboration insights
Related Articles
Boost Your Development Efficiency with Claude Code Custom Commands
Solve CLAUDE.md bloat and token consumption issues! Learn how to reduce token usage by 20% while working more naturally with AI by converting fixed workflows into custom commands.
How to Efficiently Set Up Projects with Claude Code
Learn how to automate project setup using Claude Code and significantly improve your development efficiency.
How to Get Sound Notifications for Claude Code Task Completion - No Need to Stare at the Screen!
You don't need to watch the screen during long task execution. Claude Code's official 'terminal bell notification' feature alerts you with sound when tasks complete. But Mac users beware!