← Owned media

Email & lifecycle · Step 2 of 3

Segment on behavior

Send different messages to people who behave differently.

RFM segmentation groups customers by how recently they bought, how often and how much. It's one of the most useful segmentations for a consumer brand, and Claude Code can build it from a simple customer export in minutes.

How it works

  1. Export customers and orders from your store or CRM: customer ID, order dates, order values. Remove names and emails before uploading if you prefer.
  2. Claude Code scores every customer on recency, frequency and monetary value.
  3. Claude names the segments and writes a message strategy for each.
  4. You rebuild the segments in your email platform using the rules Claude gives you.

The prompt

Run it in: Claude Code, or Claude chat with your files uploaded
The prompt
I'm uploading an order export: customer ID, order date, order value. [CSV]

Using Claude Code:
1. Calculate recency, frequency and monetary value per customer, and score each 1–5 using quintiles.
2. Group customers into clear segments, for example: Champions, Loyal, Promising new, Needs attention, At risk, Lost. Show the size, revenue share and average order value of each.
3. Show how customers move between segments over the last 12 months, if the data allows.
4. For each segment, recommend:
   - the main goal (e.g. second purchase, protect, win back)
   - the message angle and offer logic (when to discount, and when not to)
   - how often to email them
5. Translate each segment into rules I can build in my email platform (e.g. "placed 2+ orders, last order within 60 days").
6. Estimate the revenue opportunity of moving 10% of "Promising new" to "Loyal."

Don't use or show any personal information beyond customer ID.

The biggest win is usually the second purchase. Customers who buy twice are far more likely to keep buying, so give "Promising new" its own flow.

← Audit your lifecycle flows

Next: Run the campaign engine