Agent skill

Cohort Analysis

by nimrodfisher in nimrodfisher/data-analytics-skills

Time-based cohort analysis with retention and behaviour tracking.

MITAuto-check passedData & Analytics

Install Cohort Analysis

skills CLI
$ npx skills add nimrodfisher/data-analytics-skills --skill cohort-analysis -a claude-code

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

GitHub CLI
$ gh skill install nimrodfisher/data-analytics-skills 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/nimrodfisher/data-analytics-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/03-data-analysis-investigation/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
470
Token cost
~660 tokens
SKILL.md length
295 words
Files
9 (incl. scripts, references, assets)
Skills in repo
31
Repo updated
First seen
Licence
MIT

At a glance

Time-based cohort analysis with retention and behaviour tracking.

  • Works in 7 steps: Define the cohort and activity —… → Pull or build the data — if starting… → Build the cohort table — run… → …
  • Tasks that involve Product analytics
  • Runs Python scripts from its folder

What it does

Cohort Analysis is an agent skill from nimrodfisher/data-analytics-skills. Time-based cohort analysis with retention and behaviour tracking. Activate when you need to measure how groups of users/customers behave over time — retention rates, revenue by cohort, or feature adoption curves.

Its SKILL.md is about 660 tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including scripts, reference files and assets (for example `assets/cohort_report_template.md`, `references/cohort_definition_patterns.md` and `references/retention_metrics_glossary.md`).

It sits in Data & Analytics, covering Product analytics. The repository describes itself as: A comprehensive list of Claude & Codex skills for a wide range of data analytics tasks. The licence is MIT.

When your agent uses it

  • Tasks that involve Product analytics

Example prompts

  • “/cohort-analysis”

Requirements

  • Python 3

Workflow steps

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

  1. Define the cohort and activity — clarify: cohort grouping (signup month, first purchase date, etc.) and retention event (login, purchase…
  2. Pull or build the data — if starting from a database, use scripts/cohort_query.sql as the starting point. Adapt the cohort_date and…
  3. Build the cohort table — run scripts/cohort_builder.py to produce a cohort × period membership table from event data. Output is a CSV with…
  4. Compute the retention matrix — run scripts/retention_matrix.py on the cohort table to generate the period-over-period retention rates…
  5. Visualise — run scripts/cohort_visualizer.py to render a heatmap of the retention matrix and a time-series of retention curves per cohort.
  6. Interpret findings — consult references/retention_metrics_glossary.md for metric definitions and references/cohort_definition_patterns.md…
  7. Write the report — fill assets/cohort_report_template.md. For a visual deliverable, fill in the assets/retention_matrix.html heatmap…

What it can do on your machine

Read from SKILL.md and the folder at commit 9449d36. 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

    Ships 4 files in scripts/ (Python), which the agent can run.

    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 660 tokens when it runs, and up to ~2.8k if it reads all its reference files. Until then it costs about 57 tokens; SKILL.md has 295 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~660
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.8k

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); the scripts in this folder are not scanned.

SKILL.md

The full file from nimrodfisher/data-analytics-skills at commit 9449d36, republished under its MIT licence (© nimrodfisher). 295 words, ~660 tokens.

Download SKILL.mdSave it as .claude/skills/cohort-analysis/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
cohort-analysis
description
Time-based cohort analysis with retention and behaviour tracking. Activate when you need to measure how groups of users/customers behave over time — retention rates, revenue by cohort, or feature adoption curves.

When to use

  • A stakeholder asks "are we retaining users better than last quarter?"
  • You need to measure N-day, weekly, or monthly retention for a product or feature
  • You want to compare how different acquisition cohorts (by channel, plan, or signup date) perform over their lifetime
  • You're investigating churn and need to identify at which period users typically leave

Process

  1. Define the cohort and activity — clarify: cohort grouping (signup month, first purchase date, etc.) and retention event (login, purchase, feature use). Document in the report header.
  2. Pull or build the data — if starting from a database, use scripts/cohort_query.sql as the starting point. Adapt the cohort_date and activity_date columns to your schema.
  3. Build the cohort table — run scripts/cohort_builder.py to produce a cohort × period membership table from event data. Output is a CSV with user_id, cohort_period, activity_period.
  4. Compute the retention matrix — run scripts/retention_matrix.py on the cohort table to generate the period-over-period retention rates. Output is an N×M matrix (cohort × period).
  5. Visualise — run scripts/cohort_visualizer.py to render a heatmap of the retention matrix and a time-series of retention curves per cohort.
  6. Interpret findings — consult references/retention_metrics_glossary.md for metric definitions and references/cohort_definition_patterns.md for pattern recognition.
  7. Write the report — fill assets/cohort_report_template.md. For a visual deliverable, fill in the assets/retention_matrix.html heatmap template.

Inputs the skill needs

  • Required: event data with user_id, cohort_date (e.g. signup_date), activity_date
  • Required: cohort grouping granularity (daily / weekly / monthly)
  • Required: retention event definition — what counts as "active" or "retained"?
  • Optional: minimum cohort size (recommend ≥ 100 users; smaller cohorts have noisy rates)
  • Optional: number of periods to track (e.g. 12 months)
  • Optional: cohort attributes to segment by (acquisition channel, plan tier, geography)

Output

  • assets/cohort_report_template.md (filled) — narrative interpretation and retention figures
  • assets/retention_matrix.html (filled) — colour-coded retention heatmap
  • scripts/retention_matrix.py output CSV — raw retention rates for downstream use

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

