Expensive Snowflake Query Finder
AltimateAI/data-engineering-skills
Ranks the costliest, slowest or heaviest-scanning Snowflake queries from query history and suggests how to optimize them.
Agent skill
by jeremylongshore in jeremylongshore/tons-of-skills-marketplace
Audit, analyze, and diagnose completed or failed Snowflake queries from query history, Query Insights, and GETQUERYOPERATORSTATS evidence.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace snowflake-query-forensics --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/snowflake-query-forensics .claude/skills/snowflake-query-forensics && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "snowflake-query-forensics" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/snowflake-query-forensics into .claude/skills/snowflake-query-forensics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "snowflake-query-forensics", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/snowflake-query-forensicsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace snowflake-query-forensics --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/.curated/snowflake-query-forensics .agents/skills/snowflake-query-forensics && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "snowflake-query-forensics" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/snowflake-query-forensics into .agents/skills/snowflake-query-forensics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "snowflake-query-forensics", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace snowflake-query-forensics --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/.curated/snowflake-query-forensics .cursor/skills/snowflake-query-forensics && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "snowflake-query-forensics" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/snowflake-query-forensics into .cursor/skills/snowflake-query-forensics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "snowflake-query-forensics", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jeremylongshore/tons-of-skills-marketplace.git --path skills/.curated/snowflake-query-forensics--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace snowflake-query-forensics --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/.curated/snowflake-query-forensics .gemini/skills/snowflake-query-forensics && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "snowflake-query-forensics" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/snowflake-query-forensics into .gemini/skills/snowflake-query-forensics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "snowflake-query-forensics", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jeremylongshore/tons-of-skills-marketplace snowflake-query-forensicsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/.curated/snowflake-query-forensics .github/skills/snowflake-query-forensics && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "snowflake-query-forensics" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/snowflake-query-forensics into .github/skills/snowflake-query-forensics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "snowflake-query-forensics", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace snowflake-query-forensics --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/.curated/snowflake-query-forensics .opencode/skills/snowflake-query-forensics && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "snowflake-query-forensics" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/snowflake-query-forensics into .opencode/skills/snowflake-query-forensics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "snowflake-query-forensics", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
snowflake-query-forensicsAudit, analyze, and diagnose completed or failed Snowflake queries from query history, Query Insights, and GETQUERYOPERATORSTATS evidence.
Snowflake Query Forensics is an agent skill from jeremylongshore/tons-of-skills-marketplace. Audit, analyze, and diagnose completed or failed Snowflake queries from query history, Query Insights, and GETQUERYOPERATORSTATS evidence. Use when investigating slow queries, queueing, lock waits, local or remote spill, poor pruning, exploding joins, repeated query-hash regressions, or requests for a defensible query root-cause packet. Trigger with "Snowflake query spilled", "why is this Snowflake query queued", "Snowflake query ID", "exploding join", or "Snowflake pruning regression". Do not use for generic SQL…
Its SKILL.md is about 4.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 18 other files, including scripts and reference files (for example `eval-spec.yaml`, `references/history-and-collection.md` and `references/load-hash-and-sos.md`). Compatibility notes: Model-agnostic workflow; requires Python 3.10+; optional Snowflake CLI for live read-only evidence collection
It sits in Databases, covering Data warehousing. It works with Snowflake and SQL. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteBash(python3:*)From allowed-tools in the SKILL.md frontmatter.
Ships 3 files in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
python3From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Model-agnostic workflow; requires Python 3.10+; optional Snowflake CLI for live read-only evidence collection
From compatibility in the SKILL.md frontmatter.
Snowflake Query Forensics loads about 4.3k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 160 tokens; SKILL.md has 1,976 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 1,976 words, ~4,336 tokens.
.claude/skills/snowflake-query-forensics/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.Build a read-only query root-cause packet from platform evidence. Distinguish observed facts, derived metrics, and hypotheses; isolate one variable for any later experiment.
Problem: A slow elapsed time does not identify whether compilation, execution, queueing, blocking, spill, pruning, or query shape is responsible, and some diagnostic surfaces are delayed or unavailable for particular query classes.
Outcome: A query-scoped packet that ranks observed operator evidence, preserves competing explanations, and defines the next read-only check without changing SQL or compute.
OPERATE or MONITOR on the
warehouse when operator statistics are required.Write only for new local evidence and
report artifacts; never use it to alter SQL or Snowflake state.ACCOUNTADMIN. Query-history visibility and operator-stat access
depend on the approved role. GET_QUERY_OPERATOR_STATS requires OPERATE or
MONITOR on the warehouse. Report missing access; do not grant it.metadata.history_source and role must
exactly match the receipted anchor row and source; a digest cannot repair a semantic
mismatch.query_runs, never
attribute them to the anchor, and require the explicit comparison-alignment fields.has_* metadata is safe only when its value is an actual boolean.Before collection, read references/history-and-collection.md. For a completed query, read references/operator-statistics.md. When Query Insights is available, read references/query-insights-boundaries.md.
For bounded live history collection, use the shared read-only collector with an approved Snowflake CLI profile:
python3 "${CLAUDE_SKILL_DIR}/scripts/collect_snowflake_evidence.py" \
--surface query --connection <approved-readonly-profile> \
--source-max-age-seconds <positive-incident-bound> \
--output snowflake-query-collector.jsonUse normalized input schema 2.0 and collector receipt schema 2. Before analysis,
apply the complete contract in
History and collection, including exact anchor
UUID, source, role, source-specific terminal status, anchor-only maximum time, reviewed
SQL cap, and an independently preserved input digest. Treat an embedded checksum as
consistency evidence, never authenticity. A missing or mismatched receipt field, stale
anchor, cap hit, truncation, or absent external digest blocks confirmed, completeness,
comparison, regression, and ROI claims. Keep aligned comparison runs in query_runs;
do not attribute them to the anchor. Narrow or partition any truncated collection before
making workload or absence claims.
Follow this sequence:
Require at least one of:
Capture the symptom, expected behavior, comparison query/run if available, account, role, warehouse, execution state, and source timestamps. If the user only says “queries are slow,” first identify a bounded candidate set; do not scan unbounded history.
SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY for longer historical comparisons, while
disclosing its documented latency.QUERY_INSIGHTS only as an additional platform-detected signal; absence of an
insight does not prove absence of a problem.GET_QUERY_OPERATOR_STATS(QUERY_ID) only after confirming the query completed,
is within the supported retrieval window, and the role has warehouse visibility.Use only the source-specific terminal statuses listed in History and collection. Unknown, running, queued, blocked, and warehouse-resume states remain nonterminal and fail closed. The bundled collector receipts Account Usage; Information Schema discovery remains partial without its own reviewed matching receipt.
The detailed choice table and bounded SQL are in references/history-and-collection.md.
Collect only fields needed to distinguish:
Exclude raw query text by default. If literals or object names are relevant, have the operator provide a redacted fragment separately.
Normalize the bundle to the schema in references/operator-statistics.md, then run:
python3 "${CLAUDE_SKILL_DIR}/scripts/analyze_query_evidence.py" \
--input query-evidence.json \
--json-out query-forensics.json \
--markdown-out query-forensics.mdThe analyzer emits:
It never rewrites SQL, chooses a warehouse size, or assigns a root cause from a single metric.
For every hypothesis, include at least one competing explanation and the next read-only test. Examples:
Use references/output-contract.md. Required contents:
Before delivery, verify that the packet names the query ID and evidence surfaces, gives
actual source timestamps, reports evidence_binding: BOUND and source_freshness: FRESH before making a completeness claim, contains no raw query text or credentials,
includes at least one operator row bound to a surface-compatible terminal query, and
keeps all three confidence classes separate. Re-run the analyzer on the saved
normalized JSON; the machine-readable result must be identical for identical input. If
a proposed experiment appears, confirm it changes one variable, uses a user-supplied
success objective, names an approver, and has not been executed.
Return query-forensics.json and query-forensics.md in the user's chosen working
directory, plus the exact analyzer command used. The packet includes identity and
freshness, confirmed observations, estimated/derived metrics, at-risk hypotheses, top
operators, warnings, non-claims, and a one-variable experiment proposal only when the
user supplies a success objective. Do not write runtime output into the skill directory.
Return a partial or inconclusive packet rather than guessing when:
| Condition | Meaning | Required response |
|---|---|---|
| Query ID cannot be found | Wrong surface/window/account, retention, latency, or visibility may apply | Check scope and freshness; return unknown rather than “query did not run.” |
| Query is running or too old | Operator statistics are not available | Produce a history-only partial packet and state the missing operator boundary. |
GET_QUERY_OPERATOR_STATS privilege failure | Approved role lacks warehouse OPERATE/MONITOR | Preserve the sanitized error and request owner review; do not grant privileges. |
| No Query Insights row | Exclusion, availability, timing, or no supported signal are all possible | State which interpretation is supported; never certify health from absence. |
| Analyzer rejects evidence | Negative/non-finite counters, malformed timestamps, or invalid objects | Correct from source data; do not coerce or invent fields. |
| User demands resize, rewrite, cancellation, or clustering change | Mutation exceeds this skill's authority | Return evidence and an approval-bounded experiment proposal, then stop. |
Confirm the query completed, collect operator statistics, and report the exact remote spill bytes and affected operator. Compare the same parameterized hash and aligned data volume. Return query-shape and capacity-pressure hypotheses separately; do not resize.
Decompose queue and transaction-blocked time from query history. If blocked time is present, identify the relevant transaction evidence through approved read-only surfaces. Do not cancel the blocker. The packet names the blocker owner and escalation path.
Reject that inference. Query Insights has documented exclusions. Use history and operator evidence, and report whether insights were unavailable, inapplicable, absent, or actually returned no rows.
scripts/analyze_query_evidence.py — deterministic
evidence validator and classifier.© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 13 other files (scripts, references) in skills/.curated/snowflake-query-forensics of jeremylongshore/tons-of-skills-marketplace.
Open the folder on GitHubat commit cfae287
Snowflake Query Forensics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Snowflake Query Forensics this skilljeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~4.3k | Automated safety check: Pass | MIT | |
| Expensive Snowflake Query FinderAltimateAI/data-engineering-skills | 128 | — | ~662 | Automated safety check: Pass | MIT | |
| SQL Queriesw95/awesome-claude-corporate-skills | 244 | 3 repos | ~2.8k | Automated safety check: Pass | MIT | |
| Optimizing Query By IdAltimateAI/data-engineering-skills | 128 | — | ~919 | Automated safety check: Pass | MIT | |
| Snowflake Semanticviewgithub/awesome-copilot | 40k | 1 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Snowflake Developmentsickn33/agentic-awesome-skills | 47k | 2 repos | ~2.1k | Automated safety check: Pass | MIT |
AltimateAI/data-engineering-skills
Ranks the costliest, slowest or heaviest-scanning Snowflake queries from query history and suggests how to optimize them.
w95/awesome-claude-corporate-skills
Write correct, performant SQL across all major data warehouse dialects (Snowflake, BigQuery, Databricks, PostgreSQL, etc.).
AltimateAI/data-engineering-skills
Optimizes Snowflake query performance using query ID from history.
github/awesome-copilot
Create, alter, and validate Snowflake semantic views using Snowflake CLI (snow).
sickn33/agentic-awesome-skills
Comprehensive Snowflake development assistant covering SQL best practices, data pipeline design (Dynamic Tables, Streams, Tasks, Snowpipe), Cortex AI functions, Cortex Agents, Snowpark Python, dbt…
HybridAIOne/hybridclaw
Review and run read-only natural-language SQL against a customer data warehouse with cached schema introspection and explicit write grants.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.
jeremylongshore/tons-of-skills-marketplace
Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.
jeremylongshore/tons-of-skills-marketplace
Execute proactive auto-loading: automatically detects and loads agents.md files.
jeremylongshore/tons-of-skills-marketplace
Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.
jeremylongshore/tons-of-skills-marketplace
Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.
Categories
Audit, analyze, and diagnose completed or failed Snowflake queries from query history, Query Insights, and GETQUERYOPERATORSTATS evidence. Snowflake Query Forensics is an agent skill from jeremylongshore/tons-of-skills-marketplace. Audit, analyze, and diagnose completed or failed Snowflake queries from query history, Query Insights, and GETQUERYOPERATORSTATS evidence.
Snowflake Query Forensics fits situations like: investigating slow queries; exploding joins; repeated query-hash regressions; requests for a defensible query root-cause packet.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a claude-code`. Or copy the skill folder (skills/.curated/snowflake-query-forensics in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/snowflake-query-forensics in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a codex`. Or copy the skill folder (skills/.curated/snowflake-query-forensics in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/snowflake-query-forensics in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill snowflake-query-forensics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/snowflake-query-forensics, .gemini/skills/snowflake-query-forensics, .github/skills/snowflake-query-forensics and .opencode/skills/snowflake-query-forensics in your project.
Going by SKILL.md and its folder, Snowflake Query Forensics needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Bash(python3:*). Compatibility (from SKILL.md): Model-agnostic workflow; requires Python 3.10+; optional Snowflake CLI for live read-only evidence collection.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Snowflake Query Forensics is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.3k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.5k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Snowflake Query Forensics: Expensive Snowflake Query Finder (AltimateAI/data-engineering-skills, 128 stars), SQL Queries (w95/awesome-claude-corporate-skills, 244 stars), Optimizing Query By Id (AltimateAI/data-engineering-skills, 128 stars) and Snowflake Semanticview (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.
Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.