RepoSnowflake (Arctic)Snowflake (Arctic)published Apr 8, 2026seen 5d

Snowflake-Labs/subagent-cortex-code

Python

Open original ↗

Captured source

source ↗

Snowflake-Labs/subagent-cortex-code

Description: Route Snowflake operations from any coding agent (Claude Code, Cursor, Codex, Github Copilot, Windsurf, VSCode etc) to Cortex Code CLI — with smart routing, security envelopes, and headless execution.

Language: Python

License: NOASSERTION

Stars: 51

Forks: 7

Open issues: 2

Created: 2026-04-08T19:48:17Z

Pushed: 2026-05-05T02:19:28Z

Default branch: main

Fork: no

Archived: no

README:

Cortex Code Skill

This skill routes Snowflake-related operations to Cortex Code CLI, enabling coding agents to leverage specialized Snowflake expertise in headless mode.

Quick Install

Choose your coding agent:

| Agent | Install method | Details | |-------|---------------|---------| | Claude Code | npx skills add snowflake-labs/subagent-cortex-code --copy --global | [→ Claude Code](#claude-code) | | Cursor | npx skills add snowflake-labs/subagent-cortex-code --copy --global + copy routing rule | [→ Cursor](#cursor) | | Windsurf | npx skills add snowflake-labs/subagent-cortex-code --copy --global | [→ Windsurf](#windsurf) | | Codex | bash integrations/codex/install.sh (not npx — uses cortexcode-tool) | [→ Codex](#codex) | | GitHub Copilot | npx skills add snowflake-labs/subagent-cortex-code --copy --global | [→ GitHub Copilot](#github-copilot) | | VSCode / terminal | bash integrations/cli-tool/setup.sh | [→ CLI tool](#vscode--terminal) |

Prerequisite for all: Cortex Code CLI installed and configured.

which cortex # must return a path
cortex connections list # must show an active connection

Also works out of the box with many other agents

When you run npx skills add snowflake-labs/subagent-cortex-code --copy --global, the skill is automatically installed for every "universal" agent the skills CLI knows about. No extra steps required — just restart the agent.

Universal agents (installed to `~/.agents/skills/cortex-code/`, always included):

  • Amp
  • Antigravity
  • Cline
  • Deep Agents
  • Firebender
  • Gemini CLI
  • Kimi Code CLI
  • OpenCode
  • Warp

For the full list of 40+ supported agents (including optional opt-in ones like Continue, Goose, OpenHands, Roo Code, etc.) see the `skills` CLI agents catalog. The interactive npx prompt lets you select additional targets per install.

---

Claude Code

Install the skill via npx:

npx skills add snowflake-labs/subagent-cortex-code --copy --global

npx skills add installs to ~/.agents/skills/cortex-code/. Move it into Claude Code's skills directory:

mv ~/.agents/skills/cortex-code ~/.claude/skills/cortex-code

Verify:

ls ~/.claude/skills/cortex-code/SKILL.md

Start Claude Code and mention anything Snowflake-related — the skill activates automatically.

Optional: configure security mode

cp ~/.claude/skills/cortex-code/config.yaml.example \
~/.claude/skills/cortex-code/config.yaml
# edit as needed — default is "prompt" (asks before executing)

See [integrations/claude-code/README.md](integrations/claude-code/README.md) for full details.

---

Cursor

Step 1 — Install the skill:

npx skills add snowflake-labs/subagent-cortex-code --copy --global

This installs skills/cortex-code/ to ~/.cursor/skills/cortex-code/.

Step 2 — Activate the auto-routing rule:

mkdir -p ~/.cursor/rules
cp ~/.cursor/skills/cortex-code/cortex-snowflake-routing.mdc ~/.cursor/rules/

Step 3 — Restart Cursor.

Without the routing rule you type /cortex-code your question. With it, Cursor detects Snowflake queries automatically and invokes the skill.

Verify:

ls ~/.cursor/skills/cortex-code/SKILL.md
ls ~/.cursor/rules/cortex-snowflake-routing.mdc

See [integrations/cursor/README.md](integrations/cursor/README.md) for full details.

---

Windsurf

Install the skill via npx:

npx skills add snowflake-labs/subagent-cortex-code --copy --global

This installs skills/cortex-code/ to ~/.codeium/windsurf/skills/cortex-code/.

Verify:

ls ~/.codeium/windsurf/skills/cortex-code/SKILL.md

Restart Windsurf — Cascade auto-discovers the skill by name and description. Mention anything Snowflake-related and it activates automatically. No routing rule needed.

Optional: configure security mode

cp ~/.codeium/windsurf/skills/cortex-code/config.yaml.example \
~/.codeium/windsurf/skills/cortex-code/config.yaml
# edit as needed — default is "prompt" (asks before executing)

---

Codex

Codex uses the cortexcode-tool CLI directly — no skill directory needed.

> Important: Do NOT run npx skills add for Codex. Codex uses the cortexcode-tool CLI so the agent can request sandbox/network approval in chat, then run the approved command with --yes. Use the CLI install below instead.

git clone https://github.com/Snowflake-Labs/subagent-cortex-code.git
cd subagent-cortex-code
bash integrations/codex/install.sh

The script: 1. Installs the cortexcode-tool CLI to ~/.local/bin/ 2. Auto-detects your active Cortex connection 3. Writes config to ~/.local/lib/cortexcode-tool/config.yaml (auto-detected, no --config flag needed)

Verify:

cortexcode-tool --version
cortexcode-tool "How many databases do I have in Snowflake?" --envelope RO

The second command is a direct terminal smoke test and may ask for approval in the terminal. Inside a Codex chat, Codex should first ask you to approve the planned Cortex Code execution, then retry the approved foreground command with --yes.

Usage from Codex sessions:

First time — paste into a Codex session to confirm the tool is discoverable:

which cortexcode-tool
cortexcode-tool --help

Once discovered, Codex invokes cortexcode-tool for Snowflake questions automatically. For read-only Snowflake questions, the approved command should look like this:

cortexcode-tool --yes "How many databases do I have in Snowflake?" --envelope RO

Implicit prompts also work — Codex detects Snowflake intent, asks for approval, and calls cortexcode-tool on your behalf:

How many databases do I have in Snowflake?

See [integrations/codex/README.md](integrations/codex/README.md) for full details.

---

GitHub Copilot

Install the skill via npx:

npx skills add snowflake-labs/subagent-cortex-code --copy --global

This installs skills/cortex-code/ to…

Excerpt shown — open the source for the full document.

Notability

notability 2.0/10

Low stars, new repo.