Calculate net revenue retention from your Stripe subscriptions every month

On the 2nd: net revenue retention over 12 months from Stripe invoices, with expansion, contraction and churn from last year's customers.

Runs
2nd of the month at 9:00
Uses
Stripe
Posts
Stat tile

From your apps to your board

How the skill works: your agent reads paid invoices from Stripe, 2nd of the month at 9:00, and gives you net revenue retention and the report in the chat.

Reads

  • StripePaid invoices
reads
Your agentClaude Code, Codex, Cursor or Gemini2nd of the month at 9:00
posts

You get

  • Net revenue retentionA stat tile on your board, with its trend
  • The report in the chatEvery run, with or without Briefkin

What you get

  • NRR over 12 months, with the last 8 months as a trend.
  • Starting revenue of last year's customers, and their revenue now.
  • Expansion, contraction and churned revenue, with customer counts.
  • One line on what drove the change.

The card on the right is a sample. Yours shows your own numbers and updates in place every run.

What lands on your board

AcmeNet revenue retention108%+1% vs previous period, bettervs last report
Expansion$14,200
Contraction$3,100
Churned$4,500
An example with made-up numbers. Your agent posts your real ones.

What it does

Net revenue retention is the number investors ask about after MRR, and Stripe's dashboard does not show it. It answers one question: if you had stopped selling to new customers a year ago, would revenue have grown or shrunk? Above 100% means existing customers expand faster than others leave.

The agent rebuilds each customer's monthly recurring revenue from paid subscription invoices, takes the customers who were paying a year ago, and compares what they pay now with what they paid then. Expansion, contraction and churn are shown separately, so 104% from heavy expansion and heavy churn does not read like a quiet 104%.

How it works

  1. 1Load paid invoices

    GET /v1/invoices?status=paid&created[gte]=<24 months ago>&limit=100, following starting_after. Read each invoice's lines, and GET /v1/invoices/{id}/lines when has_more is true. The extra year covers annual plans billed before the start month.

  2. 2

    2Rebuild monthly revenue per customer

    Keep subscription lines. Take each line's amount less its discount_amounts, before tax, and spread it over the months in its period (an annual line adds a twelfth to each month). Sum by customer and month.

  3. 3

    3Take last year's customers

    The cohort is every customer with revenue in the same month last year (for a run on October 2, September 2025). Compare their revenue then with last month (September 2026).

  4. 4

    4Split the change

    Expansion: customers now paying more. Contraction: paying less but still paying. Churn: paying nothing. NRR is the cohort's revenue now over its revenue then. Report other currencies separately, or convert at one fixed rate.

  5. 5

    5Post the tile

    NRR is the headline in percent with the last 8 months, each computed the same way from the invoices already loaded. Expansion, contraction and churn go in the glance; the bridge from then to now opens with the card.

  6. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/stripe-net-revenue-retention/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the stripe-net-revenue-retention skill

    Or paste the prompt instead of installing:

    promptUsing the Stripe API, list paid invoices from the last 24 months with their lines. Rebuild monthly recurring revenue per customer from subscription lines: amount less discount_amounts, before tax, spread across the months in each line's period (annual lines count a twelfth per month). Take the customers with revenue in the same month last year and compare their revenue then with last month. Give me net revenue retention, the starting and current revenue of that cohort, and expansion, contraction and churned revenue with customer counts. Show the last 8 months of NRR computed the same way. Read only.
  3. Put it on a schedule

    2nd of the month at 9:00, from cron on any machine where Claude Code is signed in:

    crontab0 9 2 * * claude -p "Run the stripe-net-revenue-retention skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a stat tile. How setup works

View the SKILL.mdRaw file
SKILL.md---
name: stripe-net-revenue-retention
description: "On the 2nd: net revenue retention over 12 months from Stripe invoices, with expansion, contraction and churn from last year's customers. Use when the user asks for this, or when it runs on a schedule."
---

# Stripe net revenue retention

On the 2nd: net revenue retention over 12 months from Stripe invoices, with expansion, contraction and churn from last year's customers.

Net revenue retention is the number investors ask about after MRR, and Stripe's dashboard does not show it. It answers one question: if you had stopped selling to new customers a year ago, would revenue have grown or shrunk? Above 100% means existing customers expand faster than others leave.

The agent rebuilds each customer's monthly recurring revenue from paid subscription invoices, takes the customers who were paying a year ago, and compares what they pay now with what they paid then. Expansion, contraction and churn are shown separately, so 104% from heavy expansion and heavy churn does not read like a quiet 104%.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- A Stripe restricted key with Read on Invoices, Subscriptions and Customers, in `STRIPE_API_KEY`, or the Stripe MCP server signed in with read access.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Load paid invoices** (Stripe): `GET /v1/invoices?status=paid&created[gte]=<24 months ago>&limit=100`, following `starting_after`. Read each invoice's `lines`, and `GET /v1/invoices/{id}/lines` when `has_more` is true. The extra year covers annual plans billed before the start month.
2. **Rebuild monthly revenue per customer**: Keep subscription lines. Take each line's `amount` less its `discount_amounts`, before tax, and spread it over the months in its `period` (an annual line adds a twelfth to each month). Sum by customer and month.
3. **Take last year's customers**: The cohort is every customer with revenue in the same month last year (for a run on October 2, September 2025). Compare their revenue then with last month (September 2026).
4. **Split the change**: Expansion: customers now paying more. Contraction: paying less but still paying. Churn: paying nothing. NRR is the cohort's revenue now over its revenue then. Report other currencies separately, or convert at one fixed rate.
5. **Post the tile**: NRR is the headline in percent with the last 8 months, each computed the same way from the invoices already loaded. Expansion, contraction and churn go in the glance; the bridge from then to now opens with the card.

## Route B: the browser

