<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Daniel Myers</title>
    <description>The latest articles on Forem by Daniel Myers (@jdanielmyers).</description>
    <link>https://forem.com/jdanielmyers</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F388129%2F6fa7ab32-32b2-450e-b996-5754b8f90907.png</url>
      <title>Forem: Daniel Myers</title>
      <link>https://forem.com/jdanielmyers</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jdanielmyers"/>
    <language>en</language>
    <item>
      <title>The data engineer's Cortex Code cheat sheet</title>
      <dc:creator>Daniel Myers</dc:creator>
      <pubDate>Thu, 26 Mar 2026 18:06:57 +0000</pubDate>
      <link>https://forem.com/snowflake/the-data-engineers-cortex-code-cheat-sheet-3b60</link>
      <guid>https://forem.com/snowflake/the-data-engineers-cortex-code-cheat-sheet-3b60</guid>
      <description>&lt;p&gt;&lt;em&gt;A practical guide to the commands, prompts, patterns, and habits that make Cortex Code useful in real data work.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.snowflake.com/en/product/features/cortex-code/?utm_source=DEV&amp;amp;utm_campaign=cocoday" rel="noopener noreferrer"&gt;Cortex Code&lt;/a&gt; is a data-native coding agent that works directly against your data environment. It sees schemas, roles, grants, tags, lineage, query history, semantic models, and the live shape of the data you are trying not to break.&lt;/p&gt;

&lt;p&gt;Your SQL lives in a repo. Your &lt;code&gt;dbt&lt;/code&gt; models live in a repo. Your DAGs live in a repo. But the work usually fails or succeeds somewhere else: in the data itself, in the state of the platform, and in the operational rules wrapped around it.&lt;/p&gt;

&lt;p&gt;That is where Cortex Code is useful. It can work against the same environment your code depends on instead of treating the repo as the whole system.&lt;/p&gt;

&lt;p&gt;This post is a field guide for data engineers who want to use Cortex Code every day. It focuses on the commands, prompts, &lt;code&gt;dbt&lt;/code&gt; workflows, Airflow patterns, &lt;code&gt;AGENTS.md&lt;/code&gt;, and Skills that are worth keeping close at hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the right mental model
&lt;/h2&gt;

&lt;p&gt;The point of Cortex Code is not "SQL autocomplete, but fancier."&lt;/p&gt;

&lt;p&gt;The point is that it can work against your Snowflake environment, not just the files on disk.&lt;/p&gt;

&lt;p&gt;That changes what is possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can ask for tables by business concept instead of object name.
&lt;/li&gt;
&lt;li&gt;You can ask why a role cannot read an object instead of manually spelunking grants.
&lt;/li&gt;
&lt;li&gt;You can edit a &lt;code&gt;dbt&lt;/code&gt; model, run the smallest safe build, compare dev and prod, and leave behind a validation query.
&lt;/li&gt;
&lt;li&gt;You can ask for cost and governance answers using account context.
&lt;/li&gt;
&lt;li&gt;You can package a good workflow as a reusable Skill instead of repeating the same ten-step ritual forever.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the job depends on Snowflake account state, Cortex Code should be in the loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Cortex Code is unusually good at data work
&lt;/h2&gt;

&lt;p&gt;There are a few reasons it fits data engineering better than generic coding agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It understands Snowflake objects, roles, schemas, and SQL semantics.
&lt;/li&gt;
&lt;li&gt;It can search Snowflake objects and documentation directly.
&lt;/li&gt;
&lt;li&gt;It has direct SQL execution instead of forcing you to copy SQL into another tool.
&lt;/li&gt;
&lt;li&gt;It can work in &lt;code&gt;Snowsight&lt;/code&gt; for discovery, admin, and workspace tasks.
&lt;/li&gt;
&lt;li&gt;It can work in the CLI for local repo work, &lt;code&gt;dbt&lt;/code&gt;, &lt;code&gt;git&lt;/code&gt;, shell commands, Airflow, Skills, and automation.
&lt;/li&gt;
&lt;li&gt;It works within Snowflake RBAC and the CLI's approval modes. That matters when your day job includes production data and access boundaries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repo-only agents are still valuable. I use them. But for data engineering, repo context is only half the picture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get your setup right once
&lt;/h2&gt;

&lt;p&gt;The daily experience gets much better if you spend ten minutes on setup instead of winging it.&lt;/p&gt;

