How I built a DIY AI visibility tracker with Claude Code

A Claude Code AI visibility tracker that asks what a CRO, CMO, RevOps lead and CFO ask at each buying stage. 256 answers, 4 AI assistants, $18.

updated 13 min read[Claude Code][AI visibility][Use cases]by Page Sands

Most AI visibility reports I’ve seen lead with one number: the share of answers that mention you.

Buyers don’t ask one question. A CFO trying to get software spend under control asks something different from a RevOps lead building a vendor shortlist, and the AI gives them different answers. If you average those together, you can’t see which buyer never hears your name.

So I built a tracker in Claude Code that asks the questions each buyer asks at each stage of a purchase. Then I ran it on four CRMs: HubSpot, Salesforce, Attio and Microsoft Dynamics 365. It took one working session, produced 256 answers from four AI assistants, and cost $18.22.

This post covers how it works, what it cost, what broke, and how to run it on your own company.

What you need

  • Claude Code, to build and run the tracker
  • Node 22 or later
  • An OpenRouter API key with about $25 of credit
  • About an hour, most of it spent waiting for answers

Start with a CLAUDE.md

Claude Code reads a CLAUDE.md file at the top of the project before it does anything. Mine told it what the tracker is for, which files hold what, and the rules that kept the data clean. Copy this into an empty folder and edit the rules to fit:

# AI visibility tracker

Asks AI assistants the questions our buyers ask at each buying stage, then grades
each answer for which companies appear, where they rank, and whether the
description matches each company's current positioning.

## Files
- `config.json`: brands (aliases, new story, old story, AI product name),
  personas, stages, questions, engines, grader model, repeats
- `track.mjs`: the `calibrate`, `run` and `grade` commands
- `analyze.mjs`: builds `results.md` and `results.csv` from answers and grades
- `answers.jsonl`, `grades.jsonl`: raw data, one JSON object per line.
  Never edit them by hand.

## Commands
- `node track.mjs calibrate`: one question per engine, prints measured cost
- `node track.mjs run`: asks every question not yet answered. Safe to rerun.
- `node track.mjs grade`: grades every answer not yet graded
- `node analyze.mjs`: rebuilds the results tables

## Rules
- The API key comes from the OPENROUTER_API_KEY environment variable.
  Never write it to a file or print it.
- Before a full run, run `calibrate` on the longest question and tell me the
  estimated cost. Wait for my OK if it is over $25.
- Problem, research and shortlist questions never name a brand. Only
  decision questions name brands.
- Every question starts with the company context and the persona intro
  from `config.json`.
- An answer under 50 characters counts as failed. Re-ask it. Never grade it.
- Answer IDs are persona|stage|question|engine|repeat. When a question's
  text changes, re-ask only that question.
- Report every number with its count ("3 of 63"), not only a percentage.
- New versus old story labels come from an AI grader and are directional.
  Run a second grader before reporting them and show both results.

## Adding a company or a persona
- Company: add it to `brands` with aliases, its new and old story written
  from its homepage, and its AI product name. Add it to the decision
  questions, re-run those, then grade again.
- Persona: add it to `personas`, write two questions per stage in its words,
  then run and grade.

Then give Claude Code the build in one prompt:

Build a Node script that asks ChatGPT, Claude, Gemini and Perplexity the questions in config.json through OpenRouter, saves each answer to answers.jsonl as it arrives, and skips questions already answered. Add a calibrate command that asks one question per engine and prints the real cost from the API’s usage data. Add a grade command that sends each answer to a cheap model and gets back JSON: the vendors in order of mention, the recommended vendor, and for each tracked brand whether it is mentioned and whether the description matches its new or old positioning, with a short quote.

Expect to iterate. Everything in the “What broke” section below came up on the first run.

What the tracker measures

The grid. Four buyers (CRO, CMO, RevOps lead, CFO) at four stages (problem, solution research, shortlist, decision). Each buyer gets two questions per stage. Every question goes to four assistants, twice.

4 buyers × 4 stages × 2 questions × 4 assistants × 2 repeats = 256 answers.

Three scores per answer:

  1. Is each company mentioned, and where does it rank?
  2. Which company does the answer recommend?
  3. Does the description match the company’s current positioning or the one it left behind?

The third score is the reason to build this yourself. A mention count tells you whether you showed up. I wanted to know whether the AI tells buyers the story the company tells today.

Step 1: write the question grid

The grid lives in one config.json. Each brand gets its aliases, its current positioning and its old positioning, written from its own homepage. Here is the Salesforce entry:

{
  "name": "Salesforce",
  "aliases": ["Salesforce", "Sales Cloud", "Agentforce"],
  "new_story": "The #1 AI CRM: unites data, apps and AI agents (Agentforce) that run the business.",
  "old_story": "The traditional enterprise cloud CRM: powerful but complex, expensive, admin-heavy.",
  "ai_product_keyword": "Agentforce"
}

Three rules made the questions useful:

  • Keep the first three stages unbranded. A problem question like “Our revenue forecast from sales is unreliable and finance rebuilds it in spreadsheets every month. How do companies fix this?” tells you who the AI brings up on its own.
  • Name the brands only at the decision stage. “We’re choosing between HubSpot, Salesforce, Attio and Microsoft Dynamics 365. From the CFO’s point of view, which should we pick and why?” That is where you learn how each company gets described.
  • Put the buyer and company size in every prompt. Every question starts with “We’re a 200-person B2B SaaS company. I’m the CFO.” The same question without the role gets a different answer.

Here is the CFO’s row of the grid. Every question is sent with “We’re a 200-person B2B SaaS company. I’m the CFO.” in front of it:

Stage Question 1 Question 2
Problem Our sales and marketing software spend keeps growing and I can’t tie it to revenue. How do other finance leaders get this under control? The revenue forecast from sales is unreliable and finance rebuilds it in spreadsheets every month. How do companies fix this?
Solution research Which CRM platforms give finance a reliable forecast and a clear view of total cost of ownership? Which CRMs with AI features actually reduce headcount or tool costs for a go-to-market team?
Shortlist Give me a ranked shortlist of the 5 best CRMs for our company judged on total cost of ownership and forecast accuracy, with one line on why for each. Which 3 CRM vendors should finance approve for evaluation this quarter, and what is each best known for?
Decision We’re choosing between HubSpot, Salesforce, Attio and Microsoft Dynamics 365. From the CFO’s point of view, which should we pick and why? Describe what each company offers today. What are the biggest cost and contract risks with HubSpot, Salesforce, Attio or Microsoft Dynamics 365?

The questions for all four buyers are in the full question grid at the end of this post.

Step 2: ask the assistants through one key

I used OpenRouter, which reaches all four assistants with one API key. Adding :online to a model ID turns on web search, which matters because buyers use these assistants with search on. Perplexity searches by default.

Assistant Model ID I used
ChatGPT openai/gpt-chat-latest:online
Claude anthropic/claude-sonnet-5.5:online
Gemini google/gemini-3.8-flash:online
Perplexity perplexity/sonar

The script writes each answer to a JSONL file as it arrives, keyed on the question ID and the exact prompt text. If a run dies halfway, rerunning it asks only what’s missing. If you edit a question, only that question gets asked again. That design saved me twice.

Step 3: measure the cost before you run

I ran one question on each assistant first. It came to $0.15, which put the full grid at about $7.

Terminal output from the tracker: the calibrate command shows cost per assistant for one question and a $6.99 estimate for the grid, then the run command reports progress and finishes with 192 answers, 0 failed, $11.26

The screenshot is from my first run, with three buyers. After adding the CFO, the full grid of 256 answers cost $18.22. My test question was a short shortlist request, and the average answer is longer. ChatGPT and Claude with web search write long answers and pull in a lot of search context.

Assistant Cost for 64 answers Share
Claude $8.56 47%
ChatGPT $8.19 45%
Gemini $1.08 6%
Perplexity $0.40 2%

If you calibrate, use your longest question, or run one full stage before the whole grid.

Step 4: grade every answer, twice

A cheap model reads each answer and returns JSON: the vendors named in order, the vendor it recommends, and for each tracked brand whether it was mentioned and whether the description matches the new story, the old story, both, or neither, with a short quote as evidence.

The part of the grader prompt that does the judging:

Story rules: "new" if the description matches the NEW positioning (for example
AI agents, unified platform, agentic), "old" if it matches the OLD positioning
(for example limits, legacy framing, the category the brand left), "mixed" if
it has clear elements of both, "neutral" if mentioned without a description
that fits either, "absent" if not mentioned. Judge only what the answer says.

