Sales use cases
Sales

CRM hygiene and weekly pipeline summaries

Build an agent that reads your CRM every week, flags the records that are wrong or stale, and writes a plain-English pipeline summary for the team meeting. Your reps stop doing data cleanup by hand, and your manager walks into the review already knowing which deals are at risk.

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

Tools you'll use

Claude CodeCodex

CRM hygiene and weekly pipeline summaries are the two recurring jobs that keep a sales team's data honest: cleaning up records (filling close dates, killing duplicates, flagging deals that have gone quiet) and writing the pipeline review the team reads before its Monday meeting. Both run every week. Both are tedious. And both get skipped the moment things get busy, which is exactly when you need them most.

This matters because dirty data quietly breaks everything downstream. B2B contact data decays at roughly 22.5% a year (Only-B2B research, via Apollo), so a CRM that looked fine in January is wrong by summer. A deal with no activity in two weeks is usually dead, but it sits there inflating the forecast until someone notices. The cleanup is not hard work; it just competes with selling, and reps already spend only about 28% of their time actually selling, with the rest lost to admin, meetings, and data entry (Salesforce, State of Sales).

The fix is a small agent that does both jobs on a schedule. It reads your CRM through its API (read-only at first), checks every open deal against rules you set, and produces two things: a list of records a human needs to fix, and a written summary of pipeline health for the meeting. You own it. It is your script, pointed at your data, using your definition of "stale." When your sales process changes, you change a few lines, not a vendor contract.

Moriva's take

This clears all three gates cleanly, which is why it is a GO. It attaches to two things a sales team does every week (Gate 1), the output is a script and a prompt your RevOps person can read, run, and edit without us (Gate 2), and the payoff is easy to count: hours of manual cleanup and report-building saved, plus deals caught before they rot (Gate 3). Keep a human approving the actual CRM edits and reading the summary before it goes wide, and the risk stays low.

How do you cRM hygiene and weekly pipeline summaries?

  1. 1

    Get read-only API access to your CRM

    Start by pulling data, not changing it. Create an API key or connected app in Salesforce, HubSpot, Pipedrive, or whatever you use, scoped to read deals, contacts, accounts, and activity. Most CRMs let you export the same data to CSV as a fallback if API access takes time to approve. This first read-only phase means the agent can be wrong without breaking anything.

  2. 2

    Write down your hygiene and 'at-risk' rules in plain English

    Before any code, decide what 'bad' means for your team. Typical rules: no activity logged in 14+ days, a close date in the past, a deal that skipped a stage, a missing next step or amount, two accounts with the same domain, or a close date that has slipped more than twice. Keep this as a short list in a document. The agent will turn each rule into a check, and you will tune the thresholds once you see real results.

  3. 3

    Point Claude Code or Codex at your data and describe the job

    Open Claude Code (or Codex) in a folder, give it your CRM credentials in an env file, and describe the task in plain English: connect to the API, pull all open deals plus their activity, and apply the rules from your document. The tool writes the script, runs it, and shows you the output. You read the flagged records against the CRM to confirm it caught the right ones, and ask it to fix anything it got wrong. The result is a script your team owns and can open and edit later.

  4. 4

    Generate the weekly pipeline summary, not just a list

    Have the tool extend the script to write a short narrative for the Monday review: total pipeline value, coverage versus quota, deals that moved or slipped this week, and the top 5 to 10 at-risk deals with the reason each is flagged. Ask for it in the format your manager actually wants, plain text or a simple table, grouped by rep. This is the difference between a data dump and something a manager can act on in a 30-minute meeting.

  5. 5

    Schedule it and deliver where the team already is

    Run the script on a schedule, for example every Friday evening or Monday at 7am, using a cron job, a scheduled GitHub Action, or your CRM's own scheduler. Send the hygiene list to the rep who owns each record, and post the pipeline summary to your sales channel or email it to the manager before the review. Build in API rate-limit handling (batch your requests, page through results) so a big pipeline doesn't trip a limit.

  6. 6

    Add safe writes back to the CRM only after you trust it

    Once the read-only version has run clean for a few weeks, you can let the agent make low-risk fixes: standardizing field formats, tagging stale deals, or filling a blank field from a related record. Keep risky changes (closing a deal, changing an amount, deleting a record) as suggestions a human approves, never automatic. Log every change the agent makes so you can audit and reverse it.

  7. 7

    Review the rules monthly and keep ownership in-house

    Put a 20-minute monthly check on the calendar: are the flags accurate, are reps acting on them, did the at-risk list predict real losses? Adjust thresholds and add new rules as your process changes. Because the whole thing is a readable script plus a written prompt, your RevOps or ops person makes these edits directly. No ticket, no consultant, no waiting.

