sample-size

sample-size is a skill for Claude Code, Codex from danielrosehill/Claude-Data-Analyst-plugin. It costs 62 tokens per session (1,330 once invoked), scanned A, original, MIT.

An assessment of how much usable data a dataset provides for a specific question—not just how many rows it contains. It checks missing values, duplicates, group sizes, class balance, and whether comparisons or models have enough observations.

In plain words
What is it for?
Use it to assess questions such as comparing conversion rates, estimating averages by country, or training a classifier, with optional target, predictor, grouping, and precision details.
Why use it?
A large dataset can still provide too little information for an important subgroup or analysis, leading to unreliable conclusions.

Skill for Claude CodeCodex

Part of the claude-data-analyst plugin — 14 skills shipped together

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.

agentmods
npx agentmods add skills/danielrosehill/claude-data-analyst-plugin/sample-size
Any agent
npx skills add danielrosehill/Claude-Data-Analyst-plugin --skill sample-size
Clone the repo
git clone --depth 1 https://github.com/danielrosehill/Claude-Data-Analyst-plugin

Made for: Claude Code, Codex.

Or install claude-data-analyst, the plugin that ships this one along with the rest of its 14 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 sample-size

README.md
[![agentmods](https://agentmods.dev/badge/skills/danielrosehill/claude-data-analyst-plugin/sample-size.svg)](https://agentmods.dev/skills/danielrosehill/claude-data-analyst-plugin/sample-size)
Your own site
<a href="https://agentmods.dev/skills/danielrosehill/claude-data-analyst-plugin/sample-size"><img src="https://agentmods.dev/badge/skills/danielrosehill/claude-data-analyst-plugin/sample-size.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,330 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00062 $0.01330
Opus 5 $0.00031 $0.00665
Sonnet 5 $0.00012 $0.00266
Haiku 4.5 $0.00006 $0.00133

Measured 3d ago against content hash 55c440ea7c4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sample-size 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 3d 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/sample-size/SKILL.md · 92 lines

How it starts

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

Sample Size

Row count is not sample size. This skill characterises the effective sample the user has for the specific analysis they want to run, and tells them whether that's enough.

Inputs

  • Path to a dataset (CSV / Parquet / Excel / DuckDB table).
  • Optional: the analytical question (e.g. "compare conversion rate between A and B", "estimate mean spend per country", "train a classifier on 12 features"). If not provided, produce a general description only.
  • Optional: target column, predictor columns, grouping columns, effect size / precision the user cares about.
  • duckdb — counts, group-by cardinality, null rates.
  • uv run --with statsmodels python -c '...' — power calculations (statsmodels.stats.power), sample-size-for-proportions, sample-size-for-regression.

Procedure

Step 1 — Raw size description

Report:

  • Total rows and total columns.
  • Non-null rows per column (effective n per variable).
  • Unique rows (if duplicates matter — e.g. a "customers" table with repeated IDs isn't really that many customers).
  • Time span (if a date column exists): first timestamp, last timestamp, duration, record density (rows/day).
  • Memory footprint — helpful for deciding between in-memory vs. chunked processing.

Step 2 — Unit of analysis

Ask (or infer): what is one row? Customer? Transaction? Country-year? Sensor reading?

The honest sample size for most claims is the number of independent units, not the number of rows. If the dataset has 1M transactions from 50 customers and the question is about customer behaviour, n = 50, not 1,000,000. Surface this distinction — it's the single biggest source of misstated power.

Step 3 — Per-group and per-class cells

For each grouping column or categorical target the user mentions:

  • Group sizes: the count of rows in each level.
  • Smallest cell: the minimum count across groups. This is the binding constraint on any comparison.
  • Imbalance ratio: largest / smallest. Flag if > 10:1 — statistical tests and ML models both degrade.
  • For cross-tabs (two categorical vars): the smallest cell in the contingency table. Chi-square starts being unreliable when any expected cell is < 5.

Read the full file on GitHub · 92 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. 3d ago First seen · 92 lines · 62 tokens per session scan A 55c440ea7c4b

Subscribe to this mod's changes

sample-size is a skill published in the GitHub repository danielrosehill/Claude-Data-Analyst-plugin (11 stars, last pushed 4mo ago), licensed MIT. It adds 62 tokens to every session and 1,330 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories