Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Cortex Code CLI Wrapper for SnowflakeNew to Visual Studio Code? Get it now.
Cortex Code CLI Wrapper for Snowflake

Cortex Code CLI Wrapper for Snowflake

Boon67

|
54 installs
| (0) | Free
AI-powered Snowflake development assistant - chat, SQL execution, and solution development.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Cortex Code VS Code Extension

Cortex Code

A VS Code wrapper for the Cortex Code CLI — bringing AI-powered Snowflake development directly into your editor.

This extension provides a graphical interface for the Cortex Code CLI, enabling chat-based AI assistance, SQL execution, and Snowflake object exploration without leaving VS Code.

Disclaimer: This project is not supported by, affiliated with, or endorsed by Snowflake Inc. or any related entities. This is an independent, community-developed extension.

Quick Demo

Prerequisites

Snowflake CLI is required. This extension uses the cortex and snow commands from the Snowflake CLI. Install it before using this extension:

  1. Install Snowflake CLI: Follow the official installation guide
  2. Configure a connection: Run snow connection add to set up your Snowflake connection
  3. Verify installation: Run cortex --version and snow --version in your terminal

If the CLI is not in your system PATH, you can configure custom paths in VS Code settings:

  • cortex.cliPath: Path to cortex executable
  • cortex.snowCliPath: Path to snow executable

Features

  • Chat in Secondary Sidebar: Conversational AI for Snowflake development (in the Cortex Code sidebar)
  • Model Selection: Choose between Claude Opus 4.6/4.5, Sonnet 4.5/4.0, or Auto
  • File References: Use @ to reference files in your chat messages
  • Tool Execution Details: See the actual commands and queries being executed
  • Relative File Paths: File operations show clean paths relative to your project
  • Workspace Detection: Prompts to open/create a workspace folder when needed
  • SQL Execution: Run queries directly from the editor with Ctrl+Enter
  • CodeLens: [Run] [Explain] [Validate] actions above SQL statements
  • Snowflake Explorer: Browse databases, schemas, tables, and views
  • Connection Management: Quick-switch between Snowflake connections
  • Database Context Selector: Add database/schema/table context to chat
  • Custom Instructions: Configure AI behavior with agents.md files
  • Tool Permissions: Control which tools Cortex can use
  • Debug Mode: Inspect API calls and responses

Installation

From VS Code Marketplace (Recommended)

  1. Open VS Code
  2. Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
  3. Search for "Cortex Code Extension for Snowflake"
  4. Click Install

Or install via command line:

code --install-extension Boon67.cortex-code-extension-for-snowflake

From Source (For Contributors)

# Clone the repository
git clone https://github.com/Boon67/vscode_cortex_plugin.git
cd vscode_cortex_plugin

# Install dependencies
npm install

# Build and package
npm run package

# Install the generated VSIX
code --install-extension cortex-code-extension-for-snowflake-0.1.5.vsix

For development, open the folder in VS Code and press F5 to launch the Extension Development Host.

Usage

Opening Chat

  • Press Ctrl+Shift+C (or Cmd+Shift+C on Mac)
  • Click "Open Chat" in the Cortex Agent sidebar view
  • The chat opens in the secondary sidebar (Cortex Code panel on the right)

Model Selection

Select your preferred AI model from the dropdown in the chat footer:

  • Auto: Automatic model selection (default)
  • Claude Opus 4.6: Most capable model
  • Claude Opus 4.5: High capability model
  • Claude Sonnet 4.5: Balanced performance
  • Claude Sonnet 4.0: Fast responses

Plan Mode

Enable Plan Mode to have the assistant gather requirements before implementing:

  1. Click the Plan button in the chat footer to toggle plan mode
  2. When active, the button is highlighted
  3. Send your request - the assistant will ask clarifying questions one at a time
  4. Answer each question to refine the requirements
  5. After gathering information, a product_plan.md file is generated
  6. Review and confirm the plan before implementation begins

