snowflake-debug-bundle

Collect Snowflake debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support cases, or collecting diagnostic information from QUERY_HISTORY and ACCOUNT_USAGE. Trigger with phrases like "snowflake debug", "snowflake support bundle", "snowflake diagnostic", "snowflake query history", "snowflake troubleshoot".

1,868 stars

Best use case

snowflake-debug-bundle is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Collect Snowflake debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support cases, or collecting diagnostic information from QUERY_HISTORY and ACCOUNT_USAGE. Trigger with phrases like "snowflake debug", "snowflake support bundle", "snowflake diagnostic", "snowflake query history", "snowflake troubleshoot".

Teams using snowflake-debug-bundle should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/snowflake-debug-bundle/SKILL.md --create-dirs "https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/main/plugins/saas-packs/snowflake-pack/skills/snowflake-debug-bundle/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/snowflake-debug-bundle/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How snowflake-debug-bundle Compares

Feature / Agentsnowflake-debug-bundleStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Collect Snowflake debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support cases, or collecting diagnostic information from QUERY_HISTORY and ACCOUNT_USAGE. Trigger with phrases like "snowflake debug", "snowflake support bundle", "snowflake diagnostic", "snowflake query history", "snowflake troubleshoot".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Snowflake Debug Bundle

## Overview

Collect diagnostic information from Snowflake's ACCOUNT_USAGE views, QUERY_HISTORY, and driver logs for support tickets and troubleshooting.

## Prerequisites

- Role with access to `SNOWFLAKE.ACCOUNT_USAGE` schema (typically ACCOUNTADMIN)
- Access to application logs
- Permission to collect environment info

## Instructions

### Step 1: Query-Level Diagnostics

```sql
-- Find the problematic query by ID
SELECT query_id, query_text, execution_status, error_code, error_message,
       start_time, end_time, total_elapsed_time / 1000 AS elapsed_seconds,
       bytes_scanned, rows_produced, compilation_time, execution_time,
       warehouse_name, warehouse_size
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE query_id = '<paste-query-id-here>';

-- Recent failed queries
SELECT query_id, query_text, error_code, error_message,
       start_time, user_name, role_name, warehouse_name
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE execution_status = 'FAIL'
  AND start_time >= DATEADD(hours, -24, CURRENT_TIMESTAMP())
ORDER BY start_time DESC
LIMIT 20;

-- Slow queries (> 60 seconds)
SELECT query_id, query_text, total_elapsed_time / 1000 AS seconds,
       bytes_scanned / 1e9 AS gb_scanned, partitions_scanned, partitions_total,
       warehouse_name, warehouse_size
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE total_elapsed_time > 60000
  AND start_time >= DATEADD(hours, -24, CURRENT_TIMESTAMP())
ORDER BY total_elapsed_time DESC
LIMIT 10;
```

### Step 2: Connection and Session Diagnostics

```sql
-- Active sessions
SELECT session_id, user_name, created_on,
       client_application_id, client_environment
FROM TABLE(INFORMATION_SCHEMA.SESSIONS())
ORDER BY created_on DESC;

-- Login history (auth failures)
SELECT event_timestamp, user_name, client_ip, reported_client_type,
       error_code, error_message, is_success
FROM SNOWFLAKE.ACCOUNT_USAGE.LOGIN_HISTORY
WHERE event_timestamp >= DATEADD(hours, -24, CURRENT_TIMESTAMP())
  AND is_success = 'NO'
ORDER BY event_timestamp DESC;
```

### Step 3: Warehouse and Resource Diagnostics

```sql
-- Warehouse load (queued queries = undersized)
SELECT warehouse_name, start_time,
       avg_running, avg_queued_load, avg_queued_provisioning, avg_blocked
FROM TABLE(INFORMATION_SCHEMA.WAREHOUSE_LOAD_HISTORY(
  DATE_RANGE_START => DATEADD(hours, -4, CURRENT_TIMESTAMP())
))
ORDER BY start_time DESC;

-- Credit consumption by warehouse
SELECT warehouse_name, SUM(credits_used) AS credits,
       SUM(credits_used_compute) AS compute_credits,
       SUM(credits_used_cloud_services) AS cloud_credits
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE start_time >= DATEADD(days, -7, CURRENT_TIMESTAMP())
GROUP BY warehouse_name
ORDER BY credits DESC;
```

### Step 4: Create Debug Bundle Script

