Claude Code has a settings file at .claude/settings.json. Most people never touch it. A few options change behavior significantly.
defaultMode
{
"defaultMode": "acceptEdits"
}
The default mode is "default" which asks for confirmation on file edits. "acceptEdits" accepts file changes automatically but still asks about shell commands. This is the setting that stops the "approve this edit" prompts.
Allowed commands
{
"bash": {
"allowedCommands": ["npm", "git", "ls", "cat", "grep", "node"]
}
}
This controls which shell commands run without asking. List the specific commands your project uses. Use ["*"] to allow everything — reasonable for personal projects, worth thinking about before committing to a team repo.
Ignore patterns
{
"ignorePatterns": [
"node_modules/**",
"dist/**",
".env*",
"*.log"
]
}
Files Claude Code won't read or modify. This overlaps with .claudeignore but settings.json ignores apply at the tool level, before Claude even sees the file. Useful for keeping secrets and build artifacts out of context.
Model selection
{
"model": "claude-opus-4-5"
}
Overrides the default model. Relevant if you have API access and want to control cost/speed tradeoffs for different tasks.
The settings file location
Three places it can live, in order of precedence:
-
.claude/settings.jsonin the project root — project-specific, checked into git (or not) -
.claude/settings.local.json— project-specific, not checked in (use for personal overrides) -
~/.claude/settings.json— global, applies to all projects
The project-level file overrides global. Local overrides project.
What to actually put in it
Minimal useful setup for most projects:
{
"defaultMode": "acceptEdits",
"bash": {
"allowedCommands": ["npm", "npx", "git", "ls", "cat", "grep", "node", "tsc"]
},
"ignorePatterns": [
"node_modules/**",
"dist/**",
".env*"
]
}
Commit this to the repo so everyone on the project gets consistent Claude behavior.
More configuration patterns — CLAUDE.md rules, settings combinations, and the prompts that change specific behaviors — are in the Agent Prompt Playbook. $29.
Top comments (0)