Playbook · Claude Code × HubSpot

Claude Code for HubSpot: the RevOps cleanup playbook

Claude Code for HubSpot is a way to run a full RevOps cleanup from a terminal: Claude audits your CRM, merges duplicates, learns your ICP from closed-won and closed-lost deals, enriches accounts, tiers every company, builds the HubSpot workflow, and writes a one-line account summary reps can act on. This page is the playbook we use, with an interactive walkthrough you can click through.

By Joe LaGrutta, founder of JayOh · HubSpot Platinum Partner · Updated October 22, 2026

Try the interactive walkthroughHave us run it on your CRM

The play in one line: audit, clean, learn the ICP from your own deals, enrich, tier, then route. In that order, with a backup, small test batches and shadow properties at every step. AI does the clicking; operators own the rules and the review.

STAGE 1Brief + auditGive Claude the ICP, then get a read-only fill-rate audit and one readiness score.
STAGE 2DeduplicateMerge with a written keep-rule after a backup and a test batch.
STAGE 3Win/loss ICPCompare every closed-won vs closed-lost deal. Find where rep effort is wasted.
STAGE 4EnrichPilot segment first, fixed picklists, written to shadow properties.
STAGE 5Tier + workflowTurn the win/loss pattern into tier rules, then have Claude build and you review the workflow.
STAGE 6Summaries + routingStamp an account summary on every company, assign owners and create first-touch tasks.
Interactive walkthrough

See Claude Code and HubSpot work together, in 12 steps

How to read it: on the left is Claude Code, the AI agent you type instructions into. On the right is HubSpot, where every change shows up. The card in the corner of HubSpot says exactly what Claude did through the HubSpot API on each step. We ran the play on a fictional copy of JayOh's own book: 25 company records, 3 duplicate groups, 13 closed and open deals. Every number on every screen is calculated from the same sample data, so the audit, the tiers and the readout always agree.

Use Next / Back or your arrow keys. Try the interactive bits: merge duplicates (step 5), flip before/after enrichment (step 7) and filter by tier (step 10). Illustrative mockup with fictional data.

The playbook, stage by stage

How to run Claude Code on a HubSpot portal

Each stage has one job, one example prompt and one guardrail. Skip the order and the later stages break: you can't tier accounts whose industry is blank, and you can't route accounts that are duplicated.

1

Brief Claude on the business, then audit the CRM

Claude Code runs in a terminal and talks to HubSpot through its API. Before it reads a single record, give it the ICP written as testable rules (geography, employee range, business model, CRM, funding), the buyer and the pain. Then ask for a read-only audit of the fields that decide fit, tier and territory.

Example prompt
audit the CRM: check fill rates on industry, employees, country and tech stack, validate against the ICP matrix, and write the findings to a Google Doc
Output
One CRM readiness score plus a fill rate per ICP-critical field. In the walkthrough, readiness starts at 35% and tech stack is 0% filled.
Guardrail
Read-only. Nothing is written in this stage.
2

Merge duplicates with a written keep-rule

Every later count depends on a clean book, so duplicates go first. Tell Claude exactly which record survives: the one with activity; if neither has activity, the one with the higher property fill rate, then the more recently created one. Edge cases go to a human.

Example prompt
clean up the duplicates using the keep-rule. merge a batch of 10, then show me before doing the rest
Output
A deduplicated baseline (25 records down to 22 in the walkthrough) that every later number is measured against.
Guardrail
Full backup first. HubSpot merges can't be undone.
3

Learn the real ICP from closed-won and closed-lost deals

This is the strategic step. Claude compares the firmographics of every won deal against every lost deal and then checks where reps actually spend their time. In most books we audit, a large share of activity sits on accounts that look like the losses. That misallocation is the business case for everything that follows.

Example prompt
take every closed-won and closed-lost deal, compare the company profiles, and show me what share of rep activity is on each profile
Output
A win/loss table by profile and the share of activity on losing profiles (66% in the walkthrough).
Guardrail
Validate the pattern with sales leadership. The data finds it; people confirm it.
4

Enrich a pilot segment before the whole book

Build a small static segment, enrich it, check it by hand, then run the same script on everything. Classify industry into a fixed picklist so dashboards get ten clean values instead of a hundred creative ones. If the CRM or tech stack can't be confirmed, mark it "not confirmed" rather than guessing.

Example prompt
enrich the pilot segment: industry from our picklist, employees, country and CRM. write to shadow properties and backfill HubSpot
Output
Industry, employee count, country and CRM filled across the book (CRM confirmed on 21 of 22 companies in the walkthrough).
Guardrail
Write to shadow properties (e.g. "Industry (shadow)") and roll in only after review.
5

Turn the pattern into tiers, then let Claude build the workflow

