November 3, 2026

How to Use Claude Code for Market Research

Claude Code for market research: define the market, count companies with filters kept next to the number, break counts down, map competitors, cite methods.
Guide
  • Button with overlapping square icons and text 'Copy link'.
Table of Contents

Major Takeaways

What does market research with Claude Code involve?
A written market definition (industry, size band, geography), a company count run against a B2B database with those filters, breakdowns by state and size, a competitor map and a methods note. Census data shows employer firms were only 21.6% of U.S. businesses in 2023, so the size floor alone can change a count several times over.
What are the steps to count a B2B market with Claude Code?
Write the definition, run a count search, break it down by state and size band, build a lookalike competitor map, repeat it monthly or use research mode for growth, export a CSV and aggregate it, then publish the filters and pull date with the number.
How do you know a market count is sound?
Rerunning the same definition a week later gives nearly the same number, at least 16 of 20 known companies appear in the export, the state or size parts never exceed the total, and you can explain in one sentence why it differs from the official benchmark.

Claude Code for market research means producing a market number you can defend: you write the market definition first, Claude Code runs the count against a B2B company database, breaks it down by state, country and size band, and saves the exact filters next to every figure. The output is a chart-ready table plus a methodology note, not a number pasted from a search result.

That matters because market numbers on the web rarely agree. One source counts every registered entity, another counts firms with employees, a third counts companies tagged with a keyword. The U.S. Census Bureau's nonemployer business story (July 2025) reports that employer businesses made up only 21.6% of all U.S. businesses in 2023, so whether a count includes businesses with no staff can change it several times over.

This guide covers seven steps, a worked example from two real counts pulled on November 3, 2026, metrics, honest limits and mistakes. It is for market researchers, analysts, strategy and product marketing teams, and journalists who need B2B market numbers they can source.

Quick answer: To use Claude Code for market research, write the market definition (industry, keywords, size band, geography) in a file, have Claude Code run a company count with those filters against a connected company database, break the count down by state and size band, map competitors with a lookalike search, export a CSV, and publish the filters and pull date with the number.

Before you start: what you need

  • Claude Code installed in a terminal or IDE. Per the Claude Code docs, it reads files, runs commands and integrates with development tools, so it can run the counts and write the files that hold them.
  • A B2B company data source connected to Claude Code. This guide uses Landbase; set it up with the install and connect guide and sign in before your first session.
  • One research question written as a sentence, such as "How many mid-sized cybersecurity firms are based in the U.S., and where?"
  • A project folder with a market definition file and a methods log. Claude Code reads and updates both.
  • One official benchmark to compare against, such as Census County Business Patterns or Nonemployer Statistics, so you can explain why your count differs.

Why market numbers on the web conflict

Most disagreements come from four definitional choices. Write each one down before counting and you can explain any gap with another source.

Industry taxonomy

Government data uses NAICS codes; company databases often use a LinkedIn-style taxonomy. In LinkedIn's industry codes V2, "Computer and Network Security" (ID 118) sits under Professional Services, then IT Services and IT Consulting. A security software vendor tagged "Software Development" falls outside that code.

Unit of count

A firm, an establishment (each location), and a legal entity are different units. A company with five offices is one firm and five establishments, and a holding structure can add several legal entities on top. Pick one unit and name it in every table header.

Size floor

Including businesses with no employees inflates totals. Census Nonemployer Statistics notes that the majority of U.S. business establishments have no paid employees, which is why the Census publishes them as a separate series. State whether your count starts at 1, 11 or 51 employees.

Location field

Headquarters, registered office and employee location give three different geographic splits for the same companies. A state ranking built on registered addresses looks nothing like one built on headquarters, so name the field next to the map.

How to use Claude Code for market research: step by step

Step 1: Write the market definition first

Ask Claude Code to draft the definition file from your research question, then edit it by hand. It needs a value for each of these:

  1. Industry: the exact taxonomy label, not a synonym ("Computer and Network Security", not "cyber").
  2. Keywords: only if the industry label is too broad, with the words you will exclude.
  3. Size band: an employee range such as 51-200.
  4. Geography: country, plus the field it applies to (HQ country).

Decision rule: if any line says "tech", "mid-market" or "around", replace it with a label or a number before counting. Cost: none.

