Dex helped my agent cut Snowflake costs by 66% (conservative estimate)
Dex cut my agent’s Snowflake costs by 66%. That’s the conservative estimate. The more idle time you cut, the more you save.

Co-Founder & CEO

My agent builds dbt models, verifies joins and checks grain on Snowflake all day. Each of those steps takes a second or two of compute. But on Snowflake's default settings each one was billed for about ten minutes.
With Dex, the same work costs 66% less, measured on Snowflake's own bill.
And that's just one agent. Imagine a swarm of 1,000 data agents running the same loop in your warehouse, every hour of every day. Each of them would be paying for a warehouse that sits idle, waiting to suspend. Nightmare.
Why short commands are so expensive on Snowflake
Snowflake bills a warehouse for every second it is up, not for the queries it runs.
These are the two rules decide how long it stays up:
- Every resume bills at least 60 seconds.
- After the last query, the warehouse keeps running until it has been idle for
AUTO_SUSPEND. For a new warehouse the default is 600 seconds.
A one-second query on a default warehouse therefore bills 601 seconds, and 600 of them are spent waiting to fall asleep. A person running a dashboard query a few times a day never notices. An agent runs short commands all day, so for an agent that idle time is most of the bill.
The result
We measured the loop an agent runs most often, which is four Dex commands:
- build the sources;
- build the marts;
- verify the joins;
- check the grain.
The dbt project had two seeds, two staging models and two declared marts. It ran on one X-Small warehouse at Snowflake's default AUTO_SUSPEND = 600, with nothing else using the warehouse. The warehouse started suspended, and the commands ran back to back, the way an agent runs them. Every figure below comes from Snowflake's own WAREHOUSE_EVENTS_HISTORY and WAREHOUSE_METERING_HISTORY.
- Before: one resume, then ten idle minutes — 702.6 warehouse-seconds (0.263 credits).
- With Dex 1.16.6: 240 warehouse-seconds (0.090 credits).
- Saved: 66%.
With Dex 1.16.6, every command woke the warehouse, did its work and put it back to sleep within seconds. Each one was billed Snowflake's 60-second minimum and nothing more:
transform build(sources): 60 seconds.transform build(marts): 60 seconds.explore relationships --verify: 60 seconds.maintain grain: 60 seconds.
66% is the floor, not the ceiling. Four commands back to back share the idle time more than any other pattern does. An agent that pauses between steps, to think, to wait on a reviewer, or to run tests, pays a full ten-minute tail after each command. Dex takes each of those commands from 601 seconds to 60, a 90% cut.
How it works
Turn on snowflake.suspend_after_command, grant OPERATE on the warehouse, and Dex suspends the warehouse at the end of every command that woke it. The command is billed its work plus Snowflake's 60-second minimum, and nothing for idling.
Suspending a warehouse affects everyone using it, so Dex suspends only a warehouse it can prove is its own to suspend. All of these must be true:
- The command woke it. The command found the warehouse suspended, and the resume happened during the command's own first statement.
- No one else is on it. Nothing is running or queued when the command finishes.
- It is the warehouse you pinned in
.dex/config.yml.
If any of them is false, Dex leaves the warehouse alone. A warehouse a colleague woke, or one that was already running, is never suspended.
The suspend is one fixed statement, ALTER WAREHOUSE "<your warehouse>" SUSPEND, issued by Dex itself. Nothing an agent writes can produce it, and Dex's query firewall goes on refusing every ALTER an agent writes. Suspending stops compute; it reads and changes no data, and Snowflake lets running queries finish first.
Budgets stay honest the whole time. Every estimate includes the warehouse's time up front, on its own line, before you confirm anything. Dex quotes the 60-second minimum only once it has seen a suspend succeed on your warehouse, so a quote never promises a saving Dex can't deliver.
No OPERATE grant? Two other ways to save
- Give Dex a dedicated X-Small with
AUTO_SUSPEND = 60. Each command then costs about a minute, with no suspend needed.dex connect testtells you when your warehouse idles longer than that, and what it is costing you per command. - Grant
OPERATElater. Without it, Dex runs exactly as before and tells you the oneGRANTstatement that switches the savings on.
Dex never changes your warehouse's settings itself. It shows you the cost and the fix, and you decide.
Setup and the grant are on the Snowflake connector page, and how Dex budgets warehouse spend is under cost controls.
