← Build with me Sales agent avatar: a halftone black labrador in sunglasses

Agent #3 · Built in public

Sales Agent tutorial

Build an agent that finds your ideal customers and drafts your outreach, for about half a cent per business. About 30 minutes of setup. No coding needed.

Just want to use it? Install the ready-made agent.

What you'll build

You tell the agent what you sell and who you want to reach. It then does four things:

  1. Finds matching businesses on Google Maps.
  2. Fetches emails, phone numbers, WhatsApp links and Instagram from each business's website, using plain code that costs nothing.
  3. Qualifies each business with a small, cheap Claude model: the owner, the address, three notes, and whether it fits.
  4. Pitches the good fits with a stronger Claude model: what they need, why you're a match, a WhatsApp opener and a short email.

It never sends anything. You read the drafts and send the ones you like.

What you need

  • A Mac or PC, and Claude Code.
  • Python 3.10 or newer. It's free.
  • Claude API access. Pay as you go; a 20-lead run costs under $0.10.
  • A Google Cloud account. The first 1,000 searches a month were free when I wrote this.

Four words you'll see

Claude Code
Claude with hands. It can create files and run commands on your computer, and it asks before doing anything that matters.
API
The way a script talks to a service like Claude or Google Maps. API access is billed per use and is separate from a Claude subscription.
Key
A password for a script. Never paste one into a chat, an email or a screenshot. If you do, replace it.
Campaign
One business plus one kind of customer to find, described in four short plain-English files.

Step 1: Install Claude Code (5 minutes)

  1. Go to claude.com/claude-code and follow the install steps for your computer. The desktop app is easiest if you've never used a terminal.
  2. Sign in with your Claude account.
  3. Create an empty folder for this project and open it in Claude Code.

Step 2: Install Python (5 minutes)

You need version 3.10 or newer. Macs come with an older one. On a Mac, open Terminal and run:

Command
brew install python@3.12

If Terminal says it can't find brew, install Homebrew first from brew.sh. On Windows, download Python from python.org and tick "Add Python to PATH".

You can also skip this and tell Claude Code "install Python 3.12 for me". It asks for your approval and does it.

Step 3: Get Claude API access (5 minutes)

  1. Sign in at console.anthropic.com.
  2. Add a payment method or a little credit under Billing. $5 is plenty to start.
  3. Set a monthly spend limit, for example $20. This is your safety net.
  4. When the Console asks where your code runs, choose Your own machine. You sign in through your browser and no key is stored on your computer.

On a Mac, that sign-in is two commands:

Command
brew install anthropics/tap/ant
Command
ant auth login

Step 4: Get a Google Maps key (10 minutes)

  1. Sign in at console.cloud.google.com and create a new project.
  2. Turn on billing. Google asks for a card even for free usage.
  3. Search for Places API (New) and click Enable. It must be the one marked "(New)".
  4. Copy the API key Google shows you.
  5. When Google offers to protect the key, choose API restriction, tick only Places API (New), and click Restrict key.
  6. Open Quotas and lower the daily Text Search limit to 100. One run uses about 8 to 24.

Now save the key on your computer. On a Mac, this opens your settings file in TextEdit:

Command
open -e ~/.zshrc

Add this line at the bottom with your key between the quotes, then save and close:

Line to add
export GOOGLE_MAPS_API_KEY="paste-your-key-here"

A restricted key can do nothing else, even if it leaks. The daily limit means a mistake can't run up a bill.

Step 5: Install the agent (1 minute)

In Claude Code, run these one at a time:

Command
/plugin marketplace add ahmadiqbal-tmitm/sales-agent
Command
/plugin install sales-agent@ahmads-build

Then say "Set up Sales Agent". It checks everything above and fixes what's missing.

Step 6: Create your first campaign (10 minutes)

Prompt
Set up a Sales Agent campaign for my business

Claude interviews you and writes four files:

offer.txt
Who you are, what you sell, true proof points, the sender's name and your tone.
searches.txt
Google Maps searches, one per line. "Hair salon in Dubai Marina" beats "salon Dubai".
criteria.txt
Who counts as a good fit, for example "independent, 1 or 2 locations, in these three areas".
notes.txt
What you want to know about each lead before you call.

Only put true facts in the offer. The pitch writer is told never to invent prices, clients or results, so it can only be as convincing as the facts you give it.

Step 7: Run it (5 minutes)

Prompt
Run my campaign for 20 leads

Claude shows the most the run could cost, asks for your go-ahead, runs it, and checks a few pitches against the facts. The results are a spreadsheet file in your campaign's folder.

Start with 20 leads. Read every pitch. Adjust your files, then scale up.

Build it from scratch

You don't have to install my version. I built this by talking to Claude Code, and these are the requests that mattered, in order.

  1. Start with the expensive version. "Find me 100 salons with websites, phone numbers, emails and owner names, in a sheet."
  2. Ask what it cost. "How many tokens did that use, and what did it cost?" Mine was about $30.
  3. Ask for a cheaper design. "How can we do this cheaper without losing quality?"
  4. Have it built and tested. "Build that as a script, and test the free parts on 20 sites we already have."
  5. Make it work for any business. "Would this work for holiday homes instead of salons?"
  6. Add the finding step. "Use Google Places to find the businesses, so I don't need a starting list."
  7. Add the pitch step. "Use a stronger model to find the gap between what each lead needs and what I sell, and draft the outreach."
  8. Make it repeatable. "Write a skill so you run this the same way every time."
  9. Run it small, then check. "Run it for 20 leads, with no duplicates of my sheet."

The rule behind all of it: use the cheapest thing that can do each job. Code for anything that follows a pattern, a small model for reading and sorting, and a strong model only for the writing a customer will see.

Staying safe

  • The agent drafts messages. A person sends them.
  • Restrict every key to one job, cap its daily use, and replace it if it's ever exposed.
  • Set a spend limit in the Anthropic Console before your first run.
  • Websites that block automated visitors are left alone and marked "check by hand".

Built by Ahmad Iqbal as part of building one agent a week, in public. More at ahmads.build.

Tutorials

Templates and guides to build your own agents.

See the guides

About

Who I am, and why I'm building one agent a week.

Meet Ahmad