Sales use cases
Sales

Qualify and route inbound leads

Build an agent that reads every inbound lead, scores it against your ideal-customer rules, enriches it, and routes it to the right rep in seconds instead of hours. Your team owns the rules and the code.

7 min read2026-06-17Human in the loopMedium-sensitivity data
Ease
4/5
Impact
5/5
Risk
3/5

Tools you'll use

Claude CodeCodexClaude Cowork

Lead qualification and routing is the work of deciding which inbound prospects are worth a salesperson's time and getting each one to the right rep, fast. A form comes in, a chat starts, an email lands. Someone has to judge fit (do they match who we sell to?), judge intent (are they ready to talk?), and hand the lead to the right person before the prospect loses interest or a competitor answers first.

Speed is the whole game, and most companies are slow. A Harvard Business Review study of 2,241 U.S. companies found the average firm took 42 hours to respond to a web lead, and that firms contacting a prospect within an hour were nearly seven times more likely to have a meaningful conversation that qualified the lead than those who waited just one more hour (HBR, 2011). The earlier MIT/InsideSales lead-response study put a finer point on it: the odds of qualifying a lead are 21 times higher when you reach out within 5 minutes versus 30 minutes (Lead Response Management study, MIT Sloan / InsideSales, 2007).

The bottleneck is rarely the rep. It is the dead time between "lead arrives" and "right rep is looking at it" — the manual reading, enriching, scoring, and assigning that nobody gets to until they finish their current call. An agent removes that dead time. It runs the moment a lead lands, applies your scoring rules consistently, pulls in company data, and drops a scored, enriched lead into the right rep's queue with context attached.

This is high-impact, low-glamour plumbing. Done well, it shrinks first-touch from hours to seconds and stops good leads from rotting in a shared inbox over the weekend.

Moriva's take

This clears all three gates cleanly. Gate 1 (Real work): qualifying and routing inbound leads is a daily, repetitive grind that happens every week your pipeline is open. Gate 2 (Owned): built with Claude Code or Codex, the scoring rules and routing logic live in your repo as plain code your RevOps person can read, fix, and change as your ICP shifts — no black-box vendor. Gate 3 (Measured): the payoff is obvious and countable — first-response time and the share of leads contacted within five minutes. We score it GO, not a blind one, because it touches customer-facing routing; keep a human approving anything that auto-replies to a prospect.

