05-snowhouse-querying

05-snowhouse-querying is a cursor rule for Cursor from sfc-gh-cconner/support-rules-mcp. It costs 3,293 tokens per session, scanned A, original, Apache-2.0.

A collection of SQL patterns for querying Snowhouse, an internal data system containing ETL views and log tables.

In plain words
What is it for?
Use it to find recent failed queries, inspect session context, filter by account and time, and work with deployment-specific Snowhouse tables.
Why use it?
It helps developers find query and job information accurately while avoiding unsupported or overly broad log searches.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to find recent failed queries, inspect session context, filter by account and time, and work with deployment-specific Snowhouse tables.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/sfc-gh-cconner/support-rules-mcp/05-snowhouse-querying
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/sfc-gh-cconner/support-rules-mcp

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 05-snowhouse-querying

README.md
[![agentmods](https://agentmods.dev/badge/rules/sfc-gh-cconner/support-rules-mcp/05-snowhouse-querying/github.svg)](https://agentmods.dev/rules/sfc-gh-cconner/support-rules-mcp/05-snowhouse-querying)
Your own site
<a href="https://agentmods.dev/rules/sfc-gh-cconner/support-rules-mcp/05-snowhouse-querying"><img src="https://agentmods.dev/badge/rules/sfc-gh-cconner/support-rules-mcp/05-snowhouse-querying/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 05-snowhouse-querying

Your own site · 80×15
<a href="https://agentmods.dev/rules/sfc-gh-cconner/support-rules-mcp/05-snowhouse-querying"><img src="https://agentmods.dev/badge/rules/sfc-gh-cconner/support-rules-mcp/05-snowhouse-querying.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,293 This file is loaded in full into every session.
When invoked 3,293 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03293 $0.03293
Opus 5 $0.01647 $0.01647
Sonnet 5 $0.00659 $0.00659
Haiku 4.5 $0.00329 $0.00329

Measured 9d ago against content hash d304fceb3f99, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

05-snowhouse-querying scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/core/05-snowhouse-querying.mdc · 505 lines

How it starts

The opening of the file, as written. The whole thing — 505 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Snowhouse Querying Patterns & Best Practices

PURPOSE: Master patterns for querying Snowhouse ETL views and log tables efficiently and accurately.

🎯 Core Principles

  1. ALWAYS filter by account_id
  2. ALWAYS start with job_etl_v for timestamps
  3. ALWAYS use time bounds for log queries
  4. NEVER query ACCOUNT_USAGE views in Snowhouse

🗺️ Snowhouse Structure

snowhouse_import.<deployment>.<table>

Deployments:
- prod1: Production deployment 1
- prod2: Production deployment 2
- prod3: Production deployment 3
- aws_us_west_2, azure_westus2, gcp_us_central1, etc.

📊 Core Query Patterns

Pattern 1: Find Recent Queries

-- ALWAYS start here for timestamps and context
SELECT 
    query_id,
    query_text,
    user_name,
    warehouse_name,
    start_time,
    end_time,
    execution_time,
    error_code,
    error_message
FROM snowhouse_import.<deployment>.job_etl_v
WHERE account_id = <account_id>
  AND start_time >= CURRENT_TIMESTAMP - INTERVAL '24 hours'
  AND error_code IS NOT NULL  -- Only failed queries
ORDER BY start_time DESC
LIMIT 100;

Pattern 2: Query with Session Context

-- Join jobs with sessions for user context
SELECT 
    j.query_id,
    j.query_text,
    j.start_time,
    j.error_message,
    s.session_id,
    s.user_name,
    s.client_type,
    s.client_version
FROM snowhouse_import.<deployment>.job_etl_v j
LEFT JOIN snowhouse_import.<deployment>.session_etl_v s
    ON j.session_id = s.session_id
    AND j.account_id = s.account_id
WHERE j.account_id = <account_id>
  AND j.start_time >= '<start_time>'
  AND j.end_time <= '<end_time>'
ORDER BY j.start_time DESC;

Pattern 3: Logs with Time Bounds

-- CRITICAL: Always get timestamps from job_etl_v first!
WITH query_context AS (
    SELECT 
        query_id,
        request_id,
        start_time,
        end_time
    FROM snowhouse_import.<deployment>.job_etl_v
    WHERE account_id = <account_id>
      AND query_id = '<query_id>'
)
SELECT l.*
FROM snowhouse_import.<deployment>.gs_logs_v l
JOIN query_context q ON l.request_id = q.request_id
WHERE l.account_id = <account_id>
  AND l.timestamp BETWEEN q.start_time - INTERVAL '5 minutes'
                      AND q.end_time + INTERVAL '5 minutes'
ORDER BY l.timestamp;

Read the full file on GitHub · 505 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 505 lines · 3,293 tokens per session scan A d304fceb3f99

Subscribe to this mod's changes

05-snowhouse-querying is a cursor rule published in the GitHub repository sfc-gh-cconner/support-rules-mcp (0 stars, last pushed 11mo ago), licensed Apache-2.0. It adds 3,293 tokens to every session, about $0.0165 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.