<?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>DEV Community: Snowflake</title>
    <description>The latest articles on DEV Community by Snowflake (@snowflake).</description>
    <link>https://dev.to/snowflake</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%2Forganization%2Fprofile_image%2F2752%2F990980ef-b91b-4242-96e7-8534d4fd1c71.png</url>
      <title>DEV Community: Snowflake</title>
      <link>https://dev.to/snowflake</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/snowflake"/>
    <language>en</language>
    <item>
      <title>I built a remote control for Cortex Code in Slack so I can step away from my laptop</title>
      <dc:creator>Dash</dc:creator>
      <pubDate>Mon, 13 Apr 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/snowflake/i-built-a-remote-control-for-cortex-code-in-slack-so-i-can-step-away-from-my-laptop-2dag</link>
      <guid>https://dev.to/snowflake/i-built-a-remote-control-for-cortex-code-in-slack-so-i-can-step-away-from-my-laptop-2dag</guid>
      <description>&lt;h2&gt;
  
  
  Snowflake Cortex Code CLI Meets Slack
&lt;/h2&gt;

&lt;p&gt;Cortex Code CLI is Snowflake's AI coding agent that runs in your terminal. It can write code, execute SQL and DDL scripts, create and deploy data pipelines, generate dashboards, reads &amp;amp; write files, manages git repos and more.&lt;/p&gt;

&lt;p&gt;Cortex Code CLI also has a hook system and skill framework that make it extensible so you can build sidecar apps that plug into its lifecycle. I wanted to explore this extensibility by building a Slack bridge: get DM notifications about what the agent is doing, and reply with instructions to steer it, all from your phone. The whole conversation happens in Slack while the agent keeps working in the terminal. No servers, no databases, no cloud infra. Just a Slack bot, some JSON files, and a shell wrapper.&lt;/p&gt;

&lt;h3&gt;
  
  
  What It Actually Does
&lt;/h3&gt;

&lt;p&gt;It supports two interaction patterns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Free-text conversations:&lt;/strong&gt; You type a message in the Slack DM. It lands in a session-specific inbox file. The agent's cron job picks it up on the next cycle and treats it as user input. This is the core of the bridge — you can ask questions (“what's the row count on that table?”), give instructions (“skip that step and move to the next one”), make decisions (“use approach #2”), or redirect the work entirely (“actually, focus on the API layer first”). The agent responds back via Slack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notifications:&lt;/strong&gt; The agent sends you status updates as Slack DMs. “Feature engineering done, 5 tables created.” “Model training complete, 3 models evaluated.” “Blog post committed and pushed.” You see them on your phone and know what's happening without being at the terminal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This bridge works best with “bypass safeguards” enabled in Cortex Code CLI, which lets the agent execute tools without pausing for terminal confirmations. That's what makes the remote workflow possible; if the agent stopped to ask for permission at the terminal, you'd have to be sitting there anyway.&lt;/p&gt;

&lt;p&gt;But understand the tradeoff: bypass safeguards means the agent can execute bash commands, write files, run SQL, and push to git without asking first. You're trusting the agent to do the right thing. The Slack bridge gives you visibility (notifications) and steering (free-text replies), but it doesn't replace the confirmation gate — it replaces the terminal. Use it on repos and environments where you're comfortable with that level of autonomy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Design Decisions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Socket Mode:&lt;/strong&gt; No public URLs needed. The bot connects outbound to Slack's WebSocket API. Works behind firewalls, no ngrok required.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File-based inbox:&lt;/strong&gt; Each Cortex Code CLI session gets its own &lt;code&gt;inbox_{session_id}.json&lt;/code&gt;. The bridge bot writes to it; the CLI polls it via cron. Dead simple, zero dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metadata routing:&lt;/strong&gt; Every outbound Slack message includes session metadata. When you reply, Slack sends that metadata back. The bridge uses it to write to the correct session's inbox. Multiple sessions, no crosstalk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sidecar process:&lt;/strong&gt; The bridge bot runs as a background process, started automatically by a SessionStart hook. It's not embedded in Cortex Code CLI ; it's a separate Python process that communicates via the filesystem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Code
&lt;/h3&gt;

&lt;p&gt;The project has four main files.&lt;/p&gt;

&lt;h4&gt;
  
  
  1) config.py: Configuration and Session Management
&lt;/h4&gt;