&lt;p&gt;Before you start, install the Snowflake CLI (&lt;code&gt;snow&lt;/code&gt;). Cortex Code CLI shares the same Snowflake connection setup and &lt;code&gt;~/.snowflake/connections.toml&lt;/code&gt; file. Also make sure you are on a supported platform for Cortex Code CLI per the official docs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install the CLI
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-LsS&lt;/span&gt; https://ai.snowflake.com/static/cc-scripts/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are on Windows, use the PowerShell installer from the official docs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;irm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;https://ai.snowflake.com/static/cc-scripts/install.ps1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start it with a specific connection and working directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex &lt;span class="nt"&gt;-c&lt;/span&gt; dev &lt;span class="nt"&gt;-w&lt;/span&gt; ~/src/analytics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Resume the last session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex &lt;span class="nt"&gt;--continue&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run a one-off prompt from the shell:&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;-p&lt;/code&gt; for quick one-off prompts if your account supports print mode. Subscription and trial accounts block &lt;code&gt;-p&lt;/code&gt; / &lt;code&gt;--print&lt;/code&gt;, so in those environments you should start &lt;code&gt;cortex -c dev&lt;/code&gt; and run the same request interactively.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex &lt;span class="nt"&gt;-c&lt;/span&gt; dev &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"List every table tagged PII = TRUE in ANALYTICS_DB"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Enable the right roles and model access
&lt;/h3&gt;

&lt;p&gt;The exact role setup depends on which surface you use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Cortex Code CLI&lt;/code&gt;: start with &lt;code&gt;SNOWFLAKE.CORTEX_USER&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Cortex Code in Snowsight&lt;/code&gt;: grant &lt;code&gt;SNOWFLAKE.COPILOT_USER&lt;/code&gt; plus &lt;code&gt;SNOWFLAKE.CORTEX_USER&lt;/code&gt; or &lt;code&gt;SNOWFLAKE.CORTEX_AGENT_USER&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you use both, the simplest baseline is &lt;code&gt;COPILOT_USER&lt;/code&gt; plus &lt;code&gt;CORTEX_USER&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="n"&gt;ACCOUNT&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;CORTEX_ENABLED_CROSS_REGION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'AWS_US'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;SNOWFLAKE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CORTEX_USER&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;DATA_ENGINEER&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- If you use Cortex Code in Snowsight:&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;SNOWFLAKE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;COPILOT_USER&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;DATA_ENGINEER&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Optional, depending on your org's access model for agentic workflows:&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;SNOWFLAKE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CORTEX_AGENT_USER&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;DATA_ENGINEER&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;ALTER ACCOUNT&lt;/code&gt; statement must be run by &lt;code&gt;ACCOUNTADMIN&lt;/code&gt;. Replace &lt;code&gt;AWS_US&lt;/code&gt; with the region setting your account needs. If your organization restricts model access, make sure the required models are allowed and cross-region inference is enabled for the region you actually need.&lt;/p&gt;

&lt;p&gt;One extra nuance: some accounts inherit &lt;code&gt;SNOWFLAKE.CORTEX_USER&lt;/code&gt; through &lt;code&gt;PUBLIC&lt;/code&gt; unless it has been revoked, so do not assume a missing explicit grant always means a missing effective permission.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create separate connections for dev and prod-readonly
&lt;/h3&gt;

&lt;p&gt;Do this once. Future you will thank you.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/.snowflake/connections.toml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[dev]&lt;/span&gt;
&lt;span class="py"&gt;account&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"myorg-myaccount"&lt;/span&gt;
&lt;span class="py"&gt;user&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"you@example.com"&lt;/span&gt;
&lt;span class="py"&gt;authenticator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"externalbrowser"&lt;/span&gt;
&lt;span class="py"&gt;warehouse&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"DEV_WH"&lt;/span&gt;
&lt;span class="py"&gt;role&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"DATA_ENGINEER"&lt;/span&gt;
&lt;span class="py"&gt;database&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"ANALYTICS"&lt;/span&gt;
&lt;span class="py"&gt;schema&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"PUBLIC"&lt;/span&gt;

