Referral Programs skill for Claude Code
Referral rewards you can afford and fraud can't farm. Claude sizes rewards from blended CAC and first-year margin, pays them only after a revenue event and a refund hold, and builds attribution with codes and server-side storage so referrals survive device switches and fresh app installs. It adds fraud controls for self-referrals, coupon sites, and cookie stuffing before launch, then tracks share rate, viral coefficient, cycle time, and referred-cohort retention.
- name
referral-programs - size197 lines · ≈2,600 tokens
- files1
- licenseMIT
- updated
What Claude sees before loading it
This description is the only part of the skill that sits in context all the time. Claude reads it to decide when to load the full playbook below.
description: Designs, builds, and audits customer referral and affiliate programs, covering incentive sizing from unit economics, double-sided rewards, qualifying events and reward holds, referral links and codes with server-side attribution, invite flows and share moments, fraud and self-referral prevention, affiliate commission terms and disclosure rules, and loop metrics like viral coefficient and cycle time. Use when launching a refer-a-friend or affiliate program, when referral fraud appears, or when an existing program gets few shares. Try asking
- Design a double-sided referral program for our $30/month SaaS. Our CAC is about $180
- Our referral program pays $20 per signup and we're seeing obvious fake accounts. Fix it
- Set up an affiliate program for bloggers who review our product, including commission terms
Use it when
- Launching a refer-a-friend, invite, or affiliate program
- Referral rewards are being abused or costs are out of line
- An existing program gets few shares or conversions
- Adding referral attribution to web or mobile signup flows
Skip it when
- The goal is a one-time launch spike — use product-launch
- You need to stop bot signups and credential stuffing in general — use bot-fraud-defense
How to check the result
Run the pre-launch test matrix (cross-device, app not installed, manual code, same card on two accounts, refund inside the hold) and confirm referred cohorts retain as well as others at 30 and 90 days.
The common mistake it prevents
Paying rewards on signup rather than on a paid or activated event invites fake-account farming within days of launch.
Done well means a reward the business can afford per referred customer, paid only after a qualifying event that fraud cannot fake cheaply, attribution that survives devices and browsers, share prompts placed at moments of real satisfaction, and a dashboard showing whether referred customers retain as well as everyone else.
Ground rules
- Referral programs amplify existing word of mouth; they do not create it. If retention or NPS is weak, fix the product first and say so.
- Size rewards from unit economics, never from “what competitors give”.
- Reward on value, not on signups: first payment cleared, first order delivered past the return window, or an activation milestone. Signup rewards attract fraud within days.
- Referral (customers inviting people they know) and affiliate (publishers paid commission) are different programs with different rules, tooling, and risks. Decide which one first.
- Payout rules, terms, and anything touching tax or consumer law need explicit user confirmation and a legal review flag in the plan. Never ship terms Claude drafted as final.
Workflow
- [ ] 1. Check readiness: retention, organic word of mouth, unit economics
- [ ] 2. Choose program type: referral, affiliate, or both
- [ ] 3. Size the incentive and pick the reward type
- [ ] 4. Define the qualifying event and hold period
- [ ] 5. Build attribution: links, codes, server-side storage
- [ ] 6. Design share moments and the invite flow
- [ ] 7. Add fraud controls before launch
- [ ] 8. Launch to a cohort, measure, iterate
1. Readiness
Proceed when at least two hold: 90-day retention is stable or improving, some customers already come from “a friend told me” (check signup attribution surveys), and payback on paid channels is known. Without a known CAC and gross margin, step 3 is guesswork.
2. Program type
| Situation | Program |
|---|---|
| Consumer or prosumer product people talk about with friends and colleagues | Customer referral, double-sided |
| B2B SaaS bought by teams | Customer referral with account credit, plus a partner program for agencies and consultants |
| Product reviewed and compared by bloggers, YouTubers, newsletters | Affiliate with commission |
| Marketplace (two sides) | Separate referral flows per side; reward on first completed transaction |
| Mobile app | In-app referral with deferred deep links; check store rules on rewarding with digital content |
3. Incentive sizing
Start from what one referred customer is worth:
max_reward_per_referred_customer = min(
blended CAC on paid channels,
0.3 x first-year gross margin per customer
)
Split it across both sides when double-sided (often 50/50 or slightly favoring the friend, who needs the reason to convert). Then pick the reward type:
| Reward | Best for | Notes |
|---|---|---|
| Account credit or free months | Subscription products | Cheapest real cost (margin, not price); keeps referrers engaged |
| Discount for the friend | Ecommerce, consumer subscriptions | Pair with credit for the referrer |
| Upgraded features or usage | Freemium and usage products | Strong when limits are felt (storage, credits) |
| Cash or gift cards | Rarely needed; high-trust, high-value referrals | Attracts fraud; may trigger tax reporting |
| Tiered or milestone rewards | Power referrers | Cap totals per period to bound fraud and cost |
| Charity donation | Brands where cash feels off | Lower motivation, positive brand effect |
Rule of thumb: the friend’s offer must be visible in the share message and on the landing page; a referrer reward alone rarely moves the recipient.
4. Qualifying event and holds
- Qualify on the event that represents revenue: first invoice paid, first order shipped and past the return window, or a usage milestone that correlates with retention.
- Hold referrer rewards for the refund or chargeback window (commonly 14-60 days) before they become spendable or payable.
- Define and publish: what counts, what does not (existing customers, self-referrals, coupon sites), the reward cap per period, and expiry of unused credit.
5. Attribution
- Give each referrer a stable referral code and a link carrying it (
https://example.com/r/ana23or?ref=ana23). Codes let friends who come back on another device type it at signup or checkout; links handle the common case. - On landing, store the code server-side against the visitor (first-party cookie of 30-90 days plus a server session); do not rely on third-party cookies or client-only storage.
- Attach the code to the account at signup, permanently, and show the friend’s offer (“Ana gave you a month free”) to confirm it applied.
- Attribution rule: the first valid referral code wins unless the friend types a different code manually. Paid ad clicks after a referral do not override it unless the user decides otherwise; document the rule.
- Mobile: deferred deep links (via the platform’s app links plus an attribution provider) carry the code through install. Universal links alone lose it on fresh installs.
- Record events: link created, link shared (channel), click, signup, qualifying event, reward issued, reward reversed. These feed the metrics in step 8.
6. Share moments and invite flow
Ask at moments of success, not on day one:
- After a first win (first report generated, first payment received, delivery arrived).
- After a positive survey answer or a high rating prompt.
- When the product is naturally multiplayer (inviting a collaborator is a referral).
- In the account area, always available, never in the way.
The share flow: a pre-written message the user can edit, a copy-link button, native share sheet on mobile, and email invites sent by the product only to addresses the user enters, one message, no automatic follow-ups unless the recipient opts in. Never upload or scrape the user’s address book without explicit consent; SMS invites carry their own consent rules (in the US, TCPA).
Landing page for referred visitors: name the referrer if they agreed, lead with the friend’s
offer, keep it one step from signup. Hand page copy to landing-page-copy if it needs depth.
7. Fraud controls
Common abuse and the control for each:
| Abuse | Signals | Control |
|---|---|---|
| Self-referral with a second account | Same device fingerprint, payment card, IP, or address as referrer | Block reward when payment instrument or device matches |
| Fake accounts farming signup rewards | Disposable email domains, burst signups, no activity | Reward only on paid or activated events |
| Coupon and cashback sites posting codes | Many referrals from one code, no relationship pattern, traffic from deal sites | Cap rewards per period; exclude publishers in terms; move them to the affiliate program |
| Refund after reward | Reward issued, then refund or chargeback | Hold period; claw back credit automatically |
| Affiliate brand bidding | Affiliate links appear on your own brand search ads | Prohibit trademark bidding in terms, monitor ads |
| Cookie stuffing | Clicks with no page view or impossible timing | Require click-to-landing session, audit top affiliates |
Set review thresholds (for example, any referrer above 10 qualified referrals a month gets a manual check) and keep a reversal path that does not require support tickets.
Affiliate specifics
- Commission: SaaS commonly pays 20-30 percent recurring for 12 months or a flat bounty per paid account; ecommerce pays a percentage of order value by category margin.
- Cookie window: 30-90 days; longer windows cost more and overlap other channels.
- Disclosure: affiliates must clearly disclose the relationship (in the US, under the FTC Endorsement Guides). Put the requirement in the terms and remove non-compliant affiliates.
- Use an affiliate platform for tracking, payouts, and tax forms rather than building payouts in house; collecting payout tax information is the platform’s job, not a spreadsheet’s.
8. Measure
Core metrics, tracked monthly:
- Participation: share rate (users who shared at least once / active users), invites per sharer.
- Conversion: click to signup, signup to qualifying event.
- Viral coefficient:
K = invites per user x conversion rate of invites. K above 1 is rare; K of 0.2-0.4 is a healthy contribution that lowers blended CAC. - Cycle time: days from a user’s signup to their referred friend’s qualifying event; shorter cycles compound faster than a slightly higher K.
- Quality: referred cohort 90-day retention and revenue vs non-referred; fraud reversal rate.
- Cost: reward cost per referred customer vs the cap from step 3.
Gotchas
- Launching to the whole base at once floods support with “my reward did not apply” tickets; start with 10-20 percent of active users.
- Rewards that are hard to redeem (manual claims, gift-card emails weeks later) kill repeat sharing. Make rewards automatic and visible in the account.
- A referral link that drops its parameter on redirect or in a login wall silently zeroes attribution. Test every entry path.
- Paying referrers in your own product’s credit when they are churning is worthless; consider that for low-retention segments.
- Rewarding digital content inside mobile apps for referrals can conflict with store review rules; check current App Store and Google Play guidelines before shipping.
Verification
- Test matrix before launch: desktop link, mobile link with app installed and not installed, code typed manually, cross-device signup, existing customer using a link (should not qualify), same card on two accounts (should block), refund within the hold (should reverse).
- Reward cost per referred customer stays under the step 3 cap for the first full month.
- Referred cohorts retain at least as well as other cohorts at 30 and 90 days; if not, tighten the qualifying event.
Output template
## Referral program spec — <product> (YYYY-MM-DD)
Type: <referral / affiliate>. Cap per referred customer: <$>, from CAC <$> and first-year GM <$>
Referrer reward: <...>. Friend reward: <...>. Qualifying event: <...>. Hold: <n days>
Attribution: <link format, code entry points, cookie window, rule>
Share moments: <list>
Fraud controls: <list with thresholds>
Metrics and targets: share rate, K, cycle time, referred 90-day retention
Launch: <cohort size, date, owner>. Terms: draft attached, needs legal review About this skill
Written and maintained by the Claude Skills editors to the same editorial standard as every skill in the directory: a selective trigger, a real workflow, known pitfalls and a verification step. First published , last updated . MIT licensed.