Loading...
Loading...
Claude Code settings file hierarchy, permission wildcards, and configuration patterns. Use when setting up project permissions, debugging settings issues, or understanding why certain tools are allowed or blocked.
npx skill4agent add laurigates/claude-plugins settings-configuration| Use this skill when... | Use something else when... |
|---|---|
| Setting up project permissions | Fixing plugin registry issues (use plugin-registry skill) |
| Debugging "permission denied" errors | Configuring hooks (use hooks-configuration skill) |
| Understanding settings hierarchy | Setting up MCP servers (use mcp-configuration skill) |
| Creating allow/deny patterns |
| Priority | File | Scope | Commit to Git? |
|---|---|---|---|
| 1 (lowest) | | User-level (all projects) | N/A |
| 2 | | Project-level | Yes |
| 3 (highest) | | Local overrides | No (gitignore) |
{
"permissions": {
"allow": [
"Bash(git status *)",
"Bash(npm run *)"
],
"deny": [
"Bash(rm -rf *)",
"Bash(sudo *)"
]
}
}allowdenyToolName(command prefix *)ToolName()Bashcommand prefix*| Pattern | Matches | Does NOT Match |
|---|---|---|
| | |
| | |
| | |
| | |
{
"permissions": {
"allow": [
"Bash(git status *)",
"Bash(git diff *)",
"Bash(git log *)",
"Bash(git add *)",
"Bash(git commit *)"
]
}
}{
"permissions": {
"allow": ["Bash(git *)"]
}
}| Operator | Risk | Blocked Example |
|---|---|---|
| Command chaining | |
| Conditional execution | |
| Command separation | |
| Piping | |
| Redirection | |
| Command substitution | |
| Backtick substitution | |
#!/bin/bash
# scripts/test-and-build.sh
npm test && npm run build{
"permissions": {
"allow": ["Bash(./scripts/test-and-build.sh *)"]
}
}{
"permissions": {
"allow": [
"Bash(git status *)",
"Bash(git diff *)",
"Bash(git log *)",
"Bash(git branch *)",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git push *)",
"Bash(git pull *)",
"Bash(git fetch *)",
"Bash(git checkout *)"
]
}
}{
"permissions": {
"allow": [
"Bash(gh pr *)",
"Bash(gh run *)",
"Bash(gh issue *)",
"Bash(gh workflow *)"
]
}
}{
"permissions": {
"allow": [
"Bash(npm test *)",
"Bash(bun test *)",
"Bash(vitest *)",
"Bash(biome *)",
"Bash(eslint *)",
"Bash(prettier *)"
]
}
}{
"permissions": {
"allow": [
"Bash(pre-commit *)",
"Bash(gitleaks *)",
"Bash(trivy *)"
]
}
}{
"permissions": {
"allow": [
"mcp__context7",
"mcp__sequential-thinking"
]
}
}mkdir -p .claudecat > .claude/settings.json << 'EOF'
{
"permissions": {
"allow": [
"Bash(git status *)",
"Bash(git diff *)",
"Bash(npm run *)"
]
}
}
EOFecho ".claude/settings.local.json" >> .gitignorecat > .claude/settings.local.json << 'EOF'
{
"permissions": {
"allow": [
"Bash(docker *)"
]
}
}
EOFcat .claude/settings.json | jq .cat .claude/settings.json | jq '.permissions'echo "=== User ===" && cat ~/.claude/settings.json 2>/dev/null | jq '.permissions // empty'
echo "=== Project ===" && cat .claude/settings.json 2>/dev/null | jq '.permissions // empty'
echo "=== Local ===" && cat .claude/settings.local.json 2>/dev/null | jq '.permissions // empty'| Symptom | Cause | Fix |
|---|---|---|
| Permission denied | Pattern doesn't match | Add more specific pattern |
| Shell operator blocked | Contains | Use wrapper script |
| Settings not applied | Wrong file path | Check |
| JSON parse error | Invalid JSON syntax | Validate with |
| Permissions ignored | File not readable | Check file permissions |
| Context | Command |
|---|---|
| View project perms | |
| View user perms | |
| Validate JSON | |
| Count patterns | |
| Scope | Path |
|---|---|
| User | |
| Project | |
| Local | |
Bash(command prefix *)
mcp__server_name