Cortex Code CLI Settings

Cortex Code CLI settings control various aspects of its behavior, including tool permissions, connections, and sessions. You can configure settings through configuration files, command-line arguments, and environment variables.

Configuration files

The following configuration files are used by Cortex Code CLI:

File

Purpose

~/.snowflake/cortex/settings.json

Main Cortex Code CLI settings file

~/.snowflake/cortex/permissions.json

Permission preferences

~/.snowflake/cortex/mcp.json

MCP server configuration (see Model Context Protocol (MCP))

~/.snowflake/config.toml

Snowflake connections (see Cortex Code CLI). Shared with Snowflake CLI.

The full layout of the main configuration directory is:

Directory/File

Description

/.snowflake/cortex/

Main Cortex Code CLI config directory

├── settings.json

Main settings

├── mcp.json

MCP server configs

├── permissions.json

Saved permissions

├── hooks.json

Global hooks

├── history

Command history

├── conversations/

Session files

├── cache/

Temporary cache

   ├── table_cache.json

SQL result metadata

   └── sql_result_cache/

Parquet files

├── logs/

Log files

├── memory/

Persistent memory

├── agents/

Custom agents

├── skills/

Global skills

├── commands/

Custom commands

├── hooks/

Hook scripts

├── profiles/

Team profiles

└── remote_cache/

Cloned repos

settings.json

~/.snowflake/cortex/settings.json

Main settings file for Cortex Code CLI.

Example content:

{
   "compactMode": true,
   "autoUpdate": true,
   "theme": "dark"
}
Copy

The following settings are available:

  • compactMode: Enable compact output formatting

  • autoUpdate: Enable automatic updates

  • theme: Set CLI theme (light, dark)

permissions.json

~/.snowflake/cortex/permissions.json

Controls tool access permissions.

Example content:

{
  "onlyAllow": ["read_file", "execute_sql"],
  "defaultMode": "ask",
  "dangerouslyAllowAll": false
}
Copy

The following settings are available:

  • onlyAllow: List of allowed tool patterns

  • defaultMode: Default permission mode (ask, allow, deny)

  • dangerouslyAllowAll: Allow all tools without prompts (unsafe)

Environment variables

Cortex Code CLI recognizes the following environment variables for configuration:

Variable

Description

SNOWFLAKE_HOME Override

~/.snowflake directory

CORTEX_AGENT_MODEL

Override model selection

CORTEX_ENABLE_MEMORY

Enable memory tool (true/1)

COCO_DANGEROUS_MODE_REQUIRE_SQL_WRITE_PERMISSION

Require confirmation for SQL writes in bypass mode

Settings precedence

Settings are applied in the following order of precedence (highest to lowest):

  1. Default values

  2. Configuration files (~/.snowflake/cortex/)

  3. Environment variables

  4. Command-line arguments

  5. In-session commands (/plan, etc.)

Command-line overrides

Cortex Code CLI settings can be overridden via command-line arguments, which include the following:

Argument

Description

cortex -c production

Specify connection

cortex --workdir /path

Working directory

cortex --continue

Continue last session

cortex --resume <session_id>

Resume specific session

cortex --plan

Enable planning mode

cortex --dangerously-allow-all-tool-calls

Disable permission prompts (unsafe)

Session storage

Conversations and settings are stored in:

Location

Description

~/.snowflake/cortex/conversations/

Session files

~/.snowflake/cortex/permissions.json

Permission preferences

~/.snowflake/cortex/mcp.json

MCP configuration