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

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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.5 $0.00012 $0.00274
Sonnet 5.5 $0.00006 $0.00137
Haiku 4.5 $0.00003 $0.00068

Measured 1mo ago against content hash 106614c8dccb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 today), licensed MIT. It adds 29 tokens to every session and 684 once invoked, about $0.0001 per session on Opus 5.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: a self-contained HTML report of a completed change (context, intuition, decisions) with a quiz at the bottom that tests the human, not the artifact; also recalls prior quizzed work. Non-gating by default; the quizpolicy userConfig tunes offer cadence. Use when the user says 'quiz me'…

melodic-software/claude-code-plugins · 152 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 · 155 tokens

illustrate

Visual explainer for a concept or codebase topic, one idea per diagram, grounded in the real artifact and written as a markdown record plus an interactive page (markdown only on request). Presets: newcomer (default) and zero-knowledge (ELI5). Options: an STE register, and a video view too when explainer-video is…

melodic-software/claude-code-plugins · 145 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

One online documentation page turned into a verified knowledge slice: the original, section digests, independent verification records and an interview-ready handoff. Use when the user supplies a single documentation URL or asks to digest one vendor docs page into the knowledge base. Several pages or a whole site go to…

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

extract-ssot

Deduplicate repeated markdown (rule files, skill bodies, ADRs, docs) into one named source of truth and migrate every call site to cite it by exact heading. Use when the same prose, literal, or concept recurs across files: 'DRY this prose', 'extract a shared rule', 'single source of truth for X', a value-bump diff…

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