How do you qualify and route inbound leads?

  1. 1

    Write the scoring rubric in plain English first

    Before any code, get sales and marketing in a room and agree on what 'qualified' means: which company sizes, industries, and titles you sell to (fit), and which behaviors signal readiness — pricing-page visits, demo requests, reply content (intent). If non-coders want to draft and pressure-test this, Claude Cowork is a good place to write the rubric, argue edge cases, and turn fuzzy 'good fit' instincts into explicit if-then rules. The rubric is the spec; everything downstream just implements it.

  2. 2

    Point Claude Code or Codex at your lead source and CRM

    Give the tool read access to where leads land (form webhook, inbox, or your CRM's API — HubSpot, Salesforce, Pipedrive) and describe the job in plain English: 'When a lead arrives, pull the record, score it with these rules, enrich it, and assign it.' The tool reads your existing schema, writes the integration code, and runs it. You own the result — it lives in your repo, not a vendor's platform.

  3. 3

    Build the enrichment step

    Have the agent fill the gaps a form leaves out: company size, industry, and tech stack from your existing enrichment source or CRM fields, plus a quick dedupe against existing contacts so you don't route a known customer as a new lead. Keep enrichment to data sources you already pay for and trust; don't bolt on scrapers that put you in murky legal territory.

  4. 4

    Encode the routing rules

    Translate your assignment logic into code: by territory, by product line, by deal size, round-robin within a pod, or straight to a named owner if the account already exists. The agent writes the lead to the right rep's queue with the score and the enriched context attached, so the rep opens it already knowing why it matters.

  5. 5

    Add a fast, safe acknowledgment — with a human gate

    The biggest speed win is acknowledging the lead instantly. Have the agent draft a first-touch reply or book-a-meeting link, but until you trust it, route that draft to the assigned rep for one-click send rather than auto-firing it at the prospect. This keeps you inside the five-minute window without letting an unreviewed message reach a customer.

  6. 6

    Run it on a schedule or a trigger

    Wire the agent to run the instant a lead arrives (webhook) or every few minutes as a fallback. Because it's your code, you can set it to run on your own server or scheduler — no dependence on a third party's uptime or pricing changes.

  7. 7

    Instrument it so you can prove it worked

    Have the agent log first-response time, percent contacted within five minutes, leads routed, and misroutes per week. This is Gate 3: without the numbers you can't tell whether it's saving hours or just moving them around. A weekly summary to the sales lead keeps it honest.

  8. 8

    Review misroutes weekly and tighten the rules

    Set a standing 15-minute review of anything the agent scored or routed wrong. Each miss is a rule to fix. Because the logic is plain code, your RevOps person edits it directly — over a few weeks the misroute rate drops and the rubric becomes genuinely yours.

What could go wrong (and how to handle it)

The agent misqualifies a good lead as junk and it never reaches a rep.

Never auto-delete or hard-disqualify. Send low-scoring leads to a 'review' queue, not the trash, and check that queue weekly. Tune the rubric so the cost of a false 'no' stays visible.

An unreviewed auto-reply reaches a prospect and says something wrong or off-brand.

Keep a human in the loop on customer-facing messages until you've watched it work for weeks. Have the agent draft; let the rep send. Auto-send only the most neutral acknowledgment, if at all.

Routing rules go stale as your ICP, territories, or team change, and leads quietly land on the wrong desk.

Treat the rules as living code with a named owner. Review misroutes weekly and update the logic. Because it's your repo, changes take minutes, not a vendor ticket.

Lead data — names, emails, company info — is personal data subject to privacy rules.

Keep processing inside systems you already use and that already meet your obligations. Don't pipe lead data to new third-party services without checking your privacy policy and consent basis first. Log what's accessed.

Bad enrichment data corrupts scores and CRM records.

Use enrichment sources you already trust, and have the agent flag low-confidence matches for human check rather than overwriting CRM fields silently. Dedupe before you enrich.

The team treats the agent's score as gospel and stops thinking.

Show the 'why' next to every score so reps see the reasoning, not just a number. The score ranks the queue; the rep still owns the judgment call on the call.

Prompts to get started

Stand up the scorer and router
Here is our CRM API access and our scoring rubric in scoring-rules.md. Write an integration that runs whenever a new lead hits our form webhook: pull the lead, score it 0-100 against the rubric, enrich it with company size and industry from our existing enrichment field, dedupe against existing contacts, and assign it by the territory rules in routing-rules.md. Write the score and a one-line reason into the CRM record. Keep all logic in plain, readable code we can edit later, and log every run.
Draft the rubric (non-coder, Claude Cowork)
Help me turn our sense of a 'good lead' into explicit rules. I'll describe our last 20 closed-won and 20 closed-lost deals. Find the patterns in company size, industry, title, and behavior, then propose a scoring rubric with clear if-then rules and point weights. Flag the edge cases where the rule would be wrong so we can decide them on purpose.
Add the safe acknowledgment step
Add a step that, for any lead scoring above 70, drafts a short first-touch reply and a booking link in the assigned rep's queue for one-click send — do NOT send it to the prospect automatically. Keep the draft factual and on-brand using the examples in reply-templates.md.
Prove it's working
Add logging and a weekly summary that reports median first-response time, percent of leads contacted within five minutes, total leads routed, and any leads the rep marked as misrouted. Output it as a short markdown digest I can paste into our sales channel every Monday.

FAQ

We already have lead routing in our CRM. Why build this?

Native CRM routing usually handles simple assignment, but the slow part is the judgment and enrichment before assignment — reading the lead, scoring fit and intent, filling in missing company data. An agent does that work in seconds and consistently, and because you build it, the rules match your actual sales process instead of a vendor's generic template. You own it and can extend it as you grow.

Will an AI agent send sloppy messages to our prospects?

Not if you set it up the way we recommend. The agent's job is to score, enrich, and route — the high-value plumbing. For customer-facing replies, keep a human in the loop: the agent drafts, the rep sends with one click. You only let it auto-send once you've watched it work and trust the output. Speed comes from removing dead time, not from removing judgment.

How fast can this actually be live?

For a single lead source and one CRM, a capable operator using Claude Code or Codex can have a working scorer-and-router running in about a day, then spend a week or two tuning the rules against real leads. It's plumbing, not a research project — most of the time goes into agreeing on the rubric, not writing code.

What happens when our ideal customer or territories change?

You edit the rules. Because the logic is plain code in your repo, not a black box, your RevOps person changes a scoring weight or a territory map in minutes. That's the point of owning it — when the business changes, the agent changes with it, without a vendor ticket or a renewal negotiation.

Is it safe to let it touch our lead data?

Keep the work inside the systems you already use and already trust for that data, and don't pipe leads to new third parties without checking your privacy obligations. Log what the agent accesses. Lead data is personal data, so treat it with the same care your CRM already requires — the agent shouldn't widen your exposure.

Sources

Want help shipping this?

We'll build it with your team on your real work — and leave you owning it, not renting it.