&lt;p&gt;It handles paths, tokens, and multi-session routing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;BRIDGE_DIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;home&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.cortex-slack-bridge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;INBOX_FILE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BRIDGE_DIR&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;inbox.json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;PID_FILE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BRIDGE_DIR&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bridge.pid&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Token lookup follows a priority chain: environment variable &amp;gt; macOS Keychain &amp;gt; config file. Env vars (&lt;code&gt;SLACK_BRIDGE_APP_TOKEN&lt;/code&gt;, &lt;code&gt;SLACK_BRIDGE_BOT_TOKEN&lt;/code&gt;) are checked first, then Keychain via the &lt;code&gt;security&lt;/code&gt; CLI, then &lt;code&gt;~/.cortex-slack-bridge/config.json&lt;/code&gt; as a fallback. The Keychain path means tokens never sit in plain text on disk:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;KEYCHAIN_SERVICE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;coco-slack-bridge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;keychain_get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;security&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;find-generic-password&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-s&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;KEYCHAIN_SERVICE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-a&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-w&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="n"&gt;capture_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;returncode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nf"&gt;except &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;FileNotFoundError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TimeoutExpired&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zero new dependencies; just the &lt;code&gt;security&lt;/code&gt; CLI that ships with macOS. Session management is minimal: &lt;code&gt;get_session_inbox()&lt;/code&gt; returns the inbox path for a session ID, and &lt;code&gt;set_active_session()&lt;/code&gt; / &lt;code&gt;get_active_session()&lt;/code&gt; track which session the bridge should route messages to when there's no metadata to go on.&lt;/p&gt;

&lt;h4&gt;
  
  
  2) bridge.py: The Socket Mode Bot
&lt;/h4&gt;

&lt;p&gt;This is the long-running process. It connects to Slack via Socket Mode so when you type in the Slack DM, it captures the text and writes it to the active session's inbox:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle_dm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;say&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;subtype&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;target_user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;

    &lt;span class="nf"&gt;_append_inbox&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;reply&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="c1"&gt;# ...
&lt;/span&gt;    &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="nf"&gt;say&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Message sent to CoCo CLI. Awaiting response…&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both &lt;code&gt;bridge.py&lt;/code&gt; and &lt;code&gt;notify.py&lt;/code&gt; append every message to &lt;code&gt;~/.cortex-slack-bridge/history.jsonl&lt;/code&gt; which acts as a permanent audit trail. Inbound DMs, outbound notifications, consumed confirmations — everything gets logged with direction and timestamp.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_log_history&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;direction&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;direction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;logged_at&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;
        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;HISTORY_FILE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;a&lt;/span&gt;&lt;span class="sh"&gt;"&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;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt; &lt;span class="c1"&gt;# history logging done not break core functionality
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three direction values: &lt;code&gt;inbound&lt;/code&gt; (user DMs and button clicks), &lt;code&gt;outbound&lt;/code&gt; (agent notifications and confirmation requests), &lt;code&gt;consumed&lt;/code&gt; (confirmation responses popped from the inbox).&lt;/p&gt;

&lt;h4&gt;
  
  
  3) notify.py: Sending Messages
&lt;/h4&gt;

&lt;p&gt;This is the outbound side. The main function is &lt;code&gt;send_message()&lt;/code&gt; — it sends a plain DM or a color-coded message (blue for status, green for success, yellow for warnings, red for errors). Every message includes session metadata so replies route back correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;event_type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cortex_bridge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;event_payload&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;session_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sid&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's also a &lt;code&gt;send_confirmation()&lt;/code&gt; function that sends Approve/Deny buttons and polls the inbox for a response. It's used by &lt;code&gt;coco-bridge confirm&lt;/code&gt; for scripted gate checks.&lt;/p&gt;

&lt;h4&gt;
  
  
  4) bin/coco-bridge: The Shell Wrapper
&lt;/h4&gt;

