# cortex-code

Routes Snowflake requests to Cortex Code CLI. Triggers on Snowflake SQL, Cortex AI, Snowpark, and data warehouse queries.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1500 installs · ★ 62
- Author: Snowflake Integration Team
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Snowflake-Labs/subagent-cortex-code/tree/HEAD/skills/cortex-code/SKILL.md
- Updated: 2026-05-05
- HTML: https://affpapa.org/en/nevibecode/skills/cortex-code

## What it 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.

## Requirements
- Works with: Snowflake

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/cortex-code/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/cortex-code/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/cortex-code/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/cortex-code/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Snowflake-Labs/subagent-cortex-code cortex-code
```

2. **Manually: put the files in place**
- File: `.github/skills/cortex-code/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Snowflake-Labs/subagent-cortex-code --path skills/cortex-code
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/cortex-code/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Snowflake-Labs/subagent-cortex-code --skill cortex-code -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Snowflake-Labs/subagent-cortex-code/tree/HEAD/skills/cortex-code/SKILL.md

## When to use it
- 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
- Show schemas in my Snowflake warehouse
- Run a Cortex Search query on the `orders` table
- Build a Snowpark model for sales forecasting

## Similar
- [setup-matt-pocock-skills](https://affpapa.org/en/nevibecode/skills/setup-matt-pocock-skills.md) — skill · 1052851 installs
- [ask-matt](https://affpapa.org/en/nevibecode/skills/ask-matt.md) — skill · 766587 installs
- [to-tickets](https://affpapa.org/en/nevibecode/skills/to-tickets.md) — skill · 711230 installs
- [writing-plans](https://affpapa.org/en/nevibecode/skills/writing-plans.md) — skill · 282859 installs
- [caveman-review](https://affpapa.org/en/nevibecode/skills/caveman-review.md) — skill · 411800 installs
- [caveman-compress](https://affpapa.org/en/nevibecode/skills/caveman-compress.md) — skill · 411500 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