I graded all 256 answers with Claude Haiku 5.5 ($0.25), then again with GPT-5.4 mini ($0.58), and compared the two:

  • Mentions: they agreed 99% of the time.
  • New story versus old story: they agreed 54% of the time.

That second number changed how I report results. Both graders agreed on direction: Salesforce, Attio and Dynamics were described the old way more often than the new way, and HubSpot the reverse. They disagreed on the exact share. One grader rated 3% of Salesforce descriptions as the new story; the other rated 30%.

Run two graders, publish both numbers, and treat story labels as a direction.

Step 5: add a check that needs no grader

For a number I could defend, I added a plain word match: in answers that name the company, does the answer also name its AI product? Breeze for HubSpot, Agentforce for Salesforce, Copilot for Dynamics.

Anyone can verify that count by reading the answers. It produced the clearest finding of the run.

What it found on four CRMs

Bar chart titled Ask AI for a CRM shortlist, and the AI agents mostly drop out. Of the AI answers that named each CRM, the share that also mentioned its AI product: HubSpot Breeze 51% when the buyer asked about AI CRMs and 5% when the buyer asked for a shortlist; Salesforce Agentforce 52% and 16%; Dynamics 365 Copilot 48% and 21%

When buyers asked about AI directly, 51% of answers that named HubSpot, Salesforce or Dynamics also named its AI product. On shortlists, where buyers asked for the best CRMs without mentioning AI, that fell to 13%. Attio has no named AI product, so it’s left out of this count. Breeze appeared in 3 of 63 shortlist answers that named HubSpot.

The research questions mention AI and the shortlist questions don’t, so some of that gap is built into the questions. That’s the finding, though: a buyer who doesn’t ask about AI doesn’t hear the AI story.

The rest of the results:

Heatmap of the share of unbranded answers that name each CRM, by buyer and stage. HubSpot and Salesforce reach 88% to 100% at research and shortlist for every buyer. Attio is never named at the problem stage. Dynamics 365 makes 75% of CFO shortlists

  • HubSpot won the decision stage in 44 of 64 answers. Salesforce won 2. Attio and Dynamics won none.
  • CFOs heard the least at the problem stage: HubSpot came up in 31% of their answers, against 81% for RevOps leads.
  • Dynamics made 75% of CFO shortlists and was described almost every time as the choice for a Microsoft shop.
  • Which assistant you ask matters: ChatGPT and Claude named Dynamics in about 60% of unbranded answers, Gemini and Perplexity in about 20%.

What broke

  • 15 of Claude’s first 48 answers came back empty. With web search on, my 1,500-token limit ran out before the answer did. I raised it to 4,000, made the script reject any answer under 50 characters, and re-asked those 15.
  • The grader missed conditional picks. “I’d pick HubSpot unless you need Salesforce-level complexity” came back as no recommendation. I rewrote the instruction so a conditional pick counts, then regraded everything.
  • Six requests failed on a network error. The resumable design meant rerunning the script picked up exactly those six.

The full question grid

Every question starts with “We’re a 200-person B2B SaaS company.” and the buyer’s role. Copy it, then rewrite the questions in your buyers’ own words.

CRO

Prompt starts with: “I’m the CRO.”

Stage Question 1 Question 2
Problem Our reps spend more time updating the CRM than selling, and our forecast keeps missing. How do other sales leaders fix this? Deals keep stalling in late stages and our pipeline coverage is thin. What tools or changes actually help?
Solution research What kinds of CRM platforms work best for a sales team of 40 reps that wants AI to handle data entry and forecasting? Which CRMs have the most useful AI agents for sales teams right now?
Shortlist Give me a ranked shortlist of the 5 best CRMs for a 40-rep B2B sales team, with one line on why for each. Which 3 CRM vendors should my sales team evaluate this quarter, and what is each best known for?
Decision We’re choosing between HubSpot, Salesforce, Attio and Microsoft Dynamics 365 for our sales team. Which should we pick and why? Describe what each company offers today. What are the biggest risks of choosing HubSpot, Salesforce, Attio or Microsoft Dynamics 365 for a 40-rep sales team?

CMO

Prompt starts with: “I’m the CMO.”

