Cortex Code CLI Settings¶
Cortex Code CLI settings control tool permissions, connections, and session behavior. You can configure settings using managed policy (if provided by your organization), configuration files, environment variables, and command-line arguments.
Configuration files¶
The following configuration files are used by Cortex Code CLI:
File |
Purpose |
|---|---|
|
Organization-managed policy file (optional). For OS-specific locations, see Managed settings (organization policy). |
|
Main Cortex Code CLI settings file. |
|
Permission preferences. |
|
MCP server configuration (see Model Context Protocol (MCP)). |
|
Snowflake connections (see Cortex Code CLI). Shared with Snowflake CLI. |
The full layout of the main configuration directory is:
Settings precedence¶
Settings are applied in the following order of precedence (highest to lowest):
Managed settings restrictions (
settings.*fields inmanaged-settings.json). Can’t be overridden by any user-level configuration. See Managed settings (organization policy).Profile overrides (
settingsOverridesfrom the active profile, if any).Project settings (
.cortex/settings.jsonor.claude/settings.jsonin the working directory).Managed settings defaults (
defaults.*fields inmanaged-settings.json). Users can override these in their ownsettings.json.Global user settings (
~/.snowflake/cortex/settings.json).Default values embedded in the Cortex Code CLI.
Permissions follow a separate evaluation order. See Permission evaluation.
settings.json¶
~/.snowflake/cortex/settings.jsonMain settings file for Cortex Code CLI.
Example content:
The following settings are available:
compactMode: Enables compact output formatting.autoUpdate: Enables automatic updates.theme: Sets the CLI theme (lightordark).
permissions.json¶
~/.snowflake/cortex/permissions.jsonControls tool access permissions.
Example content:
The following settings are available:
onlyAllow: List of allowed tool patterns.defaultMode: Default permission mode (ask,allow,deny).dangerouslyAllowAll: Allows all tools without prompts (unsafe).
Managed settings (organization policy)¶
Administrators can deploy a system-level JSON policy file to enforce Cortex Code CLI behavior across an organization, restricting tools, accounts, and minimum versions. For details, see Managed settings (organization policy).
Environment variables¶
Cortex Code CLI recognizes the following configuration environment variables:
Variable |
Description |
|---|---|
|
Overrides the default |
|
Overrides model selection. |
|
Enables the memory tool (set to |
|
Requires confirmation for SQL write operations in bypass mode. |
Note
For additional permission-related environment variables, see Security.
Command-line overrides¶
Cortex Code CLI settings can be overridden via command-line arguments, which include the following:
Example |
Description |
|---|---|
|
Specifies the connection. |
|
Sets the working directory. |
|
Continues the last session. |
|
Resumes a specific session. |
|
Enables planning mode. |
|
Disables permission prompts (unsafe). |
Session storage¶
Conversations and settings are stored in:
Location |
Description |
|---|---|
|
Session files. |
|
Permission preferences. |
|
MCP configuration. |