Run cohort analysis: retention matrix and LTV by cohort. An agent skill from indranilbanerjee/digital-marketing-pro.

MITAuto-check passedData & Analytics

Install Cohort Analysis

skills CLI
$ npx skills add indranilbanerjee/digital-marketing-pro --skill cohort-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install indranilbanerjee/digital-marketing-pro cohort-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/indranilbanerjee/digital-marketing-pro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cohort-analysis .claude/skills/cohort-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cohort-analysis
GitHub stars
862
Used in
1 other repo
Token cost
~2.7k tokens
SKILL.md length
1,358 words
Files
1
Skills in repo
162
Repo updated
First seen
Licence
MIT

At a glance

Run cohort analysis: retention matrix and LTV by cohort. An agent skill from indranilbanerjee/digital-marketing-pro.

  • Works in 8 steps: Load brand context: Read… → Define cohorts based on selected type:… → Pull customer data from CRM and… → …
  • Tasks that involve Product analytics
  • SKILL.md covers Purpose, Input Required, Process and Output, plus 1 more section
  • Calls python

What it does

Cohort Analysis is an agent skill from indranilbanerjee/digital-marketing-pro. Run cohort analysis: retention matrix and LTV by cohort. Churn scoring → churn-risk. "build a retention matrix"

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Data & Analytics, covering Product analytics and Customer success. The repository describes itself as: An open-source AI marketing operating system for strategy, SEO, AEO/GEO, paid media, content, CRM, and analytics - grounded in brand context, human approval, and verifiable… The licence is MIT.

When your agent uses it

  • Tasks that involve Product analytics
  • Tasks that involve Customer success

