I Switched From Claude Code to Cortex Code. These 14 Commands Sealed the Deal.
This post is the cheat sheet I wish someone had handed me on day one. Fourteen commands, grouped by when you actually use them.
I Switched From Claude Code to Cortex Code. These 14 Commands Sealed the Deal.
The hidden command ecosystem that turns CoCo from a chat box into a Snowflake-native power tool.

A developer at a Snowflake-blue terminal, a small army of helpful “/” command icons floating around the screen. Whiteboard/marker style. Image by Gemini.
The Confession
For the first few weeks, I used Cortex Code (CoCo), and I did exactly one thing: I typed prompts and hit Enter. That was it. No slash commands. No skills. No #table syntax. Nothing.
It worked. Kind of. But every session felt like starting from zero — re-explaining the project, copy-pasting query results back into the chat, watching the context window slowly drown in noise.
Then one evening, half out of curiosity and half out of frustration, I typed / and watched a menu appear. I picked /compact. The chat collapsed into a clean summary. Context freed up. I kept going.
That was my “wait, what?” moment. I’d been ignoring an entire ecosystem hiding behind a single keystroke.
This post is the cheat sheet I wish someone had handed me on day one. Fourteen commands, grouped by when you actually use them. Most of them work in any modern AI coding CLI — but several are uniquely CoCo, and those are where the real productivity lives.
Let’s dive in!
Part 1: Setup Once, Benefit Forever
1. AGENTS.md — your project brain
Every project starts the same way: blank chat, blank brain. You spend 10 minutes explaining your tech stack, the conventions you use, and which schemas matter.
Stop doing that.
CoCo automatically reads a **AGENTS.md** file from your working directory at session start. Drop one at the project root, and your context is loaded for free, every time.
# AGENTS.md
## Project
Streamlit dashboard for partner certification tracking.
## Stack
- Snowflake SQL (no DDL without confirmation)
- Streamlit in Snowflake
- Python 3.11
## Conventions
- All SQL goes through SNOW_CERTIFIED.PUBLIC views
- Use `st.connection("snowflake")` — never raw connector
- Add docstrings to every function
CoCo also reads ~/.snowflake/cortex/settings.json (global) and .snowflake/cortex/settings.json (project). Project-level beats user-level — set guardrails once per repo and forget about them.
Before: 10 minutes of preamble per project. After: Edit once. Forget about it.
2. cortex profile — multiple environments, one CLI
If you switch between dev and prod connections (or different models, or different sandbox rules), profiles are your friend.
cortex profile list
cortex profile create prod-readonly
cortex --profile prod-readonly
Each profile bundles a Snowflake connection, model override, and settingsOverrides. I keep a barts-org-notes profile that activates a totally different skill set when I'm working in my personal knowledge base. Different brain, different toolbox, same CLI.
3. /connections — never paste a connection string again
/connections
Opens the full-screen connection manager. Switch active connection mid-session, no restart needed. Combined with cortex connections list from the shell, this kills the "wait, which account am I on?" anxiety.
4. /mcp — the extensibility door
CoCo speaks MCP (Model Context Protocol). Want it to drive your browser, query Atlassian, or talk to Google Workspace? Drop a server into ~/.snowflake/cortex/mcp.json or run:
cortex mcp add <server>
cortex mcp list
Then /mcp from inside a session to manage them interactively. This is how CoCo becomes more than a code agent.
Part 2: The Daily Drivers
5. /compact — the one that converted me
Your session is 200 messages deep. Responses are slowing down. The context window is a swamp.
Don’t restart. Type:
/compact
CoCo summarizes the conversation, preserves the key decisions and code, and frees up the window. You keep your progress. The agent gets fresh oxygen.
Pro move: /compact focus on the SQL pipeline we just built, drop the dead-end attempts. The instructions argument lets you steer the summary. Genius.
6. ! — run shell without leaving the chat
Old workflow: CoCo says “run git status", I switch to terminal, paste output, switch back, lose flow.
New workflow:
!git status
!dbt build --select my_model
!cortex connections list
Output lands in the conversation. Agent sees it. No tab-switching. The number of times I no longer Cmd-Tab in a day is genuinely surprising.
7. @file$10-50 — surgical file inclusion
Most people know @path/to/file.py includes a file. Almost nobody uses the line range:
@src/app.py$10-50 # lines 10 through 50
@src/app.py$42 # just line 42
@src/app.py$100- # line 100 to end
@{path with spaces.txt} # paths with spaces
This is gold for big files. Don’t dump 2,000 lines into the context when you only care about one function.
8. #DB.SCHEMA.TABLE — the Snowflake superpower
This one has no Claude Code, Cursor, or Copilot equivalent. Type:
#FIVETRAN.SALESFORCE.OPPORTUNITY
CoCo auto-injects the table’s schema and a few sample rows into the agent’s context. The agent now actually knows what the columns are and what the data looks like, without you running a single DESCRIBE or
SELECT * LIMIT 5
The usual in Snowflake. Use it daily. :)
9. $skill — Skills are your second brain
Skills are reusable, packaged workflows. CoCo ships with dozens ($semantic-view, $cortex-agent, $dbt, $snowflake-notebooks, $marketplace-search — and many more). You can also write your own.
$my-partner-summary summarize Capgemini for me
$semantic-view help me build one for partner certifications
I have my own skills under ~/.snowflake/cortex/skills/ for partner summaries, certification analysis, and meeting processing. They turn 30-minute manual workflows into one line. This, more than anything else, is what makes CoCo feel native to my job.
To list everything available, just type $ and start typing — completion shows you the menu.
10. /sql — execute SQL inline
/sql SELECT current_role(), current_warehouse();
/table
Run SQL directly from the chat. /table opens the last result in a fullscreen viewer. Combined with #table referencing, this is a tiny SQL IDE living inside your AI session.
Part 3: Power Moves
11. /model — switch brains mid-session
Different problems need different models. Heavy reasoning? Big model. Quick refactor? Faster model. CoCo lets you switch without restarting:
/model claude-opus-4-7
/model claude-sonnet-4-5
I start hard architectural work on the most capable model, then drop down once the plan is set, and I’m just generating boilerplate. Same session, same context, different brains. No surprise here.
12. /plan — design before you destroy
Before letting CoCo touch a production schema, hit:
/plan
(or Ctrl+P, or Shift+Tab to cycle modes). The agent is now read-only. It explores, reads, queries, but cannot write, edit, or run DDL until you approve a plan. It produces a plan card, you review it, and only then do you switch back to agent mode to execute.
Use /plan for any non-trivial change. I've saved myself from a few "wait, why is that table gone?" moments. You have been warned.
13. /fork and /rewind — non-destructive experimentation
Two of the most underrated commands in CoCo:
**/fork** — Branch the current conversation into a new session. Try a different approach without losing your main thread.**/rewind [N]** — Roll the session back N messages. Did the agent go down the wrong path? Rewind, try a different prompt, no damage done.
Pair this with cortex worktree create my-experiment and you're running parallel CoCo agents on the same repo, in parallel branches, with isolated context. I wrote a whole post on the worktrees workflow.
14. /agents — subagents that verify your work
The single biggest quality jump in my CoCo workflow came from subagents. Specialized agents, you can invoke for a specific task:
sql-verify— checks your SQL for cartesian joins, NULL traps, fanout, division-by-zero, UNION vs UNION ALL bugs.dbt-verify— runs after every dbt change to catch incomplete deliverables and missing downstream rebuilds.explore— fast read-only codebase explorer, runs in parallel.browser— drives a real browser to test your Streamlit app.- …plus any custom agent you define in
~/.snowflake/cortex/agents/.
/agents
Opens the manager. Or just ask the main agent to “verify this with sql-verify before continuing” — it’ll route the call. Free senior engineer at 2 AM, without judgment.
When Things Go Wrong
A few honorable mentions for when you’re stuck:
**/clear** — clears the screen. Your session is intact.**/new** — starts a fresh session. Tools, profile, connection preserved.**/doctor* — diagnoses your environment (config, MCP servers, connections, Node version). Run this before* you reinstall anything.**/clear-cache** — sometimes CoCo just needs a kick.**/feedback** — submit feedback directly from the session. The product team reads it. I've had bugs fixed within days.**/helpand `/commands`** — the master list. When in doubt, this is home base.
The Cheat Sheet

