Testing Referral Program Subject Lines in Claude Code
Referral campaigns live or die by the open. With marginal connected to Claude Code, you can draft, test, and optimize referral program subject lines without leaving your editor — letting the AI agent handle the email marketing busywork while you focus on the offer.
Why pair Claude Code with a referral program
Referral emails ask a lot of a subject line: they need to signal a reward, feel personal, and avoid sounding like a chain letter. That makes them ideal candidates for a subject line A/B test, because small wording shifts — "Give $20, get $20" versus "Your friends will thank you" — move open rates in ways you can't predict by intuition alone.
Claude Code already understands your campaign context from the repo and your prompts. Add marginal's email MCP server and the agent gains the ability to actually run the experiment, not just suggest copy. You describe the referral mechanic in plain language and the agent turns it into a measurable test.
- Generate referral-specific variants that emphasize the reward or the social angle
- Launch managed sends without wiring up an ESP yourself
- Read open and click metrics back inside the same Claude Code session
The workflow for referral program subject lines in Claude Code
Once marginal is configured as an MCP server in Claude Code, the AI agent email marketing loop uses four tools. Each maps to a step you'd otherwise do by hand across separate tools.
- generate_variants — produce several referral subject line angles from a single brief
- launch_test — start the subject line A/B test against your audience with tracking on
- get_results — pull open/click rates and within-test lift between variants
- recommend_next — let marginal suggest the follow-up variant or winner to scale
Writing variants worth testing
Ask Claude Code for distinct angles rather than rewordings of one idea — that gives the subject line test real signal. For a referral program, the strongest contrasts are usually reward-forward, identity-forward, and curiosity-forward framings.
Keep each test focused on one variable at a time. If you change both the reward amount and the tone, you won't know which drove the lift. marginal reports within-test lift metrics so you can attribute the win cleanly and feed that learning into the next round.
- Reward-forward: lead with the dollar amount or credit
- Identity-forward: frame the recipient as someone whose friends value their picks
- Curiosity-forward: hint at the perk without naming it
Getting started on the free tier
marginal is hosted, so there's nothing to deploy — you point Claude Code at the endpoint at https://marginal.sh/mcp, authenticate with your Bearer API key, and start running tests. The free tier covers 100 experiments per month, which is plenty to validate a referral campaign's subject lines before you scale the winner.
Read the full tool reference and setup steps in the docs at https://marginal.sh/docs/ to wire marginal into your Claude Code environment.
- Endpoint: https://marginal.sh/mcp with a marg_live_ Bearer key
- Works with Claude Code, Claude Desktop, Cursor, Windsurf, and more
- 100 experiments/month on the free tier
Get started with marginal
marginal is a hosted email marketing MCP server at marginal.sh. Sign up free, create an API key, and connect https://marginal.sh/mcp from Cursor, Codex, or Claude Desktop.
- 100 experiments/month on the free tier
- Four MCP tools: generate_variants, launch_test, get_results, recommend_next
- Listed in the MCP Registry as sh.marginal/mcp