&lt;span class="nn"&gt;[prod_readonly]&lt;/span&gt;
&lt;span class="py"&gt;account&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"myorg-myaccount"&lt;/span&gt;
&lt;span class="py"&gt;user&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"you@example.com"&lt;/span&gt;
&lt;span class="py"&gt;authenticator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"externalbrowser"&lt;/span&gt;
&lt;span class="py"&gt;warehouse&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"PROD_WH"&lt;/span&gt;
&lt;span class="py"&gt;role&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"ANALYST"&lt;/span&gt;
&lt;span class="py"&gt;database&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"ANALYTICS"&lt;/span&gt;
&lt;span class="py"&gt;schema&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"PUBLIC"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can be explicit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex &lt;span class="nt"&gt;-c&lt;/span&gt; dev &lt;span class="nt"&gt;-w&lt;/span&gt; ~/src/analytics
cortex &lt;span class="nt"&gt;-c&lt;/span&gt; prod_readonly &lt;span class="nt"&gt;-w&lt;/span&gt; ~/src/analytics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one habit prevents a surprising amount of nonsense.&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands worth memorizing
&lt;/h2&gt;

&lt;p&gt;These are the ones I would actually keep handy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Startup patterns
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex
cortex &lt;span class="nt"&gt;-c&lt;/span&gt; dev
cortex &lt;span class="nt"&gt;-c&lt;/span&gt; dev &lt;span class="nt"&gt;-w&lt;/span&gt; ~/src/analytics
cortex &lt;span class="nt"&gt;--continue&lt;/span&gt;
cortex &lt;span class="nt"&gt;--plan&lt;/span&gt;
cortex &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"Explain why this query is slow and optimize it"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  CLI slash commands that matter for data engineers
&lt;/h3&gt;

&lt;p&gt;These are &lt;code&gt;Cortex Code CLI&lt;/code&gt; commands. In &lt;code&gt;Snowsight&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt; is mainly for built-in and personal skills, not the full CLI slash-command surface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/plan
/status
/sql
/sh
/conn
/diff
/fdbt
/lineage
/worktree
/skill
/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Airflow commands worth knowing
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex airflow health
cortex airflow dags list
cortex airflow dags get my_pipeline
cortex airflow dags &lt;span class="nb"&gt;source &lt;/span&gt;my_pipeline
cortex airflow runs trigger my_pipeline
cortex airflow runs list my_pipeline
cortex airflow tasks list my_pipeline &amp;lt;run_id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Make the CLI fit your team
&lt;/h2&gt;

&lt;p&gt;You do not need a huge amount of local configuration, but a little goes a long way.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/.snowflake/cortex/settings.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"defaultViewMode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"compact"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"autoUpdate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"theme"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dark"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;~/.snowflake/cortex/settings.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"permissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"defaultMode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ask"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dangerouslyAllowAll"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That keeps the CLI terse and keeps permission prompts on by default. &lt;code&gt;permissions.json&lt;/code&gt; is better thought of as the remembered approval cache, not the main place to set those defaults.&lt;/p&gt;

&lt;p&gt;If your team wants shared repo behavior, use &lt;code&gt;AGENTS.md&lt;/code&gt; for project rules and Skills for repeatable workflows. If your organization wants harder controls, use managed settings instead of relying on everybody to configure the CLI the same way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Snowsight versus CLI
&lt;/h2&gt;

&lt;p&gt;Use both. They are not competing surfaces.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Surface&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Cortex Code in Snowsight&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;SQL authoring, quick catalog discovery, dbt Projects on Snowflake, permissions questions, governance, FinOps, quick query fixes, &lt;code&gt;@&lt;/code&gt;-based object context, diff review in Workspaces&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Cortex Code CLI&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;local &lt;code&gt;dbt&lt;/code&gt; repos, local files, &lt;code&gt;git&lt;/code&gt;, shell commands, validation workflows, Airflow, Skills, &lt;code&gt;AGENTS.md&lt;/code&gt;, repeatable engineering work&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The easy rule is this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start in &lt;code&gt;Snowsight&lt;/code&gt; when you are exploring.
&lt;/li&gt;
&lt;li&gt;Switch to the CLI when you need local files, source control, or repeatable workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Daily workflow 1: find the right data faster
&lt;/h2&gt;

&lt;p&gt;This is where Cortex Code immediately feels different from generic coding agents.&lt;/p&gt;

&lt;p&gt;You are not asking it to write SQL from a blank prompt. You are asking it to navigate the warehouse with you.&lt;/p&gt;

&lt;p&gt;Start with plain English:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Find all tables related to customers that I have write access to.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then narrow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List every table tagged PII = TRUE in ANALYTICS_DB and show the owning roles.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then ask for lineage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Show the lineage from RAW_DB.ORDERS to downstream dashboards.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;Snowsight&lt;/code&gt;, use &lt;code&gt;@&lt;/code&gt; mentions to attach objects directly to the chat context before asking follow-up questions.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@RAW_DB.ORDERS @ANALYTICS_DB.CUSTOMERS
Explain the likely join path between these objects and tell me which columns you would trust for churn analysis.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are in the CLI and want a quick fallback query, use &lt;code&gt;/sql&lt;/code&gt;. In the interactive CLI, use &lt;code&gt;Ctrl+J&lt;/code&gt; for multi-line SQL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;sql&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;table_catalog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;table_schema&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;SNOWFLAKE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ACCOUNT_USAGE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TABLES&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;deleted&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;table_name&lt;/span&gt; &lt;span class="k"&gt;ILIKE&lt;/span&gt; &lt;span class="s1"&gt;'%CUSTOMER%'&lt;/span&gt;
    &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="n"&gt;table_schema&lt;/span&gt; &lt;span class="k"&gt;ILIKE&lt;/span&gt; &lt;span class="s1"&gt;'%CUSTOMER%'&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;created&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generic agents are decent once you hand them the schema. Cortex Code is better when finding the schema is the job.&lt;/p&gt;

&lt;p&gt;One caveat: &lt;code&gt;SNOWFLAKE.ACCOUNT_USAGE.TABLES&lt;/code&gt; is a convenience fallback, not a universal or real-time discovery surface. It depends on your account visibility into &lt;code&gt;ACCOUNT_USAGE&lt;/code&gt;, and those views can lag.&lt;/p&gt;

&lt;h2&gt;
  
  
  Daily workflow 2: stop guessing about permissions
&lt;/h2&gt;

&lt;p&gt;Permissions bugs waste a ridiculous amount of time because they usually look like code bugs at first.&lt;/p&gt;

&lt;p&gt;Useful prompts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What privileges does my role have on this database?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Why am I getting a permissions error on ANALYTICS_DB.CORE.CUSTOMERS?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Show the grants my current role can see for ANALYTICS_DB.CORE.CUSTOMERS, and tell me what extra visibility I would need for a full access audit.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Find all tables that have PII in them.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a good example of where generic coding agents usually stall out. They can explain the idea of RBAC. Cortex Code can help investigate your real Snowflake objects and whatever grants your current role can actually see.&lt;/p&gt;

&lt;h2&gt;
  
  
  Daily workflow 3: use it as a SQL mechanic, not just a generator
&lt;/h2&gt;

&lt;p&gt;One of the best ways to use Cortex Code is to hand it real SQL that already exists and ask it to make that SQL better.&lt;/p&gt;

&lt;h3&gt;
  
  
  Explain and optimize a query
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What does this SQL script do?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Explain why this query is slow and optimize it without changing semantics.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;daily_revenue&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;CAST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;order_day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;daily_revenue&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;ANALYTICS_DB&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MART&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ORDERS&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;DATEADD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;CURRENT_DATE&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt;
  &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;daily_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;daily_revenue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;daily_revenue&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
    &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;
      &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_day&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="n"&gt;DATEADD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_day&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_day&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;rolling_7d_revenue&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;daily_revenue&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_day&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then push further:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Show me the tradeoffs in your rewrite.
If there are multiple good versions, rank them by readability, cost, and likely performance.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;Snowsight&lt;/code&gt;, you can also use the built-in fix flow on failed SQL and then ask follow-up questions in the same context.&lt;/p&gt;

&lt;p&gt;That matters. Good data work is almost never "write one query." It is "write, inspect, fix, rerun, compare."&lt;/p&gt;

&lt;h2&gt;
  
  
  Daily workflow 4: work a dbt project end to end
&lt;/h2&gt;

&lt;p&gt;This is where Cortex Code starts earning permanent terminal space.&lt;/p&gt;

&lt;p&gt;The strongest pattern is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the repo with Cortex Code in the right working directory.
&lt;/li&gt;
&lt;li&gt;Ask for a plan.
&lt;/li&gt;
&lt;li&gt;Make the model change.
&lt;/li&gt;
&lt;li&gt;Run the narrowest possible &lt;code&gt;dbt&lt;/code&gt; selector.
&lt;/li&gt;
&lt;li&gt;Generate proof, not just code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Start the session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex &lt;span class="nt"&gt;-c&lt;/span&gt; dev &lt;span class="nt"&gt;-w&lt;/span&gt; ~/src/analytics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then turn on planning mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then give it a concrete task:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Update models/marts/fct_customer_revenue.sql to include refunded_amount.
Run the smallest safe dbt build for the affected graph.
If tests fail, fix the model or tests.
Then write a validation query comparing dev and prod totals for the last 30 days.
Save the validation SQL in analysis/refunded_amount_check.sql.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a better prompt than "add refunded amount" because it asks for the full workflow, including proof.&lt;/p&gt;

&lt;h3&gt;
  
  
  Give Cortex Code repo rules with AGENTS.md
&lt;/h3&gt;

&lt;p&gt;This is one of the highest leverage things you can do for &lt;code&gt;dbt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# analytics repo rules&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Always use fully qualified object names in generated SQL unless the model style already abstracts them.
&lt;span class="p"&gt;-&lt;/span&gt; For changes to marts, metrics, or business logic, generate a validation query in &lt;span class="sb"&gt;`analysis/`&lt;/span&gt;.
&lt;span class="p"&gt;-&lt;/span&gt; Prefer &lt;span class="sb"&gt;`TRY_TO_*`&lt;/span&gt; functions for raw ingestion cleanup.
&lt;span class="p"&gt;-&lt;/span&gt; For model changes, start with &lt;span class="sb"&gt;`dbt build -s "&amp;lt;changed_model&amp;gt;+"`&lt;/span&gt; to validate the changed model and downstream dependents. Use &lt;span class="sb"&gt;`dbt ls -s "+&amp;lt;changed_model&amp;gt;"`&lt;/span&gt; when you want to inspect upstream ancestors first.
&lt;span class="p"&gt;-&lt;/span&gt; Add or update schema tests for every new key, enum, or non-null business field.
&lt;span class="p"&gt;-&lt;/span&gt; Never use production roles for write operations.
&lt;span class="p"&gt;-&lt;/span&gt; When a change touches finance metrics, compare dev and prod for at least the last 30 days.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Cortex Code has your rules before it starts making changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ask it to reason across model, graph, and warehouse
&lt;/h3&gt;

&lt;p&gt;Good &lt;code&gt;dbt&lt;/code&gt; prompts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a new staging model for RAW.CUSTOMERS that handles duplicates, mixed-case email, malformed dates, and empty-string fields.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Analyze this dbt project and identify the smallest set of models I need to run after changing fct_customer_revenue.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Show me the upstream and downstream graph for this model and tell me where a breaking change would hurt the most.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review the failing dbt tests and tell me whether the bug is in the model, test assumptions, or source data.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Keep shell access in the loop
&lt;/h3&gt;

&lt;p&gt;Sometimes the best pattern is conversational reasoning plus direct shell execution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/sh dbt build &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"fct_customer_revenue+"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/sh dbt &lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"+fct_customer_revenue"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/sh dbt docs generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first command validates the changed model plus downstream dependents. The second shows upstream ancestry so you can inspect dependencies before you widen the blast radius.&lt;/p&gt;

&lt;p&gt;If you want to stay in shell mode for a while, run &lt;code&gt;/sh&lt;/code&gt; with no arguments. The CLI switches into terminal mode and treats subsequent input as shell commands until you exit that mode.&lt;/p&gt;

&lt;p&gt;If you want lineage help, call it out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/lineage fct_customer_revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Based on the lineage, which models should I validate manually before merging this change?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Daily workflow 5: use Cortex Code to tune slow dbt models
&lt;/h2&gt;

&lt;p&gt;The internal Snowflake examples here are especially strong.&lt;/p&gt;

&lt;p&gt;The useful prompt pattern is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Analyze our dbt project, identify the slowest-running models, suggest specific optimizations, and flag any models that are not used downstream that we could drop.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That can surface things people usually do not revisit once the pipeline "works":&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bad materialization choices
&lt;/li&gt;
&lt;li&gt;unnecessary joins
&lt;/li&gt;
&lt;li&gt;stale models with no downstream value
&lt;/li&gt;
&lt;li&gt;incremental models that should not be full-refreshing
&lt;/li&gt;
&lt;li&gt;models that should probably be split&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best move after a good optimization pass is to turn it into a Skill.&lt;/p&gt;

&lt;h2&gt;
  
  
  Daily workflow 6: convert one-off work into Skills
&lt;/h2&gt;

&lt;p&gt;This is one of the differentiators that gets overlooked.&lt;/p&gt;

&lt;p&gt;If you do the same debugging or optimization dance every week, package it.&lt;/p&gt;

&lt;p&gt;For a local repo or CLI workflow, project skills live under &lt;code&gt;.cortex/skills/&lt;/code&gt;. In &lt;code&gt;Snowsight&lt;/code&gt; Workspaces, personal skills live under &lt;code&gt;.snowflake/cortex/skills&lt;/code&gt; in that workspace and are only available there.&lt;/p&gt;

&lt;p&gt;Create the directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; .cortex/skills/dbt-slow-model-audit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add &lt;code&gt;SKILL.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dbt-slow-model-audit&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Find slow dbt models and propose safe optimizations&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="c1"&gt;# When to use&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;The user wants to reduce runtime or credits in a dbt project.&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;The user suspects one or more models are bottlenecks.&lt;/span&gt;

&lt;span class="c1"&gt;# Instructions&lt;/span&gt;

&lt;span class="s"&gt;1. Identify the slowest models using available dbt artifacts or warehouse history.&lt;/span&gt;
&lt;span class="s"&gt;2. Inspect materialization strategy, joins, filters, and incremental logic.&lt;/span&gt;
&lt;span class="s"&gt;3. Flag unused downstream models that may be removable.&lt;/span&gt;
&lt;span class="s"&gt;4. Propose the smallest set of changes that will improve runtime safely.&lt;/span&gt;
&lt;span class="s"&gt;5. Generate a validation plan and save findings in `analysis/dbt_slow_model_audit.md`.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example keeps the frontmatter minimal on purpose. &lt;code&gt;tools:&lt;/code&gt; is optional. If you want to lock a Skill to a specific tool set, use the exact tool identifiers from the current Cortex Code docs or a known working Skill repo. Also note that the CLI's custom-skill model is the most fully documented path today. In &lt;code&gt;Snowsight&lt;/code&gt;, stick to documented personal skills.&lt;/p&gt;

&lt;p&gt;List available Skills:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex skill list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside a session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/skill
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is how you turn "that smart thing the agent did once" into a team workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Daily workflow 7: use the built-in Airflow support
&lt;/h2&gt;

&lt;p&gt;If your world includes Airflow, Cortex Code gets more interesting than a generic Python helper.&lt;/p&gt;

&lt;p&gt;This assumes you have already configured an Airflow instance for Cortex Code and installed &lt;code&gt;uv&lt;/code&gt;, as Snowflake's &lt;code&gt;Using Apache Airflow with Cortex Code CLI&lt;/code&gt; docs require.&lt;/p&gt;

&lt;p&gt;One implementation detail worth knowing: &lt;code&gt;cortex airflow&lt;/code&gt; is a passthrough wrapper around the Airflow helper Snowflake ships with Cortex Code. Treat the examples below as practical command patterns, not as a separately documented native command grammar owned entirely by the main CLI.&lt;/p&gt;

&lt;p&gt;Useful commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex airflow health
cortex airflow dags list
cortex airflow dags get daily_etl
cortex airflow dags &lt;span class="nb"&gt;source &lt;/span&gt;daily_etl
cortex airflow runs trigger daily_etl
cortex airflow runs list daily_etl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful prompts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Why did my_pipeline fail last night?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a DAG that extracts from Snowflake and loads to S3 daily.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Set up my dbt project to run in Airflow using Cosmos.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Migrate my DAGs from Airflow 2 to Airflow 3.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a good example of Cortex Code's advantage. A generic coding agent can write DAG code. Cortex Code can reason about the DAG, the Airflow instance, and the Snowflake side of the workflow in one place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Daily workflow 8: use Snowsight when you want fewer tabs
&lt;/h2&gt;

&lt;p&gt;Do not force everything through the CLI.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Snowsight&lt;/code&gt; is excellent for the stuff people usually break flow for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;quick SQL authoring
&lt;/li&gt;
&lt;li&gt;finding the right table or column
&lt;/li&gt;
&lt;li&gt;fixing failed SQL
&lt;/li&gt;
&lt;li&gt;checking user and role access
&lt;/li&gt;
&lt;li&gt;cost and usage questions
&lt;/li&gt;
&lt;li&gt;iterating on code in Workspaces with diff review&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example prompts that work well in &lt;code&gt;Snowsight&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What databases do I have access to?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;Write&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;revenue&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;day&lt;/span&gt; &lt;span class="n"&gt;moving&lt;/span&gt; &lt;span class="n"&gt;average&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which 5 service types are using the most credits? Show me a visualization and how to reduce costs.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Find all tables that have PII in them.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The strongest &lt;code&gt;Snowsight&lt;/code&gt; feature for day-to-day engineering work might be the simple one: you stay inside the same environment where you are already writing and running the query.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Cortex Code is differentiated for Snowflake-heavy work
&lt;/h2&gt;