&lt;p&gt;A bash script that makes everything easy to use from Cortex Code CLI's skill system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;coco-bridge start          &lt;span class="c"&gt;# Start the bridge bot&lt;/span&gt;
coco-bridge stop           &lt;span class="c"&gt;# Stop it&lt;/span&gt;
coco-bridge status         &lt;span class="c"&gt;# Check if running&lt;/span&gt;
coco-bridge send &lt;span class="s2"&gt;"message"&lt;/span&gt; &lt;span class="c"&gt;# Send a DM&lt;/span&gt;
coco-bridge send &lt;span class="s2"&gt;"msg"&lt;/span&gt; - &lt;span class="nb"&gt;type &lt;/span&gt;success &lt;span class="c"&gt;# Color-coded&lt;/span&gt;
coco-bridge confirm &lt;span class="s2"&gt;"question"&lt;/span&gt; &lt;span class="c"&gt;# Approve/Deny buttons&lt;/span&gt;
coco-bridge inbox          &lt;span class="c"&gt;# Read inbox contents&lt;/span&gt;
coco-bridge &lt;span class="nb"&gt;history&lt;/span&gt;        &lt;span class="c"&gt;# Last 20 messages (audit log)&lt;/span&gt;
coco-bridge &lt;span class="nb"&gt;history &lt;/span&gt;50     &lt;span class="c"&gt;# Last N messages&lt;/span&gt;
coco-bridge setup-keychain &lt;span class="c"&gt;# Store tokens in macOS Keychain&lt;/span&gt;
coco-bridge clear-keychain &lt;span class="c"&gt;# Remove tokens from Keychain&lt;/span&gt;
coco-bridge logs           &lt;span class="c"&gt;# Tail the log file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It auto-detects the project's virtualenv, manages the PID file, and dispatches to the Python modules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why This Works
&lt;/h3&gt;

&lt;p&gt;Most AI coding agents don't expose lifecycle hooks as in programmatic entry points where your own code runs at specific moments in the agent's execution. Cortex Code CLI does! It has a hook system that fires shell commands at session start, after every tool call, on user input, and at session end. Combined with a skill framework that lets you teach the agent new behaviors via markdown files, you get a real extensibility contract. This Slack bridge exists entirely because of that, and it's worth understanding the two mechanisms that make it work.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Hook System
&lt;/h3&gt;