14-commands cheat sheet. Image by author
Set up once:
AGENTS.md— project contextcortex profile— multiple environments/connections— switch Snowflake accounts/mcp— extend CoCo with MCP servers
Daily drivers:
/compact— free up context, keep progress!cmd— run shell inline@file$N-M— surgical file/line inclusion#DB.SCHEMA.TABLE— auto-inject schema + sample rows$skill— invoke packaged workflows/sql+/table— SQL inside the chat
Power moves:
11. /model — switch brains mid-session
12. /plan — read-only design mode
13. /fork + /rewind — non-destructive experimentation
14. /agents — verifier subagents
When things go wrong: /clear, /new, /doctor, /help.
Your 7-Day CoCo Mastery Plan
Don’t bookmark this and forget. Try one a day:
- Day 1. Drop an
AGENTS.mdinto your current project. Feel the difference in your next session. - Day 2. Use
#DB.SCHEMA.TABLEinstead of describing tables manually. Once. - Day 3. Tag at least one
$skillin a real workflow. - Day 4. Hit a long session. Run
/compactinstead of restarting. - Day 5. Replace one
Cmd-Tab to terminalwith!cmd. Notice the flow. - Day 6. Run
/planbefore your next risky change. - Day 7. Invoke
sql-verifyordbt-verifyon real work. Watch it catch something.
Day 8 and beyond: you’re no longer the person who only types prompts. Profit $$$.
Code
There’s no GitHub repo for this one — every command above is built into the CLI. But if you want to see real-world AGENTS.md, custom skills, and profile setups, my own [~/.snowflake/cortex/](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code-cli) layout follows exactly the patterns described here, and I'll publish a sanitized starter pack soon.
Please note that any examples here are best-practice patterns and may need to be adjusted for your team’s managed settings and security posture.
Links
- Cortex Code CLI documentation
- Cortex Code managed settings
- Tools
- MCP — Model Context Protocol
- Parallel development with git worktrees — my previous CoCo post
Thanks for Reading!
If you like my work and want to support me…
- The BEST way to support me is by following me on **Medium**.
- Also, follow me on **LinkedIn**.
- Feel free to give claps so I know how helpful this post was for you.
Note: These are my personal opinions and not of my current employer.
메타데이터
- post_id
- 58568c18a99e
- slug
- i-switched-from-claude-code-to-cortex-code-these-14-commands-sealed-the-deal-58568c18a99e
- url
- https://medium.com/@bart.wrobel/i-switched-from-claude-code-to-cortex-code-these-14-commands-sealed-the-deal-58568c18a99e
- canonical_url
- https://medium.com/@bart.wrobel/i-switched-from-claude-code-to-cortex-code-these-14-commands-sealed-the-deal-58568c18a99e
- author_url
- https://medium.com/@bart.wrobel
- status
- ok
- fetched_at
- 2026-06-09 15:37:30