snow ai claude¶
Launches Claude Code with its model requests routed through Cortex AI Gateway, using the endpoint and credential from the selected connection.
Syntax¶
Arguments¶
None
Options¶
--gateway-name TEXTName of the AI Gateway to route requests through. The host always comes from the connection. Default:
SNOWFLAKE.--agent-argsPasses everything after it to
claudeunchanged. Must be the last Snowflake CLI option on the command line. See Passing arguments to the agent.--connection, -c, --environment TEXTName of the connection, as defined in your
config.tomlfile. Default:default.<connection_options>The standard Snowflake CLI connection options, such as
--account,--user,--role,--authenticator,--token, and--token-file-path, which override the values in the connection. See Managing Snowflake connections. The connection must use a supported authenticator. See Authentication.
--helpDisplays the help text for this command.
Usage notes¶
-
Claude Code must already be installed. See How `snow ai` works.
-
Claude Code uses the Messages API, so only Claude models work. To choose one, pass Claude Code’s own
--modeloption, for example--agent-args --model claude-sonnet-4-5. -
snow ai claudepasses the following to theclaudeprocess:Setting Value ANTHROPIC_BASE_URLThe gateway endpoint, without /v1. Claude Code appends/v1/messagesitself.ANTHROPIC_AUTH_TOKENThe PAT or OAuth access token from the connection. Not set when the connection uses credential renewal; see the next note. ANTHROPIC_CUSTOM_HEADERSAdds X-Snowflake-Application: snowflake-cliandsnow-agent-name: claude. Existing values in this variable take precedence.CLAUDE_CODE_ENABLE_TELEMETRY,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA,CLAUDE_CODE_PROPAGATE_TRACEPARENT,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASEach set to 1, but only when Snowflake CLI telemetry is enabled for the connection, which is the default, and only if you haven’t set the variable yourself.OTEL_TRACES_EXPORTERconsole, under the same conditions. Claude Code needs a trace exporter to sendtraceparentheaders to the gateway. No OTLP endpoint is configured. -
When the connection uses
authenticator = oauth_authorization_code,snow ai claudedoesn’t pass a fixed token. It removesANTHROPIC_AUTH_TOKENandCLAUDE_CODE_OAUTH_TOKENfrom the agent’s environment and adds a--settingsargument with inline JSON that setsapiKeyHelperto the Snowflake CLI token helper and pinsenv.ANTHROPIC_BASE_URLto the gateway. Claude Code calls the helper for a fresh token as needed. In this mode:- You can’t also pass
--settingsor--safe-modein--agent-args, or setCLAUDE_CODE_SAFE_MODE=1. - Managed settings that your organization deploys take precedence over
--settings. If they setapiKeyHelperorenv.ANTHROPIC_BASE_URL, they replace whatsnow ai claudeconfigures.
- You can’t also pass
-
Claude Code can send the credential in both the
AuthorizationandX-Api-Keyheaders. Treat both as secrets in any request capture or logs. -
snow ai clauderefuses to launch whenANTHROPIC_API_KEY,CLAUDE_CODE_USE_BEDROCK, orCLAUDE_CODE_USE_VERTEXis set.
Examples¶
-
Start an interactive session with the default connection:
-
Use a specific connection:
-
Run a single prompt non-interactively, with verbose output:
-
Choose the model: