Packs / data-science-public
cohort-retention
build a monthly cohort retention table from user activity events
Install
logicpacks pack use data-science-public/cohort-retentionget_pack data-science-public/cohort-retentionThe 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
- Export one row per user activity (login, order) with a date.
- Run cohorts.py.
- 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)
python-stdlib:code/cohorts.py(no install).