Plan mode is useful for:

  • Complex implementation tasks
  • Multi-file changes
  • Ensuring alignment before coding starts

File References

Reference files in your chat messages using @:

  1. Type @ in the chat input
  2. Start typing a filename to filter
  3. Use arrow keys to navigate, Enter to select
  4. The file path is inserted into your message

Running SQL

  1. Open a .sql file
  2. Click [Run] in the CodeLens above a statement, or
  3. Select SQL and press Ctrl+Enter

Switching Connections

  1. Click the connection name in the status bar
  2. Select a connection from your ~/.snowflake/connections.toml

Database Context Selector

Add database context to your chat messages for more relevant responses:

  1. Click the connection info area in the chat panel footer
  2. Select a connection from the list
  3. Optionally drill down to select a database, schema, or specific tables
  4. Click "Add to context" at any level - you don't need to select tables
  5. The selected context appears as a label above the chat input
  6. Remove context by clicking the X on the context label

Context levels:

  • Connection only: OREGON
  • Connection + Database: OREGON › SALES_DB
  • Connection + Database + Schema: OREGON › SALES_DB.PUBLIC
  • With specific tables: OREGON › SALES_DB.PUBLIC (3 tables)

Note: The chat connection is independent from the Snowflake Explorer connection.

Custom Instructions

Configure default AI behavior using agents.md files:

  1. Global instructions: Create ~/.cortex/agents.md for default instructions
  2. Workspace instructions: Create agents.md in your workspace root to override
  3. Click the document icon in the chat toolbar to edit instructions
  4. The icon turns blue when custom instructions are active

Example agents.md:

# Custom Instructions

## SQL Style
- Always use uppercase for SQL keywords
- Include comments explaining complex logic
- Use CTEs instead of subqueries

## Project Structure
- Deploy scripts go in /deploy folder
- Use semantic versioning for releases

Tool Permissions

Control which tools Cortex can use:

  1. Click the wrench icon in the chat toolbar

  2. Toggle individual tools on/off:

    • SQL Execution: Run queries on Snowflake
    • Shell Commands: Execute terminal commands
    • File Operations: Read/write/edit files
    • Search: Glob and grep operations
    • Web: Fetch URLs and search the web
  3. If a disabled tool is needed, a "Run" button appears to execute it once

Debug Mode

Inspect all API calls and responses:

  1. Click the bug icon in the chat toolbar (turns green when active)
  2. Opens the "Cortex Code Debug" output channel
  3. Shows:
    • User input with timestamps
    • Database context appended to messages
    • Tool calls with full input parameters
    • Tool results (truncated for readability)
    • Assistant responses
    • Errors and exceptions

Configuration

Setting Description Default
cortex.defaultConnection Default Snowflake connection name ""
cortex.autoComplete.enabled Enable auto-completions true
cortex.inlineExecution.enabled Enable CodeLens SQL execution true
cortex.metadataCache.ttlSeconds Metadata cache TTL 300
cortex.cliPath Path to cortex CLI "cortex"
cortex.tools.enabledTools List of enabled tools [all tools]

Keyboard Shortcuts

Shortcut Action
Ctrl+Shift+C Open Chat
Ctrl+Enter Run SQL
Ctrl+Shift+Enter Validate SQL
Ctrl+K Ctrl+C Ask about selection
Ctrl+K Ctrl+E Explain selection

Chat Toolbar Icons

Icon Description
📄 Document Custom instructions (agents.md)
🔧 Wrench Tool permissions
🐛 Bug Debug mode
Clear chat Clear conversation history

Chat Footer Controls

Control Description
Connection info Shows current Snowflake connection - click to add context
Model dropdown Select AI model (Auto, Claude Opus 4.6/4.5, Sonnet 4.5/4.0)

Development

# Watch mode
./scripts/build.sh --watch

# Production build
./scripts/build.sh --production

# Package extension
npm run package

License

Apache 2.0 - See LICENSE for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft