Skip to content

Packs / data-science-public

cohort-retention

build a monthly cohort retention table from user activity events

L2 Checks passed 3 of 3 runsv1.0.0Tech-Realm/space-data-science-public

Install

logicpacks pack use data-science-public/cohort-retention
get_pack data-science-public/cohort-retention

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: python-stdlib
  • Checks: 1 in outcome/checks.yaml
  • Code: cohorts.py
  • Tools: python3

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

Build a monthly cohort retention table from user activity events.

Steps

  1. Export one row per user activity (login, order) with a date.
  2. Run cohorts.py.
  3. Read down each column: is month-N retention improving for newer cohorts?

Edge cases

  • Users with activity before the export window look like new users.
  • Use weekly cohorts for fast-moving products (change the bucketing).

Don'ts

  • Don't mix signup and activity definitions between periods.

Routes (free first)

  1. python-stdlib: code/cohorts.py (no install).