Stage Question 1 Question 2
Problem Marketing can’t prove which campaigns create pipeline because our data is split across tools. How do companies fix this? Our lead handoff to sales is slow and good leads go cold. What should we change?
Solution research Which platforms combine marketing automation and CRM so marketing can see its pipeline impact? What are the best CRMs with AI built in for marketing and sales alignment?
Shortlist Give me a ranked shortlist of the 5 best CRM platforms for a B2B marketing team that needs to prove pipeline impact, with one line on why for each. Which 3 CRM vendors should marketing push to evaluate this quarter, and what is each best known for?
Decision We’re choosing between HubSpot, Salesforce, Attio and Microsoft Dynamics 365. From marketing’s point of view, which should we pick and why? Describe what each company offers today. What are the biggest risks for the marketing team if we choose HubSpot, Salesforce, Attio or Microsoft Dynamics 365?

RevOps lead

Prompt starts with: “I lead revenue operations.”

Stage Question 1 Question 2
Problem Our CRM data is messy, full of duplicates and missing fields, and reporting takes days. How do teams fix this? We run sales, marketing and service on separate tools that don’t sync. What’s the best way to consolidate?
Solution research What CRM should we use if we want one platform for sales, marketing and service data? Which modern CRMs are easiest for a RevOps team to customize and automate without heavy admin work?
Shortlist Give me a ranked shortlist of the 5 best CRMs for a RevOps team that owns the GTM data, with one line on why for each. Which 3 CRM vendors should RevOps evaluate this quarter, and what is each best known for?
Decision We’re choosing between HubSpot, Salesforce, Attio and Microsoft Dynamics 365. From a RevOps point of view, which should we pick and why? Describe what each company offers today. What are the biggest admin, data and integration risks with HubSpot, Salesforce, Attio or Microsoft Dynamics 365?

CFO

Prompt starts with: “I’m the CFO.”

Stage Question 1 Question 2
Problem Our sales and marketing software spend keeps growing and I can’t tie it to revenue. How do other finance leaders get this under control? The revenue forecast from sales is unreliable and finance rebuilds it in spreadsheets every month. How do companies fix this?
Solution research Which CRM platforms give finance a reliable forecast and a clear view of total cost of ownership? Which CRMs with AI features actually reduce headcount or tool costs for a go-to-market team?
Shortlist Give me a ranked shortlist of the 5 best CRMs for our company judged on total cost of ownership and forecast accuracy, with one line on why for each. Which 3 CRM vendors should finance approve for evaluation this quarter, and what is each best known for?
Decision We’re choosing between HubSpot, Salesforce, Attio and Microsoft Dynamics 365. From the CFO’s point of view, which should we pick and why? Describe what each company offers today. What are the biggest cost and contract risks with HubSpot, Salesforce, Attio or Microsoft Dynamics 365?

Run it on your company

  1. Replace the brands with yours and three competitors. Write each new and old story from the homepage and the last positioning you retired.
  2. Replace the buyers with the four people on your buying committee, and write two questions per stage in their words. Sales call notes are the best source.
  3. Run one full stage, check the cost, then run the grid.
  4. Grade twice and add a word match for whatever your new story depends on.
  5. Rerun monthly. The AI Shortlist Report found that 10% of top-five recommendation places changed between July and November under the same model names.

If you want the grid run for you, with your buyers and three competitors and a readout you can take to your CEO, SandsDX can run it for your team.

Frequently asked questions

How much does it cost to run a DIY AI visibility tracker?

My run of 256 questions across ChatGPT, Claude, Gemini and Perplexity through OpenRouter cost $18.22 for the answers and under $1 to grade them twice. ChatGPT and Claude with web search made up 92% of the cost. Gemini cost $1.08 and Perplexity $0.40.

Why track AI visibility by persona and buying stage?

Buyers ask different questions at different stages and get different answers. In my CRM run, HubSpot came up in 31% of answers when a CFO described a spending problem and in 81% when a RevOps lead described a data problem. A single visibility score averages those together and hides where you are missing.

Can I trust an AI model to grade AI answers?

For mentions and rankings, mostly yes: two different grader models agreed on whether a brand was mentioned in 99% of cases. For judging whether an answer describes your new or old positioning, they agreed 54% of the time. Run two graders, treat story labels as directional, and back them with a plain word match you can check by hand.

Which AI assistants should a visibility tracker cover?

The ones your buyers use, with web search turned on, because that is how buyers use them. I used ChatGPT, Claude and Gemini with web search through OpenRouter, plus Perplexity, which searches by default. One OpenRouter key reaches all four.