```bash
#!/bin/bash
# snowflake-debug-bundle.sh
set -euo pipefail

BUNDLE_DIR="snowflake-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"

echo "=== Snowflake Debug Bundle ===" > "$BUNDLE_DIR/summary.txt"
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$BUNDLE_DIR/summary.txt"

# Environment info
echo "--- Environment ---" >> "$BUNDLE_DIR/summary.txt"
node --version >> "$BUNDLE_DIR/summary.txt" 2>&1 || true
python3 --version >> "$BUNDLE_DIR/summary.txt" 2>&1 || true
echo "SNOWFLAKE_ACCOUNT: ${SNOWFLAKE_ACCOUNT:-NOT SET}" >> "$BUNDLE_DIR/summary.txt"
echo "SNOWFLAKE_WAREHOUSE: ${SNOWFLAKE_WAREHOUSE:-NOT SET}" >> "$BUNDLE_DIR/summary.txt"

# Driver versions
echo "--- Driver Versions ---" >> "$BUNDLE_DIR/summary.txt"
npm list snowflake-sdk 2>/dev/null >> "$BUNDLE_DIR/summary.txt" || echo "Node driver: N/A" >> "$BUNDLE_DIR/summary.txt"
pip show snowflake-connector-python 2>/dev/null | grep -E "Name|Version" >> "$BUNDLE_DIR/summary.txt" || echo "Python connector: N/A" >> "$BUNDLE_DIR/summary.txt"

# Recent application logs (redacted)
if [ -f "logs/app.log" ]; then
  grep -i "snowflake\|error\|timeout\|connection" logs/app.log 2>/dev/null \
    | tail -100 \
    | sed -E 's/(password|token|key)=[^ ]*/\1=***REDACTED***/gi' \
    > "$BUNDLE_DIR/app-logs-redacted.txt"
fi

# Configuration (redacted)
if [ -f ".env" ]; then
  sed 's/=.*/=***REDACTED***/' .env > "$BUNDLE_DIR/config-redacted.txt"
fi

# Network test
echo "--- Connectivity ---" >> "$BUNDLE_DIR/summary.txt"
curl -s -o /dev/null -w "Status: %{http_code}, Time: %{time_total}s\n" \
  "https://${SNOWFLAKE_ACCOUNT:-unknown}.snowflakecomputing.com/" \
  >> "$BUNDLE_DIR/summary.txt" 2>&1 || echo "Connectivity test failed" >> "$BUNDLE_DIR/summary.txt"

tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"
rm -rf "$BUNDLE_DIR"
echo "Bundle created: $BUNDLE_DIR.tar.gz"
```

### Step 5: Submit to Snowflake Support

1. Go to [Snowflake Support](https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge)
2. Include: account identifier, query IDs, error codes, timestamps (UTC)
3. Attach debug bundle (ensure no credentials included)
4. Reference the specific error code from `QUERY_HISTORY`

## Sensitive Data Handling

**ALWAYS REDACT:** passwords, private keys, OAuth tokens, PII
**SAFE TO INCLUDE:** error codes, query IDs, query text (if no PII), timestamps, warehouse names

## Error Handling

| Item | Purpose | Source |
|------|---------|--------|
| Query ID | Pinpoint exact failure | `QUERY_HISTORY` |
| Error code | Classify issue type | Error message |
| Warehouse load | Identify resource contention | `WAREHOUSE_LOAD_HISTORY` |
| Login history | Auth failure pattern | `LOGIN_HISTORY` |
| Driver version | Version-specific bugs | `npm list` / `pip show` |

## Resources

- [QUERY_HISTORY View](https://docs.snowflake.com/en/sql-reference/account-usage/query_history)
- [Account Usage](https://docs.snowflake.com/en/sql-reference/account-usage)
- [Snowflake Support](https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge)

## Next Steps

For concurrency and warehouse sizing, see `snowflake-rate-limits`.

Related Skills

workhuman-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Workhuman debug bundle for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman debug bundle".

wispr-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Wispr Flow debug bundle for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr debug bundle".

webflow-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Collect Webflow debug evidence for support tickets and troubleshooting. Gathers SDK version, token validation, rate limit status, site connectivity, CMS health, and error logs into a single diagnostic bundle. Trigger with phrases like "webflow debug", "webflow support bundle", "collect webflow logs", "webflow diagnostic", "webflow troubleshoot".

vercel-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Collect Vercel debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Vercel problems. Trigger with phrases like "vercel debug", "vercel support bundle", "collect vercel logs", "vercel diagnostic".

veeva-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Veeva Vault debug bundle for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva debug bundle".

vastai-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Collect Vast.ai debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Vast.ai problems. Trigger with phrases like "vastai debug", "vastai support bundle", "collect vastai logs", "vastai diagnostic".

twinmind-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Collect comprehensive diagnostic information for TwinMind issues. Use when preparing support requests, investigating complex problems, or gathering evidence for bug reports. Trigger with phrases like "twinmind debug", "twinmind diagnostics", "collect twinmind info", "twinmind support bundle".

together-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Together AI debug bundle for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together debug bundle".

techsmith-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

TechSmith debug bundle for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith debug bundle".

supabase-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Collect Supabase diagnostic info for troubleshooting and support tickets. Use when debugging connection failures, auth issues, Realtime drops, Storage errors, RLS misconfigurations, or preparing a support escalation. Trigger: "supabase debug", "supabase diagnostics", "supabase support bundle", "collect supabase logs", "debug supabase connection".

stackblitz-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Collect WebContainer diagnostic info: boot state, file system, process list. Use when working with WebContainers or StackBlitz SDK. Trigger: "stackblitz debug".

speak-debug-bundle

1868
from jeremylongshore/claude-code-plugins-plus-skills

Collect diagnostic information for Speak API issues: auth verification, audio format validation, session inspection, and network testing. Use when implementing debug bundle features, or troubleshooting Speak language learning integration issues. Trigger with phrases like "speak debug bundle", "speak debug bundle".