### What you need

- Signed in to the Stripe Dashboard with the Analyst, Developer or Administrator role in live mode; Sigma is a paid add-on and needs to be enabled on the account.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://dashboard.stripe.com/billing. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Read the Billing overview**: Open **Billing** in the left menu and stay on **Overview**, in live mode. The analytics there include MRR, churn and a **Net revenue retention** figure. Set the period to last month and read NRR and its trend; this is Stripe's own calculation and the quickest answer.
2. **Rebuild the bridge in Sigma**: For expansion, contraction and churn by customer, open **Reports > Sigma** and run a query over `invoice_line_items` joined to `invoices` with `status = 'paid'` and `subscription_id` set, summing `amount - discount_amount` per customer per month over the last 24 months. Compare each customer's September 2025 revenue with September 2026 and classify as expansion, contraction or churned.
3. **Export when the table is long**: Sigma results cap on screen; use **Export** to CSV for more than a few hundred customers. Without Sigma, **Billing > Subscriptions** filtered by status shows today's prices only, which is not enough for a year-over-year comparison.
4. **Report**: NRR for the cohort, its revenue then and now, and expansion, contraction and churned revenue with customer counts, plus one line on the driver. Note other currencies separately.

Note: Stripe's dashboard NRR may differ from the invoice-based figure: it is computed from subscription MRR, counts trials and pauses differently and nets out some credits. Report which one you used. Sigma data lags live data by a few hours. Without Sigma, the browser route gives only the headline figure, not the bridge.

## The report

- **NRR** over 12 months, with the last 8 months as a trend.
- **Starting revenue** of last year's customers, and their revenue now.
- **Expansion**, **contraction** and **churned** revenue, with customer counts.
- One line on what drove the change.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "stripe-net-revenue-retention/<date of this run, e.g. 2026-10-16>",
  "item_key": "stripe-net-revenue-retention",
  "project": "Acme",
  "source": "Stripe net revenue retention skill",
  "kind": "metric",
  "title": "Net revenue retention at 108%, up a point",
  "metric": {
    "label": "Net revenue retention",
    "value": 108,
    "unit": "%",
    "better": "higher",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": {
    "type": "Grid",
    "props": {
      "columns": 3
    },
    "children": [
      {
        "type": "Stat",
        "props": {
          "label": "Expansion",
          "value": 14200,
          "prefix": "$",
          "tone": "ok"
        }
      },
      {
        "type": "Stat",
        "props": {
          "label": "Contraction",
          "value": 3100,
          "prefix": "$",
          "tone": "warn"
        }
      },
      {
        "type": "Stat",
        "props": {
          "label": "Churned",
          "value": 4500,
          "prefix": "$",
          "tone": "bad"
        }
      }
    ]
  },
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Monthly revenue bridge",
          "Customers",
          "Amount"
        ],
        "align": [
          "left",
          "right",
          "right"
        ],
        "rows": [
          [
            "September 2025 cohort",
            148,
            "$82,500"
          ],
          [
            "Expansion",
            31,
            "+$14,200"
          ],
          [
            "Contraction",
            9,
            "-$3,100"
          ],
          [
            "Churned",
            12,
            "-$4,500"
          ],
          [
            "Same customers, September 2026",
            136,
            "$89,100"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "Seat growth at 31 customers more than covered 12 cancellations. Churn was 5.5% of starting revenue.",
        "tone": "info"
      }
    }
  ],
  "size": "md"
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

Set `period_start` and `period_end` to the window the number covers: the tile names it from them ("Last 7 days", "Today", "This month"). For a count right now (open items, a balance), send `"period_label": ""` so no period shows; for another name, send it as `period_label` (at most 24 characters).

## Run it on a schedule

Suggested: 2nd of the month at 9:00 (`0 9 2 * *`). From cron, with the agent signed in on that machine:

```bash
0 9 2 * * claude -p "Run the stripe-net-revenue-retention skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/stripe-net-revenue-retention#schedule

Source: https://briefkin.dev/skills/stripe-net-revenue-retention

What your agent needs

  • A Stripe restricted key with Read on Invoices, Subscriptions and Customers, in STRIPE_API_KEY, or the Stripe MCP server signed in with read access.

Connecting Stripe

  1. Stripe MCP server, Stripe's official remote server at https://mcp.stripe.com. Add Stripe from Claude's connector directory, or run claude mcp add --transport http stripe https://mcp.stripe.com/, and sign in with OAuth; clients without OAuth can send a restricted key as a Bearer token.
  2. The Stripe CLI. Run stripe login once, then stripe subscriptions list --status active --limit 100 or stripe invoices list --status open. The CLI defaults to test mode, so add --live for real data.
  3. API with a restricted key. Create a restricted key (rk_live_...) in the Dashboard under Developers > API keys, store it in STRIPE_API_KEY, and give it Read on the resources the report touches: Subscriptions, Invoices, Charges, Customers, PaymentIntents, Balance and Disputes.

Never hand an agent the secret key (sk_live_...); a restricted key with Read where needed and None everywhere else can't refund, cancel or charge anything.

Questions

Why rebuild revenue from invoices instead of reading subscriptions?

A subscription shows today's price, not what the customer paid a year ago. Paid invoices are the record of both. If you have Stripe Sigma, the same calculation is one SQL query over invoice line items, which is faster for large accounts.

How are refunds, credits and one-off charges handled?

One-off invoice items and usage overages are left out, because NRR measures recurring revenue. Refunds and credit notes are not subtracted either; if you refund often, ask the skill to net out credit notes for the two months it compares.

Do I need Briefkin to use the Stripe net revenue retention skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a stat tile, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the Stripe pages themselves: the agent opens dashboard.stripe.com/billing in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Watch net revenue retention on your board, run after run

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.