What could go wrong (and how to handle it)

The agent flags deals incorrectly, and reps stop trusting it.

Run read-only for the first few weeks and check the flagged list against the CRM by hand before anyone acts on it. Tune thresholds until the false-positive rate is low. A tool that cries wolf gets ignored, so earn trust before you scale it.

Automatic writes back to the CRM corrupt good records.

Keep all consequential changes (close, amount, stage, delete) as suggestions a human approves. Only let the agent auto-fix safe, reversible things like formatting and tagging. Log every change so any mistake can be found and undone.

CRM data is customer and revenue data, so a leak or over-broad access is a real problem.

Scope the API key to the minimum needed, read-only at first. Keep credentials in an env file or secrets manager, never in the script or a shared doc. Run the agent on a controlled machine or your own infrastructure, and treat the export like the sensitive data it is.

The summary becomes a number-dump nobody reads.

Design the output around the actual review meeting: a few headline metrics, what changed this week, and a short ranked list of at-risk deals with reasons. Ask the manager what they want to see and cut everything else. The goal is a decision aid, not a dashboard.

Over-automation lets reps skip thinking about their own deals.

Treat the agent as a prompt for the human conversation, not a replacement for it. The review still happens; the agent just makes sure the right deals come up. Keep the manager's judgment in the loop on which flagged deals matter.

API rate limits cause the job to fail silently on a large pipeline.

Batch requests, page through results, and pull only the fields you need. Have the script alert you (Slack or email) if a run fails or returns far fewer records than usual, so a quiet failure doesn't mean a missing summary on Monday.

Prompts to get started

Stand up the read-only hygiene checker
Connect to our HubSpot API using the key in .env (read-only). Pull every open deal with its owner, amount, stage, close date, and the date of the most recent logged activity. Flag any deal that matches these rules: no activity in 14+ days, a close date in the past, a blank amount or blank next step, or a close date that has been pushed more than twice. Output a table grouped by deal owner with the deal name and the reason it was flagged. Don't change anything in HubSpot yet.
Write the Monday pipeline summary
Using the same deal data, write a plain-English pipeline summary for our weekly review. Include: total open pipeline value, coverage against a quota of [X], deals that changed stage or close date in the last 7 days, and the 8 most at-risk deals with one line each on why. Keep it under one page, grouped by rep, no jargon. Save it as a text file I can paste into Slack.
Schedule and route the outputs
Turn this into a script that runs every Friday at 5pm. Email each rep only their own flagged records, and post the full pipeline summary to our #sales channel. Add error handling for HubSpot rate limits and send me an alert if the run fails or returns fewer than 50 deals.
Add approved write-backs
Now add a safe-write mode. For deals flagged as stale, set a custom field 'review_status' to 'needs_review' in HubSpot. Do not change amounts, stages, or close dates automatically. Print every change you're about to make and wait for me to confirm before writing, and log all changes to a CSV so I can reverse them.

FAQ

We already pay for CRM dashboards and AI add-ons. Why build this?

Dashboards show you numbers; they don't write the narrative your manager reads on Monday or chase the specific records that are wrong. Built-in CRM AI features are a black box you rent, with their definition of 'stale' and their output format. This is your script, with your rules, that you can open and change in five minutes. You own it instead of renting it.

Is it safe to give an AI tool access to our CRM?

Yes, if you scope it properly. Start read-only so the agent can only look, not touch. Keep credentials in a secrets file, run it on a machine you control, and require human approval for any change that matters. Treat it like any other integration that reads revenue data: least privilege, logged, auditable.

What if it flags the wrong deals?

Early on it will, and that's the point of the read-only phase. You check its flags against the CRM by hand for a few weeks and tune the thresholds until they match your judgment. Because the rules are written in plain English in a file you control, fixing a bad rule is a one-line change, not a support ticket.

Do we need an engineer to maintain this?

No. The whole thing is a readable script plus a written prompt. A RevOps or sales-ops person can re-run the tool, describe a change in plain English, and have Claude Code or Codex update it. That is the entire point: you can run, fix, and extend it without calling us back.

How do we know it's actually saving time?

Measure two things. First, the hours your reps and manager used to spend on manual cleanup and report-building each week, now near zero. Second, whether the at-risk list predicts real outcomes: track flagged deals and see how many you saved or lost. If the flags don't correlate with reality after a month, you tune the rules until they do.

Sources

Want help shipping this?

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