# lead-sorter-kit: sort a contact-form inbox with Claude, and count what it costs

From https://brinvik.com. Free to use and change, no warranty.

## What is in the zip

- `rubric.md`, the prompt that sorts one enquiry into one of six piles: buyer, curious, customer, seller,
  job, spam. It is written in Danish, for an invented Danish firm (Vagtly ApS, shift planning for cleaning
  and care companies). It ends with two ordered checks: is this enquiry meant for us at all, and does an
  existing customer want to buy more. In our test those two lines were what moved the misfiled upsells
  back to the buyer pile.
- `rubric-original.md`, the same prompt without the two checks, so you can see the difference yourself.
- `inbox.json`, 300 invented enquiries, 50 per pile. Every person and company in them is made up.
- `answer_key.json`, the pile each enquiry belongs in. The key was settled before any model was scored:
  an independent read labelled all 300 blind and agreed with the key on every one.
- `sort_inbox.py`, a short script that sends each enquiry to Claude, prints the pile, and at the end prints
  how many it got right against the key, the misses, the tokens it really used and what that cost at list
  price, standard and through the Batch API.

## How to run it

```
pip install anthropic
export ANTHROPIC_API_KEY=...      # PowerShell: $env:ANTHROPIC_API_KEY="..."
python3 sort_inbox.py inbox.json --model claude-haiku-5-5 --key answer_key.json
python3 sort_inbox.py inbox.json --model claude-haiku-5-5 --rubric rubric-original.md --key answer_key.json
```

Use a key from the Claude Console organisation your Max or Team plan's monthly API credit lands in, and
the run is paid from that credit. Signing in to Claude Code with your plan does not draw on it.

`--effort low|medium|high` sets the effort level on Haiku 5.5 and Sonnet 5.5. `--no-thinking` switches
thinking off on Haiku 5.5. Haiku 5.5's default is medium with thinking on.

## How to use it on your own inbox

1. Rewrite the first paragraph of `rubric.md` for your own business, and the six piles for the piles your
   team actually works from. Keep the two ordered checks at the end and rewrite them for your own two most
   expensive mistakes.
2. Export 100 or more real enquiries, put them in the same shape as `inbox.json`, and write the key
   yourself before you run anything. The key is the hard part and the useful part.
3. Run it on two models. Read the misses, not the percentage: which pile did each wrong one land in, and
   what would that have cost you?
4. Only then point it at the live inbox, through the Message Batches API if the answers can wait a few
   hours, and give it its own workspace with a spend limit so it cannot eat the whole credit.

## What it will not do

- It does not read your inbox or your CRM. Getting enquiries in and piles out is the integration work.
- It does not prove anything about your messages. Ours are invented and fairly clear-cut; real inboxes
  are messier, and that is exactly why step 2 matters.
- The prices in the script were read from Anthropic's pricing page on 9 October 2026. Check them.