Step 2: Count companies with that definition

Have Claude Code run a count-only search that names every filter, such as U.S.-headquartered Computer and Network Security companies with 51-200 employees. The reply lists the filters it applied and the count. Claude Code should record the filters, the count, the date and the session id in the methods log on the same line as the number, so the filter set never gets separated from the figure. If the reply says a label did not match exactly, fix the definition and count again. Cost: none; a standard count search does not use credits.

Step 3: Break the count down by state, country and size band

Count the same definition with one dimension changed at a time, for example split by HQ state across California, Virginia, Texas, New York and Maryland. For size bands, run one count per band (1-10, 11-50, 51-200, 201-500, 501-1,000, 1,001+) rather than asking for a "top N" ranking, which the standard search does not aggregate across the full database. Check that the parts add up to no more than the total. Cost: none.

Step 4: Build a competitor map

Start from one or more known companies in the market, such as your own company and a rival, and ask Claude Code for companies like them. Claude Code then groups the result by size band and HQ state and writes a short note per cluster. Review the top 25 by hand and remove resellers, agencies and subsidiaries before counting the map. Cost: none for the search. Scoring each row against yes/no questions (qualifying) uses credits, so check the estimate before running it.

Step 5: Track change over time

The cheapest trend is a repeat count: repeat Steps 2 and 3 on the first of each month with the unchanged definition and add the result to the methods log. Headcount growth rates and job-posting counts need a custom query over the full database, which runs in research mode. For example, ask which companies in the market grew headcount more than 20% in the last 12 months.

The first turn drafts the query and quotes an estimated credit cost, and is free. Confirming the run uses credits. Save the drafted query in the methods log whether or not you run it. Details are in the advanced dataset creator guide.

Step 6: Export a chart-ready table

Ask Claude Code for the company list instead of the count and save it as a CSV, then have it total the companies by HQ state in the dataset you own. Downloads are capped at roughly 1,000 rows per query, so split larger markets by size band. Claude Code can then write a Python script that turns the CSV into a bar chart. Enriching rows with extra fields uses credits.

Step 7: Write the methodology and set the rerun cadence

Every published number needs a methods line: data source, pull date, filters, unit (company records), what was excluded, and known limits. Ask Claude Code to generate it from the methods log and place it under the chart. Set an owner and a rerun date (monthly for trend pieces, before every republish for evergreen pages). Rerun when the definition changes or a reader questions the number.

Worked example: U.S. cybersecurity firms with 51-200 employees

These are real counts from two default searches run on November 3, 2026, with no credits spent. Definition: industry = Computer and Network Security, HQ country = United States, size band = 51-200 employees, counted at company level.

  • Full matching company records: 1,189.
  • Records with a website: 1,129.
  • Companies returned in the materialized company list: 783.

The same definition gives three numbers depending on whether a company must have a website and appear in the exported list. That is the conflict this guide is about, inside one database. Publish the one that matches your unit and state which it is.

By HQ state (list count, then full records): California 167 and 249, New York 90 and 126, Virginia 58 and 79, Texas 56 and 99, Maryland 36 and 53. The five states hold 407 of 783 listed companies and 606 of 1,189 full records, about half the market in both cases, per the counts above. Those five rows, each with the definition and pull date, make up the chart-ready table.

If the next step is a sales plan rather than a published figure, turn this count into TAM, SAM and SOM with the TAM vs SAM vs SOM guide.

How to measure whether it worked

  • Reproducibility: rerun the Step 2 count a week later with the same definition. A gap of more than a few percent without a definition change means a filter is loose.
  • Known-company recall: list 20 companies you know fit the definition and check how many appear in the export. Fewer than 16 means the industry label or size band is excluding real members.
  • Additivity: state or size-band parts should never sum to more than the national total.
  • Explained gap: you can state in one sentence why your number differs from the official benchmark (taxonomy, unit or size floor).

Review these each time the count is rerun.

