Where the config file lives
The Cortex home directory is resolved in this order:
CORTEX_CONFIG_DIR, then CORTEX_HOME, then ~/.cortex. CORTEX_CONFIG overrides the config file path outright, wherever the home directory ends up.
Inside a project, Cortex looks for .cortex/config.toml, then .cortex/config.json, then .cortex/config.jsonc, then cortex.toml, cortex.json and cortex.jsonc. The first one it finds is the project config. Commit the project file when the settings belong to the repository rather than to you.
Precedence
Five layers, weakest first. A later layer overrides a key set by an earlier one.- Built-in defaults
- Your own config,
~/.cortex/config.toml - The profile selected with
-p/--profile, or byprofile = "<name>" - The project config,
.cortex/config.toml - The command line:
-c/--config KEY=VALUE, repeatable, then the dedicated flags
Inspect and edit
/config opens the same file and /reload-config re-reads configuration from disk.
Keys
Model
Permissions and sandboxing
[sandbox_workspace_write] refines workspace-write with writable_roots, network_access, exclude_tmpdir_env_var and exclude_slash_tmp. The [permission] table sets per-capability and per-command policy. Both are documented on Permission policy.
Behaviour
History
Terminal app
Execution
--max-agent-threads, --max-tool-threads, --command-timeout, --http-timeout, --no-streaming.
Plugins
Plugins are configured in the same file:Profiles
A profile is a named block that overrides top-level keys. Anything you can set at the top level you can set in a profile.-p review, or set profile = "review" at the top level to make it your default. A profile sits below the project config, so a repository can still override it.
Nothing in the CLI documentation states whether Cortex prompts you before honouring a repository’s
.cortex/config.toml. Treat an unfamiliar repository’s config as something to read before you run a session in it.