&lt;p&gt;This is the part people care about, so here is the blunt version. These are practical workflow comparisons, not vendor benchmarks. What a generic coding agent can do depends heavily on how you have integrated it with shells, databases, MCP servers, and other tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  When Cortex Code wins
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Generic coding agent&lt;/th&gt;
&lt;th&gt;Cortex Code advantage&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Find the right table when you only know the business concept&lt;/td&gt;
&lt;td&gt;Without Snowflake-aware integration, often needs schema pasted in or separate metadata queries&lt;/td&gt;
&lt;td&gt;Can search Snowflake objects and docs directly, with tags and lineage surfaced when available&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debug a role or grant problem&lt;/td&gt;
&lt;td&gt;Can explain RBAC patterns, but usually needs live Snowflake access to inspect real grants&lt;/td&gt;
&lt;td&gt;Can help investigate grants and access questions using your current Snowflake visibility&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tune a query that is slow in your warehouse&lt;/td&gt;
&lt;td&gt;Can reason from SQL text, but usually needs Snowflake access wired in for warehouse-specific answers&lt;/td&gt;
&lt;td&gt;Can work from Snowflake context, docs, and account-aware patterns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edit a &lt;code&gt;dbt&lt;/code&gt; model and prove the change is safe&lt;/td&gt;
&lt;td&gt;Good at code edits, but may be blind to live Snowflake state unless you wire queries and tools into the workflow&lt;/td&gt;
&lt;td&gt;Can help with SQL, &lt;code&gt;dbt&lt;/code&gt;, validation queries, and Snowflake-side proof in one workflow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Decide between model patterns on Snowflake&lt;/td&gt;
&lt;td&gt;General advice unless it can inspect Snowflake objects and docs&lt;/td&gt;
&lt;td&gt;Snowflake-aware guidance for semantic objects, platform behavior, and role-aware execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Build a data workflow that touches SQL, files, shell, and account state&lt;/td&gt;
&lt;td&gt;Works if you integrate shell, DB, and metadata tools; less native out of the box&lt;/td&gt;
&lt;td&gt;Native fit for mixed data-engineering workflows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Airflow plus Snowflake debugging&lt;/td&gt;
&lt;td&gt;Strong on Python, depends on Airflow and Snowflake integrations for live instance context&lt;/td&gt;
&lt;td&gt;Built-in Airflow support plus Snowflake-aware reasoning&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The simplest summary still holds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the answer depends on your Snowflake account, reach for Cortex Code.
&lt;/li&gt;
&lt;li&gt;If the answer depends on a large non-Snowflake codebase or frontend stack, a generic coding agent may be a better first tool.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When generic agents still win
&lt;/h3&gt;

&lt;p&gt;Be honest about this. Cortex Code is not the best tool for everything.&lt;/p&gt;

&lt;p&gt;Use Cursor, Claude Code, or Codex first when you are doing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;frontend work
&lt;/li&gt;
&lt;li&gt;framework-heavy app scaffolding
&lt;/li&gt;
&lt;li&gt;polyglot refactors across large non-Snowflake services
&lt;/li&gt;
&lt;li&gt;local codebase reasoning where warehouse context does not matter&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The happy path for most teams is not replacement. It is pairing.&lt;/p&gt;

&lt;p&gt;Use your favorite generic coding agent for repo-wide engineering. Use Cortex Code when the work turns into data engineering instead of pure software engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  Safety habits
&lt;/h2&gt;

&lt;p&gt;If you want to use Cortex Code seriously, a few habits go a long way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use planning mode on anything non-trivial
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is especially useful before schema changes, broad &lt;code&gt;dbt&lt;/code&gt; runs, and anything that touches production objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep a readonly prod connection
&lt;/h3&gt;

&lt;p&gt;Do not make the agent safe through vibes. Make it safe through connections and roles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Review diffs and proposed writes
&lt;/h3&gt;

