count-combinations

count-combinations is a skill for Claude Code from jimmc414/claude-code-plugin-marketplace. It costs 29 tokens per session (684 once invoked), scanned A, original, MIT.

A guide for solving counting and probability problems by listing possible outcomes and counting the ones that fit. It covers arrangements, selections, card and dice problems, and random sampling simulations.

In plain words
What is it for?
Use it for permutations, combinations, sample spaces, brute-force enumeration, Monte Carlo simulations, and card, dice, or urn problems.
Why use it?
It gives a clear way to calculate chances when there are many possible outcomes, while noting when a simpler formula or a simulation is more suitable.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the norvig-patterns plugin — 54 skills shipped together

Good fit Use it for permutations, combinations, sample spaces, brute-force enumeration, Monte Carlo simulations, and card, dice, or urn problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jimmc414/claude-code-plugin-marketplace/count-combinations
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 jimmc414/claude-code-plugin-marketplace --skill count-combinations
Clone the repo
git clone --depth 1 https://github.com/jimmc414/claude-code-plugin-marketplace

Made for: Claude Code.

Or install norvig-patterns, the plugin that ships this one along with the rest of its 54 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 count-combinations

README.md
[![agentmods](https://agentmods.dev/badge/skills/jimmc414/claude-code-plugin-marketplace/count-combinations.svg)](https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/count-combinations)
Your own site
<a href="https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/count-combinations"><img src="https://agentmods.dev/badge/skills/jimmc414/claude-code-plugin-marketplace/count-combinations.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 684 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.00029 $0.00684
Opus 5 $0.00015 $0.00342
Sonnet 5 $0.00006 $0.00137
Haiku 4.5 $0.00003 $0.00068

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

Security

Grade A, and why

count-combinations 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.

plugins/norvig-patterns/skills/count-combinations/SKILL.md · 80 lines

How it starts

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

count-combinations

When to Use

  • Probability calculations
  • Counting permutations or combinations
  • Enumerating all possibilities (brute force)
  • Monte Carlo simulation
  • Card game probabilities
  • Dice roll distributions
  • Urn/ball problems

When NOT to Use

  • When closed-form formula exists and is simpler
  • Astronomically large sample spaces (use simulation)
  • When approximation is acceptable (use sampling)

The Pattern

Define sample space explicitly, then count favorable outcomes.

from fractions import Fraction
from itertools import combinations, permutations, product

def P(event, space):
    """Probability = favorable outcomes / total outcomes."""
    favorable = event & space if isinstance(event, set) else {x for x in space if event(x)}
    return Fraction(len(favorable), len(space))

# Sample spaces
die = {1, 2, 3, 4, 5, 6}
two_dice = {(a, b) for a in die for b in die}
deck = [r + s for r in 'A23456789TJQK' for s in 'SHDC']
hands = set(combinations(deck, 5))

# Events as sets or predicates
even = {2, 4, 6}
is_flush = lambda hand: len(set(c[1] for c in hand)) == 1

Example (from pytudes Probability.ipynb)

from fractions import Fraction
from itertools import combinations

def P(event, space):
    """The probability of an event, given a sample space."""
    favorable = {x for x in space if x in event} if isinstance(event, set) \
                else {x for x in space if event(x)}
    return Fraction(len(favorable), len(space))

# Urn problem: 6 blue, 9 red, 8 white balls; draw 6
def balls(color, n):
    return [f'{color}{i}' for i in range(1, n + 1)]

urn = balls('B', 6) + balls('R', 9) + balls('W', 8)
U6 = set(combinations(urn, 6))

def select(color, n, space=U6):
    """Event: exactly n balls of given color."""
    return {s for s in space if sum(1 for b in s if b[0] == color) == n}

# Probability of drawing 3 blue, 1 red, 2 white
P(select('B', 3) & select('R', 1) & select('W', 2), U6)
# Returns: Fraction(240, 4807)

Read the full file on GitHub · 80 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 · 80 lines · 29 tokens per session scan A 106614c8dccb

Subscribe to this mod's changes

count-combinations is a skill published in the GitHub repository jimmc414/claude-code-plugin-marketplace (4 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 684 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

quiz-me

Post-work comprehension check: after a change is complete, generate a self-contained HTML report of what was done (context, intuition, decisions) with a quiz at the bottom that you answer. Verifying the HUMAN absorbed the work, not the artifact. Non-gating by default; the quizpolicy userConfig tunes offer cadence.…

melodic-software/claude-code-plugins · 177 tokens

eli5

Dead-simple VISUAL explainer. Produces a visual HTML explainer that assumes zero prior knowledge: one idea per diagram, minimal text. Works on a codebase object (a module, a tradeoff, an incident) or a general concept, and grounds in the real artifact before drawing anything. Use when: 'ELI5', 'explain like I'm five'…

melodic-software/claude-code-plugins · 165 tokens

principles

Metric literacy for what this plugin reports: what cyclomatic complexity, cognitive complexity, Halstead difficulty, lines per file, duplication, coverage, CRAP, and type debt mean, and what none of them can tell you. Four reference files carry the definitions and what each collector computes, each bundled reference…

melodic-software/claude-code-plugins · 218 tokens

explain

One-shot plain-language explainer. Drops any concept, code, error, architecture, or the previous assistant response to genuinely plain words (concrete analogy, zero jargon), then layers altitude up only on request (high-school, then peer level). Use when: 'I don't understand this', 'I don't get it', 'what does this…

melodic-software/claude-code-plugins · 221 tokens

grounding

Ground an approach in how a Dometrain course teaches it, via the Dometrain MCP server, and cite lessons with timestamped deep links. Use when: 'implementing', 'designing', 'reviewing', or 'debugging' anything covered by a Dometrain course — C#/.NET, ASP.NET Core, EF Core, testing, design patterns, architecture…

melodic-software/claude-code-plugins · 91 tokens

docpage-digest

Ingest a single online documentation page (a docs-site URL) into a verified knowledge slice. Fetch the original, inventory it into a SOURCES.md, fan out per-section digest agents, run dual verification (one cross-vendor verifier), and hand off an interview-ready decision artifact. Use when: 'digest this doc', 'ingest…

melodic-software/claude-code-plugins · 210 tokens