causal-query-classifier

causal-query-classifier is a skill for Claude Code from clamp-sh/analytics-skills. It costs 201 tokens per session (4,379 once invoked), scanned A, original, MIT.

A question-classification guide based on Judea Pearl’s three levels of causal reasoning: association, intervention, and counterfactuals. It separates what the data shows from what would happen if someone changed something.

In plain words
What is it for?
Use it when interpreting analytics questions about whether a change caused an outcome. It helps distinguish descriptive results, intervention claims, and counterfactual questions.
Why use it?
It prevents a simple correlation from being presented as proof that one change caused another. It also makes clear when a recommendation needs a stronger research design.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the analytics-skills plugin — 13 skills shipped together

Good fit Use it when interpreting analytics questions about whether a change caused an outcome. It helps distinguish descriptive results, intervention claims, and counterfactual questions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/clamp-sh/analytics-skills/causal-query-classifier
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.

Any agent
npx skills add clamp-sh/analytics-skills --skill causal-query-classifier
Clone the repo
git clone --depth 1 https://github.com/clamp-sh/analytics-skills

Made for: Claude Code.

Or install analytics-skills, the plugin that ships this one along with the rest of its 13 skills.

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 causal-query-classifier

README.md
[![agentmods](https://agentmods.dev/badge/skills/clamp-sh/analytics-skills/causal-query-classifier.svg)](https://agentmods.dev/skills/clamp-sh/analytics-skills/causal-query-classifier)
Your own site
<a href="https://agentmods.dev/skills/clamp-sh/analytics-skills/causal-query-classifier"><img src="https://agentmods.dev/badge/skills/clamp-sh/analytics-skills/causal-query-classifier.svg" alt="Measured on agentmods" height="20"></a>
Per session 201 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,379 The whole file, excluding the scripts and references it only reads on demand.
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.00201 $0.04379
Opus 5 $0.00101 $0.02190
Sonnet 5 $0.00040 $0.00876
Haiku 4.5 $0.00020 $0.00438

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

Security

Grade A, and why

causal-query-classifier 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 8d 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.

skills/causal-query-classifier/SKILL.md · 265 lines

How it starts

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

Causal query classifier

Most analytics arguments lose at the question, not at the data. Someone shipped a new pricing page, CVR went up the same week, and the deck says "the page lifted CVR by 18%." The data says nothing of the sort — it says CVR was higher the week after launch. Pearl's three-rung causal hierarchy gives you a vocabulary for catching that slide before it happens.

This skill makes the rung explicit. Every question is classified before it's answered. Rung-1 questions get rung-1 answers. Rung-2 questions get either a real identification strategy or a refusal to make the claim.

When NOT to use this

  • The user is asking a purely descriptive question with no decision attached: "what's our checkout CVR this month?". That's rung-1 by construction; classification is overhead. Just answer it.
  • A randomized experiment is already running and you're reading its result. Randomization handles identification; load experiment-result-reader instead.
  • The user wants help designing an experiment. Use experiment-design tooling; this skill is for interpreting questions, not specifying tests.
  • You're inside a forecasting task (rung-1 prediction of the future), not a causal one. Predictions are rung-1; "what would the metric have been if we'd done X instead" is rung-3.

Background: Pearl's three rungs in plain language

Judea Pearl's hierarchy ranks queries by what they require of the data. Each rung subsumes the one below.

Rung 1 — Association: P(Y | X)

What is the relationship between two observed variables, exactly as the world has shown them to us. No intervention, no counterfactual. Pure observation.

  • "What's our checkout CVR?" → P(checkout | session)
  • "How does CVR vary by device?" → P(checkout | device)
  • "Mobile CVR is 1.8%, desktop is 3.6%." → joint distribution, descriptive only.

Rung-1 claims are always defensible from the data. They are also always silent about why the pattern holds. Mobile users may convert lower because mobile is worse, or because mobile attracts top-of-funnel browsers, or because the checkout form is broken on Safari. Rung-1 cannot distinguish these.

Read the full file on GitHub · 265 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. 8d ago First seen · 265 lines · 201 tokens per session scan A af87165938fc

Subscribe to this mod's changes

causal-query-classifier is a skill published in the GitHub repository clamp-sh/analytics-skills (8 stars, last pushed 2mo ago), licensed MIT. It adds 201 tokens to every session and 4,379 once invoked, about $0.0010 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.