The honest limits of Claude Code for market research

  • HQ-city effects: counts by HQ state put every employee of a company in its headquarters state. A firm based in California with most staff in Virginia counts only in California.
  • Registered-agent addresses: the Delaware Division of Corporations' 2023 annual report says over 2 million legal entities are incorporated in Delaware, including 67.6% of Fortune 500 companies. Any source that uses the registered address will overcount Delaware; check that your location field is HQ.
  • Micro entities inflate counts: without a size floor, one-person consultancies and holding companies swamp the total. Use a size band, or report micro firms separately.
  • Word-match definitions: a keyword such as "security" also matches guard services and alarm installers. Prefer a taxonomy label, and if you must use keywords, list exclusions and review a sample.
  • Claude Code does not supply data: on its own it is limited to web search and the files you give it. The counts come from the data source you connect, and its coverage sets the ceiling.

Common market research mistakes

Counting before defining

Analysts often start with a broad search and tune filters until the number looks right. The result cannot be reproduced. Fix: freeze the definition file before the first count and log every change.

Separating the number from its filters

A figure copied into a slide loses its definition within a week, and nobody can rerun it. Fix: keep filters, date and session id on the same line as the number in the methods log and in the chart caption.

Mixing units across sources

Comparing a company count with a Census establishment count makes the market look larger or smaller than it is. Fix: name the unit in every table header.

Treating a lookalike list as the market

A competitor map shows who resembles a seed company, not every company in the category. Fix: size the market with Step 2 and use the map only for positioning.

How to do this in Landbase

Landbase gives Claude Code a counted market instead of web guesses: 40M+ companies and 800M+ contacts from 20+ providers, with 1,500+ fields per record. From Claude Code, count, breakdown and lookalike searches run in plain language in the same session. For prospect lists built on the same definition, see Claude Code for sales prospecting; for turning counts into content and ads, see Claude Code for marketing workflows. The free trial includes 1,000 free credits for the research-mode, enrichment and qualification steps.

Frequently Asked Questions

Can Claude Code do market sizing?

Yes, when it is connected to a company database. Claude Code runs the count with your filters, breaks it down, exports the table and writes the methodology. Without a data source it only searches the web, which returns examples and other people's estimates rather than a count you defined. Market sizing with Claude works best when the definition file is written first.

Is AI reliable for B2B market research?

B2B market research with AI is as reliable as its data source and definition. The model is good at running repeatable queries, catching mismatched labels and writing methods notes. It is not a source of numbers itself. Check reproducibility, known-company recall and additivity before publishing any figure.

Why do two market size reports give different numbers?

They usually define the market differently: a different industry taxonomy, a different unit (firm, establishment or legal entity), a different size floor, or a different location field. Revenue-based reports add another layer of assumptions. Compare definitions before comparing numbers.

How should a journalist cite a company count?

Name the data source, the pull date, the filters and the unit in the sentence or caption, for example: "783 U.S.-headquartered companies in the Computer and Network Security industry with 51-200 employees, Landbase data pulled November 3, 2026." Link to a methods note that lists exclusions and limits.

Which steps cost credits?

Standard searches (counts, breakdowns and lookalikes) and the first research-mode turn (the query draft and quote) do not use credits. Running the research-mode query uses credits, as do enriching and qualifying. Always read the quoted estimate before confirming.

Build a GTM-ready audience

Run your first Landbase market count from Claude Code

  • Button with overlapping square icons and text 'Copy link'.

Turn this list into a GTM-ready audience

Match this list to your ICP, prioritize accounts, and identify who to contact using live growth signals.

Market numbers you can source

Describe the market in plain language and get a company count with its filters from Claude Code.

Stop managing tools. 
Start driving results.

See Agentic GTM in action.
Get started
Our blog

Lastest blog posts

Tool and strategies modern teams need to help their companies grow.

Guide

B2B healthcare lead generation guide: health system and payer ICP, buyer titles, HIPAA and CMS rules, buying signals, events and a 6-step playbook.

Daniel Saks
Chief Executive Officer
Research

30 CRM statistics for 2026: a $79.6B market, 20.0% Salesforce share, adoption by company size, data quality, ROI and AI, each linked to its primary source.

Daniel Saks
Chief Executive Officer
Guide

Expansion signals show which customers are ready to grow. Build an upsell list from your customer base in Landbase, with signal windows and routing.

Daniel Saks
Chief Executive Officer

How GTM teams turn this list into pipeline

See how GTM teams use fastest-growing lists to define TAM, prioritize accounts, and launch campaigns.