cortex-router

cortex-router is a skill for Claude Code from Snowflake-Labs/snowflake-ai-kit. It costs 36 tokens per session (975 once invoked), scanned A, original, Apache-2.0.

An automatic routing skill that sends Snowflake-related work to Cortex Code CLI, a command-line tool with Snowflake-specific capabilities. It first checks that the CLI is installed and confirms whether the request should be routed.

In plain words
What is it for?
Use it to route eligible Snowflake operations to Cortex Code CLI while leaving unrelated requests in the current coding agent.
Why use it?
It prevents Snowflake requests from being sent through the wrong tool and checks the required setup before routing them.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions Claude Code; $skill-name invocation.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the snowflake-cortex-code plugin — 3 skills, 2 hooks shipped together

Good fit Use it to route eligible Snowflake operations to Cortex Code CLI while leaving unrelated requests in the current coding agent.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Snowflake-Labs/snowflake-ai-kit
Claude Code
/plugin install snowflake-cortex-code

Made for: Claude Code.

Or install snowflake-cortex-code, the plugin that ships this one along with the rest of its 3 skills, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cortex-router

README.md
[![agentmods](https://agentmods.dev/badge/skills/snowflake-labs/snowflake-ai-kit/cortex-router.svg)](https://agentmods.dev/skills/snowflake-labs/snowflake-ai-kit/cortex-router)
Your own site
<a href="https://agentmods.dev/skills/snowflake-labs/snowflake-ai-kit/cortex-router"><img src="https://agentmods.dev/badge/skills/snowflake-labs/snowflake-ai-kit/cortex-router.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 975 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.00975
Opus 5 $0.00018 $0.00487
Sonnet 5 $0.00007 $0.00195
Haiku 4.5 $0.00004 $0.00097

Measured 8d ago against content hash dec62244b069, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

cortex-router scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cortex-code/skills/cortex-router/SKILL.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cortex Code Router

Route Snowflake operations to Cortex Code CLI, which has specialized bundled skills (data-quality, semantic-view, cost-intelligence, ML, governance, etc.).

CRITICAL: Follow steps 1 → 2 → 3 in order. Do NOT skip to Step 3.

Step 1: Verify CLI

which cortex 2>/dev/null && cortex --version

If cortex is NOT found:

  1. Tell the user: "Cortex Code CLI is not installed. Setting it up now."
  2. Load the snowflake-cortex-code:cortex-setup skill using the Skill tool.
  3. STOP — do not continue until the CLI is installed.

Step 2: Confirm Routing

Run the routing script to check if this prompt should go to Cortex or stay in Claude Code:

python "${CLAUDE_PLUGIN_ROOT}/scripts/router/route_request.py" --prompt "USER_PROMPT_HERE"

Replace USER_PROMPT_HERE with the actual user prompt (shell-escaped).

Read the output carefully:

  • If output says "route: cortex" → proceed to Step 3
  • If output says "route: claude"STOP. Handle the request yourself using Claude Code tools (sql_execute, Read, Write, etc.). Do NOT run execute_cortex.py.

Step 3: Execute via Cortex Code

Only reach this step if Step 2 confirmed routing to Cortex.

Choose a security envelope based on the operation:

  • RO: Read-only queries (SELECT, SHOW, DESCRIBE) — won't run DDL or DML
  • RW: Data modifications, DDL (CREATE, ALTER, DROP) — default for most operations
  • RESEARCH: Read + web access, no writes
  • DEPLOY: Full access (use sparingly)

Default to RW unless the request is clearly read-only.

python "${CLAUDE_PLUGIN_ROOT}/scripts/router/execute_cortex.py" \
  --prompt "USER_PROMPT_HERE" \
  --envelope "RW"

Add --connection CONNECTION_NAME if a specific Snowflake connection is needed.

Multi-turn: --resume-last vs fresh

Every cortex invocation returns a session_id that the router persists. Follow-up turns can resume that session so Cortex sees the prior conversation -- real multi-turn, not one-shot batches per prompt.

Read the full file on GitHub · 100 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 100 lines · 36 tokens per session scan A dec62244b069

Subscribe to this mod's changes

cortex-router is a skill published in the GitHub repository Snowflake-Labs/snowflake-ai-kit (37 stars, last pushed 25d ago), licensed Apache-2.0. It adds 36 tokens to every session and 975 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.