Skip to content
BENIBIX Learn

Claude Code Settings File

AI⌨️ Claude CodeConfiguration

Also known as settings.json, Claude Code settings

A JSON file that sets how Claude Code acts. It holds its rules.

Think of it like

It is like a list of house rules on the wall. Everyone who comes in reads it.

Example

Jack adds a deny rule for .env files to his project's settings file. Now Claude cannot read them in that project.

Why it matters

Nearly every lasting change to Claude Code is a line in one of these files.

Definition

A Claude Code settings file is a JSON file named settings.json that sets how Claude Code acts. It holds keys such as permissions, hooks, env and model. There is a file for you, one for a whole repo, and one for you in one repo. A company can add its own too. The file must be strict JSON, so a comment or a trailing comma is an error.

Example code

json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "permissions": {
    "allow": ["Bash(npm run lint)"],
    "deny": ["Read(./.env)"]
  }
}
The $schema line lets your editor fill in keys for you.
One name, four places, four audiences.

Common mistake

Adding a // comment to explain a line. Settings files are strict JSON, so the file then fails to load.

Key takeaways

  1. 1
    JSON keys. Rules, hooks, env.
  2. 2
    Several levels. You, team, org.
  3. 3
    Strict JSON. No comments.