Example prompts

  • “build a retention matrix”
  • “/cohort-analysis”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Load brand context: Read ~/.claude-marketing/brands/_active-brand.json for the active slug, then load…
  2. Define cohorts based on selected type: Segment the customer base into cohorts. For time-based: group customers by the week, month, or…
  3. Pull customer data from CRM and analytics MCPs: Gather the complete customer dataset — acquisition dates and source from CRM MCP…
  4. Build retention matrix: For each cohort, calculate the retention rate at each subsequent time interval (Week 1, Week 2, Month 1, Month 2…
  5. Calculate LTV by cohort: For each cohort, compute cumulative revenue per customer at each time interval — the average total revenue…
  6. Identify retention patterns: Analyze the retention matrix for structural patterns. When does retention stabilize (the "retention floor"…
  7. Calculate cohort health metrics: For each cohort, compute: payback period (months until cumulative revenue exceeds acquisition cost)…
  8. Save cohort data for trend tracking: Persist the cohort analysis summary as an insight via python…

What it can do on your machine

Read from SKILL.md and the folder at commit 9e949f3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cohort Analysis loads about 2.7k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 1,358 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from indranilbanerjee/digital-marketing-pro at commit 9e949f3, republished under its MIT licence (© indranilbanerjee). 1,358 words, ~2,664 tokens.

Download SKILL.mdSave it as .claude/skills/cohort-analysis/SKILL.md (or your agent's skills folder).
name
cohort-analysis
description
Run cohort analysis: retention matrix and LTV by cohort. Churn scoring → churn-risk. "build a retention matrix"

/digital-marketing-pro:cohort-analysis

Script location. If your host does not set ${CLAUDE_PLUGIN_ROOT}, the scripts are in this plugin's scripts/ folder, next to skills/.

Purpose

Perform customer cohort analysis to understand lifecycle patterns, retention, and value over time. Segment customers into cohorts by acquisition date, channel, behavior, or value tier, then track retention curves, compare cohort performance, and identify which acquisition sources produce the highest-value customers. This analysis reveals whether the business is acquiring better or worse customers over time, which channels drive long-term value versus one-time transactions, and where lifecycle interventions (onboarding improvements, re-engagement campaigns, loyalty programs) would have the greatest impact on retention and revenue.

Input Required

The user must provide (or will be prompted for):

  • Cohort type: time-based (customers grouped by acquisition week, month, or quarter — the standard cohort analysis showing retention evolution over time), channel-based (customers grouped by acquisition source — paid search, organic, social, email, referral — revealing which channels produce the most durable customers), behavioral (customers grouped by first action taken — e.g., product category purchased, feature used, content consumed — identifying which entry points lead to highest retention), or revenue-tier (customers grouped by initial purchase value — low, medium, high, enterprise — showing how starting value correlates with lifetime retention and expansion)
  • Time period and granularity: The analysis window and cohort size — weekly cohorts for the past 3 months (high resolution, best for fast-cycle businesses), monthly cohorts for the past 12 months (standard for most businesses), or quarterly cohorts for multi-year analysis (best for long-cycle B2B or subscription businesses). Granularity determines both how cohorts are defined and the retention interval measured
  • Metrics to track: Which outcomes to measure across cohorts — retention rate (percentage of cohort still active at each interval), revenue (cumulative and per-period revenue per customer), LTV (cumulative lifetime value with projected future value), engagement (login frequency, feature usage, content consumption), or multiple metrics simultaneously for a comprehensive lifecycle view
  • Data source: Where to pull customer data — CRM (deal data, customer records, lifecycle stages), analytics (website behavior, conversion events, session data), product analytics (feature usage, activation events, engagement metrics), or a combination of sources merged on customer identifier

Process

  1. Load brand context: Read ~/.claude-marketing/brands/_active-brand.json for the active slug, then load ~/.claude-marketing/brands/{slug}/profile.json. Extract business model (SaaS, eCommerce, B2B), typical customer lifecycle length, key retention metrics, and churn definition for the industry. Check for guidelines at ~/.claude-marketing/brands/{slug}/guidelines/_manifest.json. If no brand exists, ask: "Set up a brand first (/digital-marketing-pro:brand-setup)?" — or proceed with defaults.
  2. Define cohorts based on selected type: Segment the customer base into cohorts. For time-based: group customers by the week, month, or quarter they were first acquired (first purchase, account creation, or first meaningful interaction). For channel-based: group by the acquisition source attributed to their first conversion (UTM source, referral path, or CRM lead source field). For behavioral: group by the first significant action taken (first product category purchased, first feature activated, first content type consumed). For revenue-tier: group by initial transaction value bucketed into tiers (define thresholds based on the business's order value distribution — e.g., bottom 25%, middle 50%, top 25%).
  3. Pull customer data from CRM and analytics MCPs: Gather the complete customer dataset — acquisition dates and source from CRM MCP, transaction history with timestamps and values, engagement events (logins, feature usage, email opens, site visits) from analytics MCPs, churn events (cancellation, last activity date, account closure), and any customer attributes needed for cohort segmentation. Merge data from multiple sources on customer identifier, resolving duplicates and filling gaps where possible.
  4. Build retention matrix: For each cohort, calculate the retention rate at each subsequent time interval (Week 1, Week 2, Month 1, Month 2, etc. matching the selected granularity). Retention is defined as the percentage of the original cohort that performed a qualifying activity (purchase, login, engagement event — depending on the business model) during that interval. Present as a triangular matrix with cohorts as rows and time intervals as columns, with color-coded cells (green for above-average retention, red for below-average).
  5. Calculate LTV by cohort: For each cohort, compute cumulative revenue per customer at each time interval — the average total revenue generated by a customer in that cohort from acquisition through that period. Plot LTV curves showing how value accumulates over time for each cohort. Calculate the LTV:CAC ratio where acquisition cost data is available, identifying which cohorts achieve payback fastest and which generate the highest long-term return.
  6. Identify retention patterns: Analyze the retention matrix for structural patterns. When does retention stabilize (the "retention floor" — the period after which churn rate approaches zero)? Which cohorts retain best and what differentiates them from low-retention cohorts (acquisition channel, initial behavior, season of acquisition, promotional vs. organic)? Is there a critical activation window — a specific early-lifecycle period where retention diverges between customers who will retain and those who will churn? Identify the "aha moment" if behavioral data supports it.
  7. Calculate cohort health metrics: For each cohort, compute: payback period (months until cumulative revenue exceeds acquisition cost), predicted LTV (extrapolated from the retention curve and revenue trend), churn rate (percentage lost per period, both gross and net), engagement score (composite of activity frequency and depth), and expansion revenue rate (for SaaS — percentage of revenue from upsells and cross-sells within the cohort). Rank cohorts by overall health combining these metrics.
  8. Save cohort data for trend tracking: Persist the cohort analysis summary as an insight via python "${CLAUDE_PLUGIN_ROOT}/scripts/campaign-tracker.py" --brand {slug} --action save-insight --data '{"type":"cohort","insight":"retention/LTV/health summary","context":"cohort-analysis {period}"}' for longitudinal comparison — retention floor, LTV curve shape, cohort health scores, and segmentation notes. (Note: churn-predictor.py scores churn risk from behavioral signals; it does NOT store retention matrices or LTV curves — durable cohort history lives in campaign-tracker insights.) Enable month-over-month comparison of whether newer cohorts are retaining better or worse than older ones, whether channel quality is shifting, and whether lifecycle interventions are measurably improving retention curves.
Show full SKILL.md (396 more words)Show less

Output

A structured cohort analysis containing:

  • Retention matrix: Cohort-by-time-period grid showing retention percentage at each interval — color-coded with above-average cells in green and below-average in red, with cohort size (n) displayed for each row to indicate statistical reliability
  • Retention curves visualization data: Plotted retention curves for each cohort overlaid on a single chart — enabling visual comparison of retention trajectory, with the average retention curve highlighted as a baseline reference
  • LTV by cohort comparison: Cumulative LTV curves per cohort showing value accumulation over time, with current LTV, projected 12-month LTV, and LTV:CAC ratio where acquisition cost is available
  • Best and worst performing cohorts: Ranked cohort list with the top 3 and bottom 3 cohorts by retention and LTV, with hypothesized drivers for each — acquisition channel, seasonal factors, promotional activity, product changes, or onboarding differences that correlate with performance
  • Stabilization point analysis: The retention floor for each cohort type — the time interval after which monthly churn drops below a threshold (typically 1-2%) — with implications for payback period planning and customer lifetime estimation
  • Cohort trend analysis: Are newer cohorts retaining better than older ones? Month-over-month comparison of same-interval retention rates across cohorts (e.g., Month 3 retention for each successive cohort) showing whether the business is improving or degrading at acquiring durable customers
  • Intervention recommendations for underperforming cohorts: Specific, actionable recommendations for improving retention in low-performing segments — targeted re-engagement campaigns, onboarding modifications, product experience improvements, or win-back offers, with projected retention impact based on the gap between underperforming and top-performing cohorts
  • Acquisition channel quality ranking by cohort LTV: Channels ranked by the average LTV of customers they acquire — revealing which channels drive long-term value versus which drive one-time or low-retention customers, independent of volume, to inform acquisition budget allocation

Agents Used

  • analytics-analyst — Cohort definition and segmentation logic, retention matrix computation at each time interval, LTV curve calculation with cumulative revenue per customer, retention pattern identification including stabilization points and critical activation windows, cohort health metric computation (payback period, predicted LTV, churn rate, engagement score), trend analysis comparing newer versus older cohort performance, and data quality assessment with cohort size validation for statistical reliability
  • crm-manager — CRM data extraction including customer acquisition dates, transaction histories, lifecycle stage progressions, and churn events via CRM MCP, customer segmentation by acquisition source and value tier using CRM fields, and cross-referencing CRM deal data with analytics touchpoint data to build unified customer profiles for cohort assignment

© indranilbanerjee, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/cohort-analysis of indranilbanerjee/digital-marketing-pro.

Open the folder on GitHubat commit 9e949f3

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in indranilbanerjee/digital-marketing-pro, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Cohort Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cohort Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cohort Analysis this skillindranilbanerjee/digital-marketing-pro8621 repos~2.7kAutomated safety check: PassMIT
Retention Analysisliangdabiao/claude-data-analysis-ultra-main290—~1.3kAutomated safety check: NotesNone
Cohort Analysisguia-matthieu/clawfu-skills150—~864Automated safety check: PassMIT
Product Adoptionmagnus919/agent-skills115—~1.7kAutomated safety check: PassMIT
PostHog CLI Queriesdebugtheworldbot/keyStats1.5k—~1.2kAutomated safety check: PassMIT
Retentioneering Contributingretentioneering/retentioneering-tools927—~1.8kAutomated safety check: PassApache-2.0

Similar skills

  • Retention Analysis

    liangdabiao/claude-data-analysis-ultra-main

    Analyze user retention and churn using survival analysis, cohort analysis, and machine learning.

    290 GitHub stars~1.3k tokensUpdated 5 mo ago
    Data & AnalyticsAuto-check: notes
  • Cohort Analysis

    guia-matthieu/clawfu-skills

    Analyze user retention by cohort. An agent skill from guia-matthieu/clawfu-skills.

    150 GitHub stars~864 tokensUpdated 9 days ago
    Data & AnalyticsAuto-check passed
  • Product Adoption

    magnus919/agent-skills

    Diagnose and design product adoption for onboarding, activation, behavior change, feature discovery, rollout, and sustained use after launch.

    115 GitHub stars~1.7k tokensUpdated today
    Sales & SupportAuto-check passed
  • PostHog CLI Queries

    debugtheworldbot/keyStats

    Runs HogQL queries against this project's PostHog data from the terminal using posthog-cli, with bundled scripts for dashboard metadata the CLI itself has no command for.

    1.5k GitHub stars~1.2k tokensUpdated 7 days ago
    Data & AnalyticsAuto-check passed
  • Retentioneering Contributing

    retentioneering/retentioneering-tools

    Help the user turn their Retentioneering ideas, friction reports, bug findings, or feature needs into high-quality upstream contributions: from capturing and validating the idea, through minimal…

    927 GitHub stars~1.8k tokensUpdated 3 days ago
    Data & AnalyticsAuto-check passed
  • Retentioneering Product Analytics

    retentioneering/retentioneering-tools

    Analyze event logs, clickstreams, user paths, product funnels, retention, behavioral segments, transition graphs, step matrices, sequence patterns, and customer journeys using Retentioneering.

    927 GitHub stars~1.6k tokensUpdated 3 days ago
    Data & AnalyticsAuto-check passed

More from indranilbanerjee/digital-marketing-pro

All 162 skills in this repo
  • Import Template

    indranilbanerjee/digital-marketing-pro

    Import a deliverable template as a reusable placeholder template per brand.

    862 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed
  • Ab Test Plan

    indranilbanerjee/digital-marketing-pro

    Plan an A/B test by script: sample size per variant, days to run, stopping rules.

    862 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Aeo Audit

    indranilbanerjee/digital-marketing-pro

    Run a one-time AEO audit of six AI answer engines, scored per surface.

    862 GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Agent Readiness Audit

    indranilbanerjee/digital-marketing-pro

    Audit agent readiness by script: AI-crawler rules, product schema, no-JS HTML, feeds.

    862 GitHub starsUsed in 1 repo~3.7k tokens
    Auto-check passed
  • Backlink Gap

    indranilbanerjee/digital-marketing-pro

    Find backlink gap domains linking to competitors, not you, scored by script.

    862 GitHub starsUsed in 1 repo~2.6k tokens
    Auto-check passed
  • C2pa Metadata

    indranilbanerjee/digital-marketing-pro

    Embed C2PA provenance in AI-generated images, video or PDF by script.

    862 GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed

Questions about Cohort Analysis

What does Cohort Analysis do?

Run cohort analysis: retention matrix and LTV by cohort. An agent skill from indranilbanerjee/digital-marketing-pro. Cohort Analysis is an agent skill from indranilbanerjee/digital-marketing-pro. Run cohort analysis: retention matrix and LTV by cohort.

When should I use Cohort Analysis?

Cohort Analysis fits situations like: tasks that involve Product analytics; tasks that involve Customer success.

How do I install Cohort Analysis in Claude Code?

Run `npx skills add indranilbanerjee/digital-marketing-pro --skill cohort-analysis -a claude-code`. Or copy the skill folder (skills/cohort-analysis in indranilbanerjee/digital-marketing-pro) into .claude/skills/cohort-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Cohort Analysis in Codex?

Run `npx skills add indranilbanerjee/digital-marketing-pro --skill cohort-analysis -a codex`. Or copy the skill folder (skills/cohort-analysis in indranilbanerjee/digital-marketing-pro) into .agents/skills/cohort-analysis in your project. Codex loads it when a task matches its description.

Can I use Cohort Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add indranilbanerjee/digital-marketing-pro --skill cohort-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cohort-analysis, .gemini/skills/cohort-analysis, .github/skills/cohort-analysis and .opencode/skills/cohort-analysis in your project.

What does Cohort Analysis need to run?

Going by SKILL.md and its folder, Cohort Analysis needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Cohort Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cohort Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cohort Analysis use?

Cohort Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cohort Analysis use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cohort Analysis?

Skills that share tags, products or a category with Cohort Analysis: Retention Analysis (liangdabiao/claude-data-analysis-ultra-main, 290 stars), Cohort Analysis (guia-matthieu/clawfu-skills, 150 stars), Product Adoption (magnus919/agent-skills, 115 stars) and PostHog CLI Queries (debugtheworldbot/keyStats, 1.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cohort Analysis?

indranilbanerjee (a GitHub user) maintains it in indranilbanerjee/digital-marketing-pro, which has 862 GitHub stars. The repository holds 162 skills in this directory. The repository was last updated on October 9, 2026.

Source: indranilbanerjee/digital-marketing-pro on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.