analyze-cohorts

analyze-cohorts is a command for Claude Code from phuryn/pm-skills. It costs 16 tokens per session (782 once invoked), scanned A, original, MIT.

A command for cohort analysis, which compares groups of users who share a starting point, such as the month they signed up. It examines retention, feature use, and engagement over time.

In plain words
What is it for?
Use it with a CSV or a plain-language question to study retention by signup period, acquisition source, plan, or first feature used, and to create an analysis query when data is missing.
Why use it?
It turns user activity data into a structured view of where people keep using a product or stop using it. Without this, trends across different user groups can be difficult to compare.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the pm-data-analytics plugin — 3 skills, 3 commands shipped together

Good fit Use it with a CSV or a plain-language question to study retention by signup period, acquisition source, plan, or first feature used, and to create an analysis query when data is missing.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/phuryn/pm-skills/analyze-cohorts
About the project

phuryn/pm-skills is a marketplace of reusable skills, commands, and plugins that guide AI assistants through product-management work such as discovery, strategy, planning, metrics, launches, and growth. It is for product managers and teams using Claude Code, Cowork, or compatible assistants. The catalogue entries are the project's own workflows and extensions.

phuryn/pm-skills · 26,161 stars · on GitHub · productcompass.pm

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/phuryn/pm-skills

Made for: Claude Code.

Or install pm-data-analytics, the plugin that ships this one along with the rest of its 3 skills, 3 commands.

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 analyze-cohorts

README.md
[![agentmods](https://agentmods.dev/badge/commands/phuryn/pm-skills/analyze-cohorts/github.svg)](https://agentmods.dev/commands/phuryn/pm-skills/analyze-cohorts)
Your own site
<a href="https://agentmods.dev/commands/phuryn/pm-skills/analyze-cohorts"><img src="https://agentmods.dev/badge/commands/phuryn/pm-skills/analyze-cohorts/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 analyze-cohorts

Your own site · 80×15
<a href="https://agentmods.dev/commands/phuryn/pm-skills/analyze-cohorts"><img src="https://agentmods.dev/badge/commands/phuryn/pm-skills/analyze-cohorts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 782 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.00016 $0.00782
Opus 5 $0.00008 $0.00391
Sonnet 5 $0.00003 $0.00156
Haiku 4.5 $0.00002 $0.00078

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

Security

Grade A, and why

analyze-cohorts 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 11d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

pm-data-analytics/commands/analyze-cohorts.md · 100 lines

How it starts

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

/analyze-cohorts -- Cohort Analysis

Analyze user retention and engagement patterns by cohort. Upload your data or describe what you need, and get retention curves, feature adoption trends, and actionable insights.

Invocation

/analyze-cohorts [upload a CSV of user activity data]
/analyze-cohorts Monthly retention for users who signed up in Jan-Jun, grouped by acquisition channel
/analyze-cohorts Help me set up a cohort analysis for our onboarding redesign

Workflow

Step 1: Accept Data or Define Analysis

Two paths:

  • With data: User uploads a CSV/spreadsheet with user-level data (user_id, signup_date, activity_date, event_type, etc.)
  • Without data: User describes the analysis they need → generate the SQL query and analysis framework

Step 2: Define Cohorts

Ask:

  • What defines a cohort? (signup week/month, acquisition channel, plan tier, first feature used)
  • What is the retention event? (login, core action, any activity, purchase)
  • What time granularity? (daily, weekly, monthly)
  • What time range?

Step 3: Analyze

Apply the cohort-analysis skill:

If data is provided:

  • Process the data using Python (pandas) to create cohort tables
  • Calculate retention rates per cohort per period
  • Generate retention curves
  • Identify patterns: improving/declining cohorts, seasonal effects, anomalies
  • Compare feature adoption across cohorts

If describing an analysis:

  • Design the cohort analysis framework
  • Generate SQL queries to extract the data
  • Create a template spreadsheet for the analysis
  • Define the metrics and visualization approach

Step 4: Generate Report

## Cohort Analysis: [Description]

**Date**: [today]
**Cohort definition**: [e.g., signup month]
**Retention event**: [e.g., completed a project]
**Granularity**: [weekly/monthly]

### Retention Table
| Cohort | Size | Week 1 | Week 2 | Week 3 | ... | Week 12 |
|--------|------|--------|--------|--------|-----|---------|

### Key Findings
1. **[Finding]** — [supporting data]
2. ...

### Cohort Comparison
- **Best-performing cohort**: [which, why]
- **Worst-performing cohort**: [which, why]
- **Trend**: [improving/declining/stable over time]

### Retention Benchmarks
| Period | Your Rate | Industry Benchmark | Gap |
|--------|----------|-------------------|-----|

### Recommendations
1. [What to investigate or change based on findings]
2. ...

### Follow-Up Queries
[SQL queries for deeper investigation]

Read the full file on GitHub · 100 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. 11d ago First seen · 100 lines · 16 tokens per session scan A 33ef1cef6d6d

Subscribe to this mod's changes

analyze-cohorts is a command published in the GitHub repository phuryn/pm-skills (26,161 stars, last pushed 2mo ago), licensed MIT. It adds 16 tokens to every session and 782 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-30.