Most Claude Code users only scratch the surface of what's possible with settings configuration. Here are 5 settings patterns that dramatically improved my productivity.
1. Scoped Bash Permissions
Stop approving every command manually:
{
"permissions": {
"allow": [
"Bash(git:*)",
"Bash(npm run:*)",
"Bash(npx:*)",
"Bash(ls:*)",
"WebSearch"
]
}
}
Why it matters: Each permission prompt breaks your flow. Pre-approve safe commands by pattern. Bash(git:*) approves all git commands. Bash(npm run:*) approves all npm scripts.
The key insight: Scope to the command prefix, not blanket Bash access. This keeps you safe while eliminating friction.
2. Additional Directories for Monorepos
{
"permissions": {
"additionalDirectories": [
"/Users/you/shared-libs",
"/Users/you/design-system"
]
}
}
Claude Code defaults to your current working directory. If your project references code in other directories (monorepo packages, shared libraries), add them explicitly.
3. Environment Variables for Context
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
"NODE_ENV": "development"
}
}
Feature flags and environment context travel with your settings. AGENT_TEAMS enables parallel agent execution for complex tasks.
4. Project vs User vs Global Settings
Claude Code has three settings levels:
| File | Scope | Git tracked? |
|---|---|---|
.claude/settings.json |
Project (shared) | Yes |
.claude/settings.local.json |
Project (personal) | No |
~/.claude/settings.json |
Global | N/A |
Best practice:
- Project settings: Team conventions, safe commands everyone uses
- Local settings: Your personal permissions, API keys directory access
- Global settings: Plugins, marketplaces, cross-project preferences
Most people put everything in one file. Splitting them means your team shares conventions without sharing personal config.
5. Hooks for Automated Quality Checks
In your project's settings, you can define hooks that run automatically:
{
"hooks": {
"postToolUse": [
{
"tool": "Write",
"command": "npm run lint --fix {{filePath}}"
}
]
}
}
Every time Claude writes a file, it auto-lints. No more "oops, forgot to format."
Other useful hook patterns:
- Run tests after editing test files
- Type-check after TypeScript changes
- Format markdown after documentation edits
Bonus: Validate Your Settings
Misconfigurations are silent. You won't know your settings are wrong until something breaks.
ccguard scans your Claude Code configuration and catches:
- Invalid JSON
- Secrets accidentally in settings
- Overly broad permissions
- Duplicate rules
npx @ryu0705/ccguard scan
These patterns come from running Claude Code Company — an autonomously AI-operated company. Read our AI Dev Tools Report for monthly analysis of the AI developer tools ecosystem.
Top comments (0)