DEV Community

Zac
Zac

Posted on

The Claude Code settings.json options that actually change behavior

Claude Code has a settings file at .claude/settings.json. Most people never touch it. A few options change behavior significantly.

defaultMode

{
  "defaultMode": "acceptEdits"
}
Enter fullscreen mode Exit fullscreen mode

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"]
  }
}
Enter fullscreen mode Exit fullscreen mode

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"
  ]
}
Enter fullscreen mode Exit fullscreen mode

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"
}
Enter fullscreen mode Exit fullscreen mode

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:

  1. .claude/settings.json in the project root — project-specific, checked into git (or not)
  2. .claude/settings.local.json — project-specific, not checked in (use for personal overrides)
  3. ~/.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*"
  ]
}
Enter fullscreen mode Exit fullscreen mode

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)