ClaudeLoops
/
Stripe revenue anomaly alert
All loops
FinanceEasy 10 min· claude-sonnet-4-5

Stripe revenue anomaly alert

Detect MRR cliffs in real time and ping #revenue with the suspect customer.

NOT DEPLOYEDNOT DEPLOYED
0143ms
Trigger
POST https://hooks.claudeloops.run/stripe-revenue-anomaly · event=linear.issue.updated
02803ms
Agent
claude-sonnet-4-5 · in 903 tok · out 230 tok
03193ms
Tools
stripe-mcp/stripe:charges.list → 200 OK · 223ms
0433ms
Verify
schema check · pydantic v2 passed
0563ms
Output
invoice row upserted · $4,120
0623ms
Notify
audit log written · runbook link attached
SUCCESS
0%
0 runs
P50
0ms
median
P95
0ms
tail
AVG COST
per run
LAST OK
never
LAST FAIL
never
none
Latency · last 30 runs0 samples
no runs yet
Latest output · what your users see
Invoice · VercelTooling
$3,523.73 USD
// press Test to run once · Watch live to keep streaming · Deploy to make it real
The problem

A single enterprise downgrade can wipe out a week of growth and you find out on Monday's dashboard review.

The outcome

Within an hour of a >5% MRR move, Slack #revenue has: customer name, dollar delta, last activity, suggested CS owner.

Ingredients & skills

Secrets
  • ANTHROPIC_API_KEY
  • STRIPE_KEY
  • SLACK_WEBHOOK_URL
Providers
  • Anthropic
  • Stripe
  • Slack
MCP servers
  • stripe-mcp
#finance#stripe#alerts

How it works

Hourly job pulls Stripe charges, Claude scores against a rolling baseline, anomalies trigger a Slack post that names the customer and the delta.

Step 1

1 — Pull last hour

Use Stripe's events feed, not a list endpoint. Cheaper and exact.

typescript
const events = await stripe.events.list({ created: { gte: Math.floor(Date.now() / 1000) - 3600 }, types: ["customer.subscription.updated", "customer.subscription.deleted"] });
Step 2

2 — Score anomalies

Tell Claude what 'normal' looks like — last 30 days of MRR — and only return outliers.

typescript
const anomalies = await claude.tools.call("flag_anomalies", { events, baseline_30d });
Step 3

3 — Post

One Slack message per anomaly. Threaded if more than three.

One-line deploy

The button above runs the same command with your saved config. This is the raw CLI form.

bash
locker schedule mrr-anomaly agent.ts --cron '15 * * * *'
https://hooks.claudeloops.run/stripe-revenue-anomaly

Related loops