Claude Code
5 min
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
Claude CodeEfficiencyConfigurationpermissions
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
bash
# Create directory if it doesn't exist
mkdir -p ~/.claude
# Edit settings.json
code ~/.claude/settings.json
2. Basic Configuration Example
json
{
"model": "opus",
"permissions": {
"allow": [
"Bash(git:*)",
"Bash(ls:*)",
"Bash(npm:*)",
"WebFetch(domain:github.com)"
],
"deny": []
}
}
Recommended Permission Settings
Commonly Used Development Commands
json
{
"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 (*)
json
"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
json
"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- 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!