altimate-code
Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools. USE THIS SKILL…
Finds and ranks expensive Snowflake queries by cost, time, or data scanned. Use when: (1) User asks to find slow, expensive, or problematic queries (2) Task mentions "query history", "top queries", "most expensive", or "slowest queries" (3) Analyzing warehouse costs or
$ npx -y skills add AltimateAI/data-engineering-skills --skill finding-expensive-queries --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/finding-expensive-queriesContext preview
The summary Claude sees to decide when to auto-load this skill.
Finds and ranks expensive Snowflake queries by cost, time, or data scanned. Use when: (1) User asks to find slow, expensive, or problematic queries (2) Task mentions "query history", "top queries", "most expensive", or "slowest queries" (3) Analyzing warehouse costs or
name: finding-expensive-queries description: | Finds and ranks expensive Snowflake queries by cost, time, or data scanned. Use when: (1) User asks to find slow, expensive, or problematic queries (2) Task mentions "query history", "top queries", "most expensive", or "slowest queries" (3) Analyzing warehouse costs or identifying optimization candidates (4) Finding queries that scan the most data or have the most spillage Returns ranked list of queries with metrics and optimization recommendations.
**Query history → Rank by metric → Identify patterns → Recommend optimizations**
Before querying, clarify:
Use QUERY_ATTRIBUTION_HISTORY for credit/cost analysis:
SELECT
query_id,
warehouse_name,
user_name,
credits_attributed_compute,
start_time,
end_time,
query_tag
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_ATTRIBUTION_HISTORY
WHERE start_time >= DATEADD('days', -7, CURRENT_TIMESTAMP())
ORDER BY credits_attributed_compute DESC
LIMIT 20;Use QUERY_HISTORY for detailed performance metrics (run separately, not joined):
SELECT
query_id,
query_text,
total_elapsed_time/1000 as seconds,
bytes_scanned/1e9 as gb_scanned,
bytes_spilled_to_local_storage/1e9 as gb_spilled_local,
bytes_spilled_to_remote_storage/1e9 as gb_spilled_remote,
partitions_scanned,
partitions_total
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE query_id IN ('<query_id_1>', '<query_id_2>', ...)
AND start_time >= DATEADD('days', -7, CURRENT_TIMESTAMP());Look for:
Provide: 1. Ranked list of expensive queries with key metrics 2. Common patterns identified 3. Top 3-5 optimization recommendations 4. Specific queries to investigate further
-- Time range (required)
WHERE start_time >= DATEADD('days', -7, CURRENT_TIMESTAMP())
-- By warehouse
AND warehouse_name = 'ANALYTICS_WH'
-- By user
AND user_name = 'ETL_USER'
-- Only queries over cost threshold
AND credits_attributed_compute > 0.01
-- Only queries over time threshold
AND total_elapsed_time > 60000 -- over 1 minuteClaude Code skills for Analytics & Data engineers working with dbt and Snowflake Altimate Data Skills is a collection of Claude Code skills that encode the workflows and best practices of experienced analytics engineers.
Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools. USE THIS SKILL…
Analyze DBSQL queries, including SQL embedded in notebooks (`spark.sql(...)`, `%sql` cells), for anti-patterns, lint issues, and…
Creates dbt models following project conventions. Use when working with dbt models for: (1) Creating new models (any layer -…
Debugs and fixes dbt errors systematically. Use when working with dbt errors for: (1) Task mentions "fix", "error", "broken",…
Develops and troubleshoots dbt incremental models. Use when working with incremental materialization for: (1) Creating new…
Documents dbt models and columns in schema.yml. Use when working with dbt documentation for: (1) Adding model descriptions or…