Claude writes the tier rules into a shared sheet and back-tests them against closed deals. Then one prompt creates the HubSpot workflow that tiers every company, re-tiers when inputs change and enrolls new companies. Check the branches in order: Disqualified first, so a big logo with a bad fit never lands in Tier 1.

Example prompt
create a tiering automation in HubSpot from the Tiering tab and enroll every company. dry-run 10 records first
Output
A live workflow (Disqualified > Tier 1 > Tier 2 > Tier 3) and a tier on every account.
Guardrail
Read every branch. AI-built workflows can contain invalid conditions that only a human review catches.
6

Stamp account summaries and route owners

Finish with the rep view: a one-line account summary on every company that starts with the tier and says who they are, plus owner assignment and a first-touch task for Tier 1 and Tier 2. Reps open the record and know who to call and why, without doing manual research.

Example prompt
write an account summary for every company, then build the routing workflow: assign owners by tier and create a first-touch task for tiers 1 and 2
Output
Owned, tasked Tier 1 accounts and disqualified accounts taken off reps' plates.
Guardrail
Routing goes last. It only works once the data and tiers underneath it are right.

Guardrails

5 rules for letting AI write to your CRM

The difference between a clean CRM and a mess you can't undo is process, not the model.

  1. Back up firstExport every object you'll touch before the first write. With a backup, any mistake is a restore, not a crisis.
  2. Small batch, then expandRun every operation on about 10 records, check them by hand against what you'd have done, then run the rest.
  3. Tested scripts, not live AI decisionsHave Claude write and test scripts that run against the API instead of letting an agent make uncontrolled live changes.
  4. Shadow properties firstWrite new values to a hidden copy of the property, review it, then roll it into the real one.
  5. Run first jobs off-hoursBig first runs on a weekend or evening don't slow the CRM or interrupt anyone's work.
Tested scripts (what we use)Live agent changes
Who decidesRules you wrote and approvedThe model, record by record
RepeatableSame input, same output, every runCan vary between runs
ReviewableDry run on a sample before full runChanges land as they happen
RollbackBackup + shadow propertiesDepends on what was logged

When this play fits

Signs your HubSpot needs this

  • Industry, employee count or country is blank on a big share of companies
  • Nobody can say which accounts run HubSpot, Salesforce or both
  • Duplicates are inflating account counts and splitting activity
  • Reps spend hours researching accounts before every call
  • Tiering or lead scoring exists on paper but not in the CRM
  • You're mid-migration, post-acquisition or just closed a PE deal

What you need

The stack behind the walkthrough

  • Claude Code in a terminal, working in a project folder for the CRM
  • HubSpot API access through a private app with only the scopes the job needs
  • An enrichment provider for firmographics and tech stack (we compare options in Clay vs ZoomInfo vs Apollo)
  • A shared ICP matrix sheet the team has signed off on
  • An operator who owns the rules and reviews every write

FAQ

Claude Code for HubSpot: common questions

What is Claude Code for HubSpot?

It's using Claude Code, Anthropic's coding agent that runs in a terminal, to work on a HubSpot portal through the HubSpot API. Instead of clicking through settings, you describe the RevOps job in plain English and Claude writes and runs the scripts: audits, merges, enrichment, workflows and account summaries.

Is it safe to let AI change my CRM?

It is if you follow five rules: back up first, test on small batches, use tested scripts instead of live AI decisions, write to shadow properties first, and run first jobs off-hours. A person still owns the rules and reviews every write.

Does Claude Code replace a RevOps team?

No. It removes the clicking and the manual research. The judgment stays with operators: writing the ICP, choosing the keep-rule for duplicates, validating the win/loss pattern with sales, and reviewing every workflow before it goes live.

Why tiers instead of a lead score?

Tiers give reps a clear priority and route cleanly: Tier 1 gets an owner and a task this week, disqualified accounts get nothing. Points-based scores drift, get argued about and are harder to back-test against closed deals. We cover scoring separately in our lead scoring model guide.

How do you choose which duplicate record to keep?

Keep the record with activity. If neither has activity, keep the one with the higher property fill rate, then the more recently created one. Anything that doesn't fit the rule goes to manual review.

Does this work if we run HubSpot and Salesforce together?

Yes, and it's where the play pays off most, because tech stack and CRM fit are usually the emptiest fields. Fix the HubSpot–Salesforce sync mappings first so enriched values don't get overwritten on the next sync.

Run it on your CRM

Hand us one leak. We'll fix it free.

JayOh is a HubSpot Platinum Partner and Claude partner with 75+ CRM migrations and 100+ documented GTM plays. In a free RevOps sprint, senior operators run the audit and the first fix on your portal: read-only until you trust us, and documented either way.