cortex-code — Claude Code skill: Snowflake operations routing
Routes Snowflake requests to Cortex Code CLI. Triggers on Snowflake SQL, Cortex AI, Snowpark, and data warehouse queries.
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a claude-codeWhat cortex-code does
The skill uses LLM-based routing: mentions of Snowflake databases, dynamic tables, Cortex Search, or Analyst invoke Cortex Code in headless mode. Local files, other databases, and web tasks stay with the main agent. On first load, discover_cortex.py caches Cortex skill metadata in ~/.cache/cortex-skill/; repeat queries skip initialization.
A security wrapper offers three approval modes: prompt asks the user before execution, auto and envelope_only approve automatically and write audit logs. Mode is set in config.yaml (defaults to prompt if the file is absent). Requires Cortex Code CLI installed; without it, routing will fail.
What it helps with
- delegate Snowflake SQL queries to a specialized agent
- call Cortex AI functions and Snowpark without switching tools
- log warehouse operations for compliance audit
- separate Snowflake tasks from local development in one agent
- cache Cortex skill metadata to skip repeated discovery
Example prompts for the agent
- Show schemas in my Snowflake warehouse
- Run a Cortex Search query on the
orderstable - Build a Snowpark model for sales forecasting
How to install cortex-code
1Skills CLI (Vercel)
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a claude-code2Manually: put the files in place
~/.claude/skills/cortex-code/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/cortex-code/
1Skills CLI (Vercel)
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a codex2Manually: put the files in place
.agents/skills/cortex-code/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a cursor2Manually: put the files in place
.cursor/skills/cortex-code/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Snowflake-Labs/subagent-cortex-code cortex-code2Manually: put the files in place
.github/skills/cortex-code/SKILL.md1Skills CLI (Vercel)
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a gemini-cli2Platform CLI
gemini skills install https://github.com/Snowflake-Labs/subagent-cortex-code --path skills/cortex-codeManually: put the files in place
.devin/skills/cortex-code/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about cortex-code
How to install cortex-code in Claude Code?
Run npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a claude-code, the skill appears in ~/.claude/skills/cortex-code/SKILL.md.
What does cortex-code do?
The skill routes Snowflake requests to Cortex Code CLI: SQL, Cortex AI, Snowpark, data warehouses. Everything else stays with the main agent.
What does cortex-code require to work?
Cortex Code CLI installed and an active Snowflake connection. Check with which cortex — if not found, the skill will not run.