&lt;p&gt;This sounds obvious, but it is the line between "useful accelerator" and "expensive story."&lt;/p&gt;

&lt;h3&gt;
  
  
  Put repo rules in &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Do not rely on the model to guess your team's validation and rollout standards.&lt;/p&gt;

&lt;h3&gt;
  
  
  Package sensitive workflows as Skills
&lt;/h3&gt;

&lt;p&gt;That gives you repeatability and makes the steps inspectable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid routine &lt;code&gt;ACCOUNTADMIN&lt;/code&gt; use
&lt;/h3&gt;

&lt;p&gt;If you need elevated setup, do it deliberately. Do not turn that into the default development posture.&lt;/p&gt;

&lt;h2&gt;
  
  
  A prompt pack worth stealing
&lt;/h2&gt;

&lt;p&gt;These are the prompts I would actually keep around.&lt;/p&gt;

&lt;h3&gt;
  
  
  Discovery and governance
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Find all tables related to customers that I have write access to.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List every table tagged PII = TRUE in ANALYTICS_DB and show the owning roles.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Show the lineage from RAW_DB.ORDERS to downstream dashboards.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Why am I getting a permissions error on ANALYTICS_DB.CORE.CUSTOMERS?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  SQL and performance
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What does this SQL script do?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Explain why this query is slow and optimize it without changing semantics.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;Write&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;revenue&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="k"&gt;add&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;day&lt;/span&gt; &lt;span class="n"&gt;moving&lt;/span&gt; &lt;span class="n"&gt;average&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  dbt
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;Create&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;staging&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;RAW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CUSTOMERS&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;handles&lt;/span&gt; &lt;span class="n"&gt;duplicates&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;malformed&lt;/span&gt; &lt;span class="n"&gt;dates&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;empty&lt;/span&gt; &lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;mixed&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;emails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;Update&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;marts&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;fct_customer_revenue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;sql&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="n"&gt;include&lt;/span&gt; &lt;span class="n"&gt;refunded_amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;smallest&lt;/span&gt; &lt;span class="n"&gt;safe&lt;/span&gt; &lt;span class="n"&gt;dbt&lt;/span&gt; &lt;span class="n"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;generate&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;versus&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;prod&lt;/span&gt; &lt;span class="n"&gt;validation&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Analyze this dbt project, identify the slowest-running models, and suggest the smallest safe changes to reduce runtime and credits.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Airflow
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Why did my_pipeline fail last night?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a DAG that extracts from Snowflake and loads to S3 daily.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Set up my dbt project to run in Airflow using Cosmos.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Skills and repeatability
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In a local repo, turn this repeated optimization workflow into a Skill and save it in .cortex/skills/dbt-slow-model-audit.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The real differentiator
&lt;/h2&gt;

&lt;p&gt;The best way to think about Cortex Code is is better workflow compression for data work.&lt;/p&gt;

&lt;p&gt;That is what shows up again and again in the strong use cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dbt&lt;/code&gt; changes plus tests plus validation
&lt;/li&gt;
&lt;li&gt;schema discovery plus lineage plus governance
&lt;/li&gt;
&lt;li&gt;query tuning plus account context
&lt;/li&gt;
&lt;li&gt;Airflow plus Snowflake debugging
&lt;/li&gt;
&lt;li&gt;repeated workflows converted into Skills&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why it feels different from a repo-only agent. It is not just helping you write the step you are on. It is helping you get through the whole chain without losing context.&lt;/p&gt;

&lt;p&gt;If you are a data engineer, that is the part worth caring about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code" rel="noopener noreferrer"&gt;Cortex Code overview&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli" rel="noopener noreferrer"&gt;Cortex Code CLI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/cli-reference" rel="noopener noreferrer"&gt;Cortex Code CLI reference&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-snowsight" rel="noopener noreferrer"&gt;Cortex Code in Snowsight&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/workflows" rel="noopener noreferrer"&gt;Cortex Code CLI workflow examples&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/extensibility" rel="noopener noreferrer"&gt;Cortex Code CLI extensibility&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/airflow" rel="noopener noreferrer"&gt;Using Apache Airflow with Cortex Code CLI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/security" rel="noopener noreferrer"&gt;Security best practices for Cortex Code CLI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cortexcode</category>
      <category>snowflake</category>
      <category>ai</category>
      <category>dataengineering</category>
    </item>
  </channel>
</rss>
