Skip to content

Python-based cohort analysis that builds retention matrices, churn rates, and revenue and LTV views by signup month.

CCM score
40 of 100
skills.sh installs
438
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers retention and churn tracking, revenue per user, and lifetime value calculations across signup-month cohorts
  • Includes runnable pandas and seaborn code that generates heatmaps, retention curves, and an average retention band
  • Models retention from a simulated user dataset, so real event data must replace the sample generator before use
  • Designed for analysts who want reusable retention and LTV code for customer lifecycle reviews

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill 'Cohort Analysis' -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Cohort Analysis

Overview

Cohort analysis tracks groups of users with shared characteristics over time, revealing patterns in retention, engagement, and lifetime value.

When to Use

  • Measuring user retention rates and identifying when users churn
  • Analyzing customer lifetime value (LTV) and payback periods
  • Comparing performance across different user acquisition channels or campaigns
  • Understanding how product changes affect different user groups over time
  • Tracking engagement patterns and identifying early warning signs of churn
  • Evaluating the long-term impact of onboarding improvements or feature releases

Core Concepts

  • Cohort: Group of users sharing a characteristic (signup date, region, etc.)
  • Cohort Size: Initial group size
  • Retention Rate: Percentage remaining active
  • Churn Rate: Percentage who left
  • Retention Curve: How cohort degrades over time

Cohort Types

  • Acquisition Date: Users grouped by signup period
  • Behavioral: Users grouped by actions taken
  • Revenue: Users grouped by purchase value
  • Geographic: Users grouped by location
  • Demographic: Users grouped by characteristics

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Data Science & Analytics, Finance & Trading
First seen
Jun 3, 2026

Questions

What does the Cohort Analysis skill do?

Cohort Analysis tracks groups of users who share a trait, such as signup date, over time. It calculates retention rates, churn rates and lifetime value, and identifies behavioral patterns for customer lifecycle analysis.

When should I use the Cohort Analysis skill?

Use Cohort Analysis to measure user retention and find when users churn, to analyze customer lifetime value and payback periods, or to compare acquisition channels and campaigns. It also helps judge whether onboarding improvements or feature releases affect groups of users over the long term.

How do I install the Cohort Analysis skill?

Run npx -y skills add aj-geddes/useful-ai-prompts --skill 'Cohort Analysis' -y inside a project. Once installed, the Cohort Analysis skill lets the agent build retention matrices, retention curves and revenue cohort heatmaps in Python with pandas, numpy, matplotlib and seaborn.

Which tools does the Cohort Analysis skill need?

The Cohort Analysis skill's examples run in Python and rely on pandas, numpy, matplotlib and seaborn. Its sample code generates synthetic user data, so you can try the retention workflow without a live user database.

Where does Cohort Analysis fit among other Data Science & Analytics skills?

Cohort Analysis is listed in the Data Science & Analytics category on Claude Marketplaces, next to azure-kusto, analyze-project, run-train, explore-run and add-analytics-instrumentation. It focuses on retention and lifetime value across groups of users rather than general data querying.

More from aj-geddes/useful-ai-prompts

All 258

Similar to Cohort Analysis

More Data Science & Analytics