&lt;p&gt;Cortex Code CLI has a lifecycle hook system defined in &lt;code&gt;~/.snowflake/cortex/hooks.json&lt;/code&gt;. You can register shell commands that fire at specific points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SessionStart:&lt;/strong&gt; runs when a new session begins (before the agent does anything)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PostToolUse:&lt;/strong&gt; fires after every tool call (bash, file write, SQL execution, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UserPromptSubmit:&lt;/strong&gt; fires when the user sends a message&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop:&lt;/strong&gt; fires when the session ends&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SubagentStop:&lt;/strong&gt; fires when a background agent completes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each hook is a shell command with a configurable timeout. The stdout from SessionStart hooks gets passed to the agent as context, which is how the bridge tells Cortex Code CLI “hey, I'm running, ask the user if they want Slack enabled.”&lt;/p&gt;

&lt;p&gt;This is a big deal. It means you can build sidecar applications that plug into Cortex Code CLI's lifecycle without modifying the CLI itself.&lt;/p&gt;

&lt;p&gt;The Slack bridge uses SessionStart to auto-launch. But you could just as easily build:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A PostToolUse hook that logs every tool call to a database (audit trail)&lt;/li&gt;
&lt;li&gt;A UserPromptSubmit hook that captures conversation history (flight recorder)&lt;/li&gt;
&lt;li&gt;A Stop hook that sends a session summary to Slack or email&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Setting It Up
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Prerequisites
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.10+&lt;/li&gt;
&lt;li&gt;A Slack workspace where you can install apps&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.snowflake.com/en/developers/guides/getting-started-with-cortex-code-cli/" rel="noopener noreferrer"&gt;Cortex Code CLI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Create the Slack App
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt; Go to &lt;a href="https://api.slack.com/apps" rel="noopener noreferrer"&gt;api.slack.com/apps&lt;/a&gt; and create a new app&lt;/li&gt;
&lt;li&gt; Under Socket Mode, enable it and create an App-Level Token with &lt;code&gt;connections:write&lt;/code&gt; scope. Copy the &lt;code&gt;xapp-…&lt;/code&gt; token.&lt;/li&gt;
&lt;li&gt; Under OAuth &amp;amp; Permissions, add these Bot Token Scopes:
&lt;code&gt;chat:write&lt;/code&gt; to send DMs, &lt;code&gt;im:history&lt;/code&gt; to read DM history, &lt;code&gt;im:read&lt;/code&gt; to view DM channels, &lt;code&gt;im:write&lt;/code&gt; to open DM channels&lt;/li&gt;
&lt;li&gt; Under Event Subscriptions, enable events and subscribe to the &lt;code&gt;message.im&lt;/code&gt; bot event&lt;/li&gt;
&lt;li&gt; Under Interactivity &amp;amp; Shortcuts, enable interactivity (no URL needed for Socket Mode)&lt;/li&gt;
&lt;li&gt; Install the app to your workspace. Copy the Bot User OAuth Token (&lt;code&gt;xoxb-…&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt; Find your Slack User ID: click your profile picture in Slack, click the three dots, “Copy member ID”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;NOTE: the app-level token, bot user oauth token and your Slack member ID will be used later under Configure Tokens section.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Install the Bridge
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/iamontheinet/cortex-code-cli-slack-bridge.git &lt;span class="se"&gt;\&lt;/span&gt;
  ~/Apps/cortex-code-cli-slack-bridge
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/Apps/cortex-code-cli-slack-bridge
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv
.venv/bin/pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Install Cortex Code CLI Skill
&lt;/h4&gt;

&lt;p&gt;Cortex Code CLI has a skill system that lets you teach the agent new behaviors via markdown files. The repo includes the Cortex Code CLI skill file that teaches the agent how to manage the bridge. For example, when to poll, how to format messages, how to activate and deactivate.&lt;/p&gt;

&lt;p&gt;Copy it to your skills 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; ~/.snowflake/cortex/skills/slack-bridge
&lt;span class="nb"&gt;cp &lt;/span&gt;skill/SKILL.md ~/.snowflake/cortex/skills/slack-bridge/SKILL.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Slack bridge skill defines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trigger phrases: “slack on”, “enable slack”, “/slack”, etc.&lt;/li&gt;
&lt;li&gt;Activation flow: what to do when the user opts in&lt;/li&gt;
&lt;li&gt;Message routing: how to handle inbox entries, when to send notifications&lt;/li&gt;
&lt;li&gt;Deactivation: how “slack off” tears down the polling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you say “slack on”, the skill instructs the agent to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Create a session-scoped cron job that polls the inbox every minute&lt;/li&gt;
&lt;li&gt; Send an activation message to Slack&lt;/li&gt;
&lt;li&gt; Start routing questions and status updates through Slack instead of the terminal&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The cron pattern here is worth calling out. Cortex Code CLI's &lt;code&gt;cron_create&lt;/code&gt; tool lets you schedule prompts that fire on a schedule — and they're session-scoped, meaning they die when the session ends. The bridge uses this as a heartbeat: every minute, a “Slack inbox check” prompt fires. The skill tells the agent to read the inbox file, and if it's empty, sleep 30 seconds and check again. Two checks per cron fire gives you ~30-second worst-case latency without doubling the cron frequency or adding a file watcher. It's a cheap way to give an agent a polling loop — just a cron job and a JSON file. The skill also handles “slack off” to disable the bridge mid-session.&lt;/p&gt;

&lt;h4&gt;
  
  
  Configure Tokens
&lt;/h4&gt;

&lt;p&gt;The recommended approach stores tokens in macOS Keychain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;coco-bridge setup-keychain
&lt;span class="c"&gt;# Prompts for app token, bot token, and user ID&lt;/span&gt;
&lt;span class="c"&gt;# Stores them in Keychain under the "coco-slack-bridge" service&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you already have a &lt;code&gt;config.json&lt;/code&gt;, &lt;code&gt;setup-keychain&lt;/code&gt; reads from it, migrates to Keychain, and offers to delete the file.&lt;/p&gt;

&lt;p&gt;Alternatively, use a config file or env vars:&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="c"&gt;# Config file approach&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.cortex-slack-bridge
&lt;span class="nb"&gt;cp &lt;/span&gt;config.json.example ~/.cortex-slack-bridge/config.json
&lt;span class="c"&gt;# Edit with your actual tokens&lt;/span&gt;

&lt;span class="c"&gt;# Or env vars&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SLACK_BRIDGE_APP_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"xapp-1-A0…"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SLACK_BRIDGE_BOT_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"xoxb-…"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SLACK_BRIDGE_USER_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"U02M…"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Start and Test
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start the bridge&lt;/span&gt;
bin/coco-bridge start

&lt;span class="c"&gt;# Send a test message&lt;/span&gt;
bin/coco-bridge send &lt;span class="s2"&gt;"Hello from the bridge!"&lt;/span&gt;

&lt;span class="c"&gt;# Test a reply - type something back in the Slack DM, then check:&lt;/span&gt;
bin/coco-bridge inbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Wire Up the SessionStart Hook
&lt;/h4&gt;

&lt;p&gt;Add this to &lt;code&gt;~/.snowflake/cortex/hooks.json&lt;/code&gt; so the bridge auto-starts with every Cortex Code CLI session:&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;"hooks"&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;"SessionStart"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Users/YOUR_USERNAME/.cortex-slack-bridge/start-hook.sh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"timeout"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"enabled"&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="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;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="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;Copy the start hook script:&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;cp &lt;/span&gt;demo-start-hook.sh ~/.cortex-slack-bridge/start-hook.sh
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x ~/.cortex-slack-bridge/start-hook.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Beauty of Extensibility
&lt;/h3&gt;

&lt;p&gt;The whole project is ~300 lines of Python plus a shell wrapper. No servers, no databases, no cloud infra. It extends Cortex Code CLI with a mobile-friendly communication layer so you can kick off a task, walk away, get updates, reply with instructions, all from Slack.&lt;/p&gt;

&lt;p&gt;But the bigger takeaway isn't the Slack bridge itself, it's that Cortex Code CLI is built to be extended this way. Hooks give you lifecycle access. Skills give you behavioral control. The filesystem gives you a dead-simple IPC layer. This bridge is one example; the pattern works for any sidecar you can imagine: audit loggers, custom approval gates, integration bridges to other tools.&lt;/p&gt;




&lt;h2&gt;
  
  
  Stay Connected
&lt;/h2&gt;

&lt;p&gt;Thank you for your time. I hope you found this blog both educational and inspiring. The code can be found &lt;a href="https://www.google.com/search?q=https://github.com/iamontheinet/cortex-code-cli-slack-bridge" rel="noopener noreferrer"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Clone it, plug in your Slack tokens, and build something on top of it. The Cortex Code CLI is waiting for your hooks. If you're experimenting with this workflow or planning to, I'd love to hear what you're building. &lt;/p&gt;

&lt;p&gt;Connect with me on &lt;a href="https://www.linkedin.com/in/dash-desai/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; for more demos as well as AI product &amp;amp; feature updates.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>cli</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Hot off the press -- Snowflake Cortex Code in Snowsight is now GA!</title>
      <dc:creator>Dash</dc:creator>
      <pubDate>Thu, 26 Mar 2026 18:40:50 +0000</pubDate>
      <link>https://dev.to/snowflake/hot-off-the-press-snowflake-cortex-code-in-snowsight-is-now-ga-3m3n</link>
      <guid>https://dev.to/snowflake/hot-off-the-press-snowflake-cortex-code-in-snowsight-is-now-ga-3m3n</guid>
      <description>&lt;p&gt;Building and scaling AI apps natively on your data just got a massive upgrade.&lt;/p&gt;

&lt;p&gt;Here is what is included in this release:&lt;/p&gt;

&lt;p&gt;⚡ Rapid prototyping to production: execute large, multi-step projects directly in Snowsight.&lt;br&gt;
🔒 Enterprise-grade governance: built-in controls and observability for regulated environments.&lt;br&gt;
💸 Cost-aware automation: specialized skills for cost optimization and agentic ML workflows.&lt;br&gt;
🪟 Cross-platform CLI: native Windows support removes friction for engineering teams.&lt;/p&gt;

&lt;p&gt;🙌 My absolute new favorite in CLI: Agent Teams!&lt;/p&gt;

&lt;p&gt;Here's what I tried: "&lt;em&gt;Build a Streamlit chat app in a new folder that streams responses from the Cortex Agent. Use a team of 3 agents (client, UI, config) with a shared event contract defined upfront to avoid integration mismatches.&lt;/em&gt;"&lt;/p&gt;

&lt;p&gt;🤯 I'm still blown away by how well the Agent Teams handled that shared event contract. If you had a team of agents to automate your workflow today, what's the first project you'd assign them? Let's discuss in comments👇&lt;/p&gt;

&lt;p&gt;🔗 Get started in mins: &lt;a href="https://www.snowflake.com/en/developers/guides/getting-started-with-cortex-code-cli/" rel="noopener noreferrer"&gt;https://www.snowflake.com/en/developers/guides/getting-started-with-cortex-code-cli/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Let's learn together!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>automation</category>
      <category>snowflake</category>
    </item>
    <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://dev.to/snowflake/the-data-engineers-cortex-code-cheat-sheet-3b60</link>
      <guid>https://dev.to/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>
    <item>
      <title>[DYK with Dash] Want a policy enforcement layer over your AI coding assistant?</title>
      <dc:creator>Dash</dc:creator>
      <pubDate>Thu, 26 Mar 2026 00:51:02 +0000</pubDate>
      <link>https://dev.to/snowflake/dyk-with-dash-want-a-policy-enforcement-layer-over-your-ai-coding-assistant-5a65</link>
      <guid>https://dev.to/snowflake/dyk-with-dash-want-a-policy-enforcement-layer-over-your-ai-coding-assistant-5a65</guid>
      <description>&lt;p&gt;🙌 Snowflake Cortex Code CLI has a programmable hooks system that fires on 11 lifecycle events -- PreToolUse, PostToolUse, SessionStart, Stop, and more. You write a shell script, and if it returns exit code 2, the operation is HARD BLOCKED.&lt;/p&gt;

&lt;p&gt;↳ Validate every bash command before it runs&lt;br&gt;
↳ Block writes to protected files&lt;br&gt;
↳ Log every tool call for audit&lt;br&gt;
↳ Inject context at session start&lt;/p&gt;

&lt;p&gt;This is guardrails-as-code for AI-assisted development.&lt;/p&gt;

&lt;p&gt;Share this with your platform team -- they need to see this 👇&lt;/p&gt;

&lt;p&gt;📖 Get started: &lt;a href="https://www.snowflake.com/en/developers/guides/getting-started-with-cortex-code-cli/" rel="noopener noreferrer"&gt;https://www.snowflake.com/en/developers/guides/getting-started-with-cortex-code-cli/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Let's learn together!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>snowflake</category>
      <category>governance</category>
    </item>
    <item>
      <title>[DYK with Dash] Build your own AI sub-agents with... Markdown?!</title>
      <dc:creator>Dash</dc:creator>
      <pubDate>Tue, 24 Mar 2026 14:23:17 +0000</pubDate>
      <link>https://dev.to/snowflake/dyk-with-dash-build-your-own-ai-sub-agents-with-markdown-31o3</link>
      <guid>https://dev.to/snowflake/dyk-with-dash-build-your-own-ai-sub-agents-with-markdown-31o3</guid>
      <description>&lt;p&gt;🙌 Drop a Markdown file with YAML frontmatter into &lt;code&gt;.cortex/agents/&lt;/code&gt; and Snowflake Cortex Code turns it into a fully functional specialized sub-agent with scoped tool access.&lt;/p&gt;

&lt;p&gt;↳ Define a &lt;code&gt;code-reviewer&lt;/code&gt; agent that only has Read access&lt;br&gt;
↳ Create a &lt;code&gt;migration-checker&lt;/code&gt; with Bash + SQL&lt;br&gt;
↳ Share them with your team through version control&lt;/p&gt;

&lt;p&gt;That's it. Your team's best practices, encoded as agents.&lt;/p&gt;

&lt;p&gt;What custom agent would you build? 👇&lt;/p&gt;

&lt;p&gt;📖 Get started: &lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli" rel="noopener noreferrer"&gt;https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Let's learn together!&lt;/p&gt;

&lt;h1&gt;
  
  
  CortexCode #Snowflake #AI #Developers #DataEngineering #DevTools
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>snowflake</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Data governance just became a conversation, not a workflow.</title>
      <dc:creator>Dash</dc:creator>
      <pubDate>Fri, 20 Mar 2026 14:22:04 +0000</pubDate>
      <link>https://dev.to/snowflake/data-governance-just-became-a-conversation-not-a-workflow-3998</link>
      <guid>https://dev.to/snowflake/data-governance-just-became-a-conversation-not-a-workflow-3998</guid>
      <description>&lt;p&gt;🤔 If you've ever tried to get a full picture of your governance posture, you know the drill -- run classification in one place, write masking policies&lt;br&gt;
 somewhere else, dig through access history six months ago, and still not really know what's covered.&lt;/p&gt;

&lt;p&gt;🙌 We built something to fix that. Data Governance Skills for Snowflake Cortex Code let you govern your data by just... asking.&lt;/p&gt;

&lt;p&gt;"What's my governance maturity score?" gives you a 0-5 score across classification, protection, and access monitoring. Per database. With the actual gaps called out.&lt;/p&gt;

&lt;p&gt;🤯 The thing I like most -- these aren't generic AI prompts hoping the SQL is right. There are 100+ verified query patterns under the hood, built&lt;br&gt;
specifically for governance views. &lt;/p&gt;

&lt;p&gt;Classification, masking, row access policies, data quality via DMFs, lineage with impact analysis -- all in natural language, all native to Snowflake Horizon Catalog. No external catalog to sync. No metadata that's hours behind.&lt;/p&gt;

&lt;p&gt;A data steward can now do in one conversation what used to be a sprint across multiple teams!&lt;/p&gt;

&lt;p&gt;Available now in Cortex Code CLI. Check it out and let me know what you think: &lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli" rel="noopener noreferrer"&gt;https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>database</category>
      <category>security</category>
    </item>
    <item>
      <title>[DYK with Dash] Git branching... but for AI conversations?!</title>
      <dc:creator>Dash</dc:creator>
      <pubDate>Thu, 19 Mar 2026 14:13:18 +0000</pubDate>
      <link>https://dev.to/snowflake/dyk-with-dash-git-branching-but-for-ai-conversations-55dk</link>
      <guid>https://dev.to/snowflake/dyk-with-dash-git-branching-but-for-ai-conversations-55dk</guid>
      <description>&lt;p&gt;🤯 Type '/fork' mid-conversation in Snowflake Cortex Code and it creates a branch of your session at any point you choose. Try a risky refactor, explore a wild idea -- and if it goes sideways, your original session is still right there waiting for you.&lt;/p&gt;

&lt;p&gt;↳ '/fork' -- branch from any message&lt;br&gt;
↳ '/fork my-experiment' -- name it for easy recall&lt;br&gt;
↳ '/rewind 3' -- or just roll back 3 messages&lt;/p&gt;

&lt;p&gt;This is git-branch thinking applied to your AI workflow. Experiment fearlessly!&lt;/p&gt;

&lt;p&gt;Try it: '/fork' your next risky experiment and tell me what you explored 👇&lt;/p&gt;

&lt;p&gt;Get started: &lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli" rel="noopener noreferrer"&gt;https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Let's learn together!&lt;/p&gt;

&lt;h1&gt;
  
  
  CortexCode #Snowflake #AI #Developers #DataEngineering #Productivity
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>cli</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
    <item>
      <title>[DYK with Dash] Cortex Code has a secret weapon most people walk right past!</title>
      <dc:creator>Dash</dc:creator>
      <pubDate>Thu, 19 Mar 2026 00:34:54 +0000</pubDate>
      <link>https://dev.to/snowflake/dyk-with-dash-cortex-code-has-a-secret-weapon-most-people-walk-right-past-4al5</link>
      <guid>https://dev.to/snowflake/dyk-with-dash-cortex-code-has-a-secret-weapon-most-people-walk-right-past-4al5</guid>
      <description>&lt;p&gt;❄️ Type &lt;code&gt;#DB.SCHEMA.TABLE&lt;/code&gt; directly in your Snowflake Cortex Code prompt and BOOM -- it auto-injects the full column metadata, primary keys, row count, and sample rows into context. No more copy-pasting DESCRIBE output. No more guessing column names.&lt;/p&gt;

&lt;p&gt;👉 Just prefix any fully-qualified table name with &lt;code&gt;#&lt;/code&gt; and the agent instantly knows your schema&lt;br&gt;
👉 Autocomplete kicks in after you type &lt;code&gt;#&lt;/code&gt;&lt;br&gt;
👉 Works with any table in your Snowflake account&lt;/p&gt;

&lt;p&gt;Stop manually feeding context. Let the CLI do it for you!&lt;/p&gt;

&lt;p&gt;Try this right now: type &lt;code&gt;#&lt;/code&gt; and pick a table -- then drop your result in the comments 👇&lt;/p&gt;

&lt;p&gt;📖 Docs: &lt;a href="https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli" rel="noopener noreferrer"&gt;https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
