---
title: "Settings files"
url: "/docs/reference/settings-files"
description: "The three settings files, which one wins, how tables merge, and what's checked"
---

# Settings files

10nx reads its settings from three TOML files, layered like a stack: built-in defaults at the bottom, then your user file, then the repo's shared file, then your own file for that repo on top.

Use this page when two files set the same key and you want to know which one wins, or when 10nx reports a problem with a file.

## The files

| Layer | File | For | In git |
| --- | --- | --- | --- |
| User | `~/.10nx/settings.toml` | You, in every repo | No |
| Repo | `<checkout>/.10nx/settings.toml` | Everyone working in the repo | Yes, if you commit `.10nx/` |
| Local | `<main checkout>/.10nx/settings.local.toml` | You, in this repo only | No, `.10nx/.gitignore` keeps it out |

`TNX_SETTINGS_HOME` points 10nx at another folder instead of `~/.10nx`, for trying a clean setup without touching yours.

## Which value wins

For most keys, the highest layer that sets the key wins, whole:

1. Local
2. Repo
3. User
4. The built-in default

Table keys merge instead, entry by entry. `scripts.run` works this way, so your local file can change one field of a shared Run menu action without copying the rest. `environment_variables` merges too, but only between your user file and your local file: a copy in the shared repo file is ignored (see [Environment variables](environment-variables.md)):

```toml
# .10nx/settings.toml (shared)
[scripts.run.dev]
command = "npm run dev"
label = "Dev server"

# .10nx/settings.local.toml (yours)
[scripts.run.dev]
hide = true
```

## Worktrees

- **The repo file** is read from the checkout you're in, so a worktree uses the copy on its own branch. A new worktree gets the shared file as it is on the branch it started from.
- **The local file** is always read from the main checkout. It isn't in git, so a new worktree wouldn't have its own copy, and this way it applies in every worktree.

## Which keys go where

Each key says which layers it may be set in ([Settings reference](settings.md)):

- **Per-person keys** (theme, font size, your agents, executable paths) are read only from your user file. In a repo or local file they're ignored, with a note saying so.
- **Repo keys** (scripts, files to copy, environment variables, git, preview URLs) may go in any of the three.
- **Secrets** (API keys) never go in a file. A file that sets one is an error. They're set on their Settings page and saved where Settings › Passwords says.

## What's checked

Every file is checked each time it's read:

| Problem | What happens |
| --- | --- |
| Not valid TOML | The whole file is skipped until it's fixed |
| A key 10nx doesn't know | An error; the rest of the file applies |
| A value of the wrong type, or out of range | An error; the key keeps its lower layer's value |
| A per-person key in a repo or local file | Ignored, with a note |
| A secret in any file | An error |

## How 10nx writes them

- When the Settings window saves, it keeps your comments and formatting, and writes the whole file at once, so a crash can't leave half a file.
- Clearing a value in Settings removes the key from the file, and a table left empty goes with it.
- The first time it writes `settings.local.toml`, it also writes `.10nx/.gitignore` if there isn't one.

## Next steps

- [Settings reference](settings.md): every key
- [Configure settings](../guides/configure-settings.md)
- [The .10nx folder](../concepts/tnx-folder.md)