Files

SKILL.md and 8 other files (scripts, references, assets) in 03-data-analysis-investigation/cohort-analysis of nimrodfisher/data-analytics-skills.

  • SKILL.md
  • assets/cohort_report_template.md
  • assets/retention_matrix.html
  • references/cohort_definition_patterns.md
  • references/retention_metrics_glossary.md
  • scripts/cohort_builder.py
  • scripts/cohort_query.sql
  • scripts/cohort_visualizer.py
  • scripts/retention_matrix.py

Open the folder on GitHubat commit 9449d36

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 skillnimrodfisher/data-analytics-skills470—~660Automated safety check: PassMIT
PostHog CLI Queriesdebugtheworldbot/keyStats1.5k—~1.2kAutomated safety check: PassMIT
Retentioneering Contributingretentioneering/retentioneering-tools927—~1.8kAutomated safety check: PassApache-2.0
Retentioneering Product Analyticsretentioneering/retentioneering-tools927—~1.6kAutomated safety check: PassApache-2.0
Feature Analytics Instrumentation Plannermistralai/mistral-vibe5.1k—~2.2kAutomated safety check: PassApache-2.0
Funnel Analysisliangdabiao/claude-data-analysis-ultra-main2901 repos~781Automated safety check: NotesNone

Similar skills

  • 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 2 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 2 days ago
    Data & AnalyticsAuto-check passed
  • Official

    Plans which analytics events and properties a new feature needs, checks them against the existing event registry, and verifies them per environment.

    5.1k GitHub stars~2.2k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Funnel Analysis

    liangdabiao/claude-data-analysis-ultra-main

    Analyze user conversion funnels, calculate step-by-step conversion rates, create interactive visualizations, and identify optimization opportunities.

    290 GitHub starsUsed in 1 repo~781 tokens
    Data & AnalyticsAuto-check: notes
  • Event Tracking

    linuxfoundation/insights

    Add event tracking calls to Vue/Nuxt components in the Insights app using the useTrackEvent composable.

    282 GitHub stars~1.9k tokensUpdated 8 days ago
    Data & AnalyticsAuto-check passed

More from nimrodfisher/data-analytics-skills

All 31 skills in this repo
  • Ab Test Analysis

    nimrodfisher/data-analytics-skills

    Rigorous A/B test statistical analysis. An agent skill from nimrodfisher/data-analytics-skills.

    470 GitHub stars~708 tokensUpdated 15 days ago
    Auto-check passed
  • Analysis Assumptions Log

    nimrodfisher/data-analytics-skills

    Track and document analytical assumptions and decisions. An agent skill from nimrodfisher/data-analytics-skills.

    470 GitHub stars~578 tokensUpdated 15 days ago
    Auto-check passed
  • Analysis QA Checklist

    nimrodfisher/data-analytics-skills

    Pre-delivery quality assurance for analysis work. An agent skill from nimrodfisher/data-analytics-skills.

    470 GitHub stars~470 tokensUpdated 15 days ago
    Auto-check passed
  • Business Metrics Calculator

    nimrodfisher/data-analytics-skills

    Standard business metric calculation with industry benchmarks.

    470 GitHub stars~668 tokensUpdated 15 days ago
    Auto-check passed
  • Context Packager

    nimrodfisher/data-analytics-skills

    Efficiently package context for AI-assisted analysis. An agent skill from nimrodfisher/data-analytics-skills.

    470 GitHub stars~500 tokensUpdated 15 days ago
    Auto-check passed
  • Data Catalog Entry

    nimrodfisher/data-analytics-skills

    Create standardized metadata for data assets. An agent skill from nimrodfisher/data-analytics-skills.

    470 GitHub stars~616 tokensUpdated 15 days ago
    Auto-check passed

Questions about Cohort Analysis

What does Cohort Analysis do?

Time-based cohort analysis with retention and behaviour tracking. Cohort Analysis is an agent skill from nimrodfisher/data-analytics-skills. Time-based cohort analysis with retention and behaviour tracking.

When should I use Cohort Analysis?

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

How do I install Cohort Analysis in Claude Code?

Run `npx skills add nimrodfisher/data-analytics-skills --skill cohort-analysis -a claude-code`. Or copy the skill folder (03-data-analysis-investigation/cohort-analysis in nimrodfisher/data-analytics-skills) 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 nimrodfisher/data-analytics-skills --skill cohort-analysis -a codex`. Or copy the skill folder (03-data-analysis-investigation/cohort-analysis in nimrodfisher/data-analytics-skills) 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 nimrodfisher/data-analytics-skills --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 Python for the scripts in its folder. 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

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 660 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.1k tokens, read only when the agent opens those files.

What are the alternatives to Cohort Analysis?

Skills that share tags, products or a category with Cohort Analysis: PostHog CLI Queries (debugtheworldbot/keyStats, 1.5k stars), Retentioneering Contributing (retentioneering/retentioneering-tools, 927 stars), Retentioneering Product Analytics (retentioneering/retentioneering-tools, 927 stars) and Feature Analytics Instrumentation Planner (mistralai/mistral-vibe, 5.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cohort Analysis?

nimrodfisher (a GitHub user) maintains it in nimrodfisher/data-analytics-skills, which has 470 GitHub stars. The repository holds 31 skills in this directory. The repository was last updated on September 25, 2026.

Source: nimrodfisher/data-analytics-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.