# Claude Code Settings File

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** settings.json, Claude Code settings

## Think of it like

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

## 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

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

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

- **JSON keys.** Rules, hooks, env.
- **Several levels.** You, team, org.
- **Strict JSON.** No comments.

## Related terms

- [Claude Code Settings Precedence](https://learn.benibix.com/term/ai/settings-precedence)
- [User Settings File](https://learn.benibix.com/term/ai/user-settings-file)
- [Project Settings File](https://learn.benibix.com/term/ai/project-settings-file)

![The four settings files, who each one affects, and whether it goes into git.](https://learn.benibix.com/diagrams/settings-file-scopes.svg)

---

Source: https://learn.benibix.com/term/ai/claude-code-settings-file
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
