me

Databar.ai

Resources
👋
Schedule a call
API Network
Get started free
Go back to blog

How to Build an Outbound Campaign with Claude Code (Step by Step)

How to Use Claude Code to Build a Fully Automated Outbound Email Campaign in Under an Hour

Blog
me

by Jan

Post preview

Last Tuesday, a friend who runs a 6-person B2B agency texted me a screenshot. It was a CSV with 2,400 enriched leads, personalized email copy for each one, and everything already loaded into Instantly. He built the whole thing in a single Claude Code session. Not table UI. No juggling five browser tabs. Just a terminal window and about 40 minutes of his time.

That is the kind of workflow we are going to build in this guide.

If you have been reading about Claude Code for outbound but haven't sat down and built a campaign with it yet, this is the article that gets you from zero to a live, sending-ready campaign. We will walk through every phase: defining your ICP, pulling leads, enriching contacts, writing personalized sequences, and pushing everything to your cold email sending tool. Real, actual steps.

One important thing before we start. This is not a "prompt and pray" approach where you type one sentence into Claude Code and hope for magic. Outbound that converts in 2026 requires clean data, verified emails, and relevant personalization. We are going to build each of those layers intentionally.

What You Will Build

By the end of this guide, you will have a repeatable system that does the following:

Takes your ideal customer profile as input. Searches for companies and contacts that match. Enriches each contact with firmographic data, verified emails, and relevant signals. Generates personalized email sequences based on what the enrichment data reveals about each prospect. Exports everything in a format ready for your sending platform.

The entire process runs inside Claude Code. Once you have built it once, you can rerun it for every new campaign by swapping out the ICP criteria and letting Claude handle the rest.

Prerequisites

You will need four things set up before you begin.

Claude Code installed and running. If you haven't done this yet, open your terminal and run npm install -g @anthropic-ai/claude-code. You will need Node.js 18 or later. Once installed, type claude and authenticate with your Anthropic account. A Claude Pro or Max subscription gives you generous daily usage, or you can connect your own API key. Alternatively, you can run Claude Code in Visual Studio Code as well.

A data enrichment API key. This is where your leads and contact data come from. We will be using Databar's Python SDK in this walkthrough because it connects to 100+ data providers through a single API, but you can substitute individual providers like Apollo, People Data Labs, or Hunter if you prefer managing multiple keys. Grab your API key from whatever provider you choose.

A sending tool account. You need somewhere to send the emails. Instantly, SmartLead, and Lemlist are popular options. All three have APIs that Claude Code can push data to. If you are already using one, great. If not, Instantly's free trial is enough to follow along.

A CLAUDE.md file (optional but recommended). This is a configuration file you place in your project folder that gives Claude Code persistent context. It remembers your preferences, your API keys (stored as environment variable references), and your standard workflows. We will set this up in Phase 1.

Phase 1: Define Your ICP and Set Up Your Project

Before Claude Code can find leads, it needs to know exactly who you are looking for. Vague prompts produce vague results. The more specific your ICP definition, the better your campaign will perform.

Create a new project folder and open Claude Code inside it:

"mkdir outbound-campaign && cd outbound-campaign"

Your first prompt should lay the groundwork. Something like this:

"I'm building an outbound email campaign. My target ICP is VP of Sales or Head of Revenue at B2B SaaS companies in the US with 50 to 300 employees that have raised Series A or Series B funding. I want to create a CLAUDE.md file that stores this ICP definition, my Databar API key (read from the DATABAR_API_KEY environment variable), and my Instantly API key (read from INSTANTLY_API_KEY). Also install the databar Python package."

Claude Code will create the CLAUDE.md, set up the project structure, and install dependencies. Now your ICP is baked into the project context, which means every subsequent prompt in this session will reference it automatically.

This step matters more than most people realize. A well-written ICP definition in your CLAUDE.md file is the difference between getting a list of random companies and getting a list of companies your sales team will actually want to call. Take the time to be specific about industry, headcount range, geography, funding stage, technologies used, and any disqualifying criteria. If you want to go deeper on ICP definition through data enrichment, our guide to enriching B2B account data for better ICP definition covers the framework in detail.

Phase 2: Pull Your Lead List

Now Claude Code knows who you are targeting. Time to go find them.

This is where your data API does the heavy lifting. Prompt Claude Code to search for companies matching your ICP:

"Using the Databar SDK, search for B2B SaaS companies in the United States with 50 to 300 employees. Filter for companies that have raised Series A or Series B. Pull the first 500 results and save them to a CSV called companies.csv with columns for company name, domain, employee count, industry, funding stage, and headquarters location."

Claude Code will write a Python script, call the Databar API (or whatever provider you configured), and save the results. You can open the CSV to inspect it before moving on.

Here is where things get interesting. Static company data alone is not enough for a high-converting outbound campaign. You also want signals. Is the company hiring sales reps? Did they just close a funding round? Are they using a competitor's product? These data points turn a generic lead list into a qualified one.

Prompt Claude Code to add signal data:

"For each company in companies.csv, check if they have posted any sales or marketing job openings in the last 90 days. Also check if they are using HubSpot or Salesforce. Add columns for recent_job_postings and crm_used. Use Databar for both lookups."

Depending on which providers are available through your API, Claude Code will call the appropriate endpoints. Through Databar, it might use PredictLeads for job posting signals and BuiltWith for tech stack detection, all through the same SDK without you needing to manage separate subscriptions.

After this step, your companies.csv should have around 500 rows with firmographic data plus qualifying signals. You might notice that not every row has complete data. That is normal. No single data provider fills 100% of records. A fill rate of 60 to 75% on enrichment fields is typical, and that is still a solid working list.

Now is a good time to do some manual filtering. Open the CSV and scan through it. Are there companies that clearly do not fit? Maybe a few results are consulting firms with "SaaS" in their description but no actual software product. Or maybe some companies technically match the employee count but turn out to be in an industry you do not serve. Remove those now. It is faster to clean 500 rows by eye than to enrich 500 contacts and realize 100 of them were wasted credits.

You can also have Claude Code help with this cleanup:

"Review companies.csv and flag any rows where the industry classification does not align with B2B SaaS. Also flag any companies that appear to be consulting firms, staffing agencies, or non-software businesses. Create a cleaned version called companies_qualified.csv."

Claude Code is surprisingly good at this kind of judgment call. It reads the company descriptions, cross-references the industry classifications, and makes reasonable decisions. 

Phase 3: Enrich Contacts with Verified Emails

You have companies. Now you need the actual people to email.

"For each company in companies.csv, find 1 to 2 contacts who hold VP of Sales, Head of Revenue, or Director of Sales Development titles. For each contact, find their verified work email. Use waterfall enrichment to check multiple email providers. Save results to contacts.csv with columns for full name, title, company, domain, email, email verification status, and LinkedIn URL."

This is the step where data quality makes or breaks your campaign. If you are using a single email provider, expect a match rate of maybe 40 to 55%. Waterfall enrichment, where Claude Code automatically tries a second or third data source when the first one comes back empty, pushes that number closer to 70 or 80%. The difference is significant when you're building campaigns at scale.

If you want to understand the mechanics behind waterfall enrichment and why it outperforms single-source lookups, check out the step-by-step guide to fully automated CRM enrichment.

One important note: always verify emails before sending. Bounced emails kill your sender reputation. If your enrichment provider includes verification (like Databar's waterfall does), you are covered. If not, add an explicit verification step:

"Filter contacts.csv to only include rows where email verification status is 'valid' or 'catch-all'. Remove any rows with 'invalid' emails. Save the filtered list as verified_contacts.csv."

You should end up with somewhere between 300 and 700 verified contacts, depending on your ICP, geography, and the data providers you used. That is a solid campaign size.

Phase 4: Generate Personalized Email Sequences

Here is where Claude Code really shines compared to traditional outbound tools. Instead of writing one template and mail-merging first names and company names, you can use AI to write genuinely personalized emails based on the enrichment data you collected.

Start by telling Claude Code what your product does and what angle to take:

"I sell a sales intelligence platform that helps revenue teams prioritize accounts using intent signals. For each contact in verified_contacts.csv, write a 3-email sequence. Email 1 should reference something specific about their company, like recent hiring activity, their tech stack, or their funding stage. Email 2 should share a brief relevant insight. Email 3 should be a simple breakup email. Keep each email under 100 words. The tone should be direct, peer-to-peer, not salesy. Save each sequence to a file called sequences.csv with columns for email, first_name, company, subject_line_1, body_1, subject_line_2, body_2, subject_line_3, body_3."

Claude Code will iterate through your contact list and write individualized sequences. This is the part outbound agencies typically spend the most time on. With Claude Code, a batch of 500 contacts takes about 10 to 15 minutes.

A few tips to get better output from this step:

Give Claude Code 2 or 3 example emails that represent your style. Paste them directly into the prompt and say "write in this tone." This alone dramatically improves quality. The more context you include from the enrichment data, the more relevant the personalization. If you only have company name and title, Claude Code can only do surface-level personalization. But if you have hiring signals, tech stack, and funding data, it can write emails that actually reference the prospect's current situation.

Tell Claude to avoid obvious AI phrases. A prompt addition like "do not use phrases like 'I noticed that' or 'I came across' or 'hope this email finds you well'" goes a long way toward making the output feel natural.

After Claude finishes generating sequences, open the CSV and spot-check 10 to 15 random rows. You are looking for repetitive patterns, factual errors, or emails that feel generic. If something is off, give Claude corrective feedback and regenerate. This quality control step takes five minutes and prevents embarrassing mistakes at scale.

A few common patterns to watch for during review. Claude Code sometimes starts multiple emails with the same opening structure, like "I saw that [Company] recently..." across 30 different contacts. If you catch this, prompt Claude Code to rewrite those specific rows with varied opening lines. You might also notice that when enrichment data is thin for a particular contact (maybe all you have is their name, title, and domain), the personalization defaults to generic compliments about the company. For those rows, consider using a simpler template-style email instead of trying to force personalization where there is not enough data to support it.

Another thing worth trying: segment your contact list into tiers before generating copy. Your top 50 prospects (the ones at companies with the strongest buying signals) deserve more detailed, heavily personalized emails. The remaining 300 to 500 contacts can get solid but slightly less custom sequences. You can do this easily in Claude Code:

"Split verified_contacts.csv into two files: tier1_contacts.csv (companies with recent job postings AND Series B funding) and tier2_contacts.csv (everyone else). For tier 1, write longer emails with deeper research references. For tier 2, write shorter, punchier emails focused on one key pain point."

This tiered approach mirrors how the best outbound teams have always worked. You just compressed what used to be a multi-day process into something Claude Code handles in one session.

For more on how to run your outbound campaign at scale with proper testing and iteration, that linked guide covers the testing framework.

Phase 5: Push to Your Sending Tool

Your sequences are written. Your contacts are verified. Now you need to get everything into your sending platform.

If you are using Instantly:

"Read sequences.csv and push each contact into Instantly using their API. Create a new campaign called 'SaaS VP Sales Feb 2026'. Add each contact with their 3-email sequence, spacing emails 3 days apart. Set the sending window to 8am to 11am EST on weekdays."

Claude Code will write the API integration, map the CSV columns to Instantly's expected format, and upload everything. If you are using SmartLead or Lemlist, just swap the tool name in the prompt. Claude Code knows their APIs.

Here is a practical tip that saves time: instead of uploading everything in one shot, start with a test batch. Push your first 50 contacts and monitor deliverability for 24 to 48 hours before loading the rest. This catches issues with email formatting, sending reputation, or content that might trigger spam filters.

"Push only the first 50 contacts from sequences.csv to the Instantly campaign. Label this batch as 'test-batch-1'. I want to review results before loading the rest."

If that test batch looks good, go ahead and load the remaining contacts. You now have a live outbound campaign running, built entirely from a terminal window.

Pro Tips for Your CLAUDE.md Configuration

Your CLAUDE.md file is arguably the most underrated piece of this entire system. Think of it as the operating manual you hand to a new hire on day one. The more context it contains, the better Claude Code performs across every phase.

A good CLAUDE.md for outbound campaigns should include the following:

Your company's one-liner and value proposition, written the way you would explain it to a prospect. This feeds directly into email copy quality. Your ICP definition with explicit inclusion and exclusion criteria. Not just "SaaS companies" but "B2B SaaS companies that sell to mid-market, excluding dev tools, cybersecurity, and companies with fewer than 3 G2 reviews." Your preferred email tone and two to three example emails that represent your best performing messages. Claude Code will pattern-match against these when writing new sequences. API key references as environment variables so they are not hardcoded into scripts. A list of your sending infrastructure details: how many mailboxes, daily sending limits per mailbox, warm-up status, and any domain-specific rules.

When you build a second or third campaign, this file carries forward. You do not re-explain your product, your tone, or your technical setup. Claude Code reads the CLAUDE.md at the start of every session and picks up right where it left off. That compounding context is what makes the second campaign take half the time of the first.

Making the System Recursive

The real value of building outbound campaigns with Claude Code is not the first campaign. It is the fact that every subsequent campaign takes a fraction of the time.

Once you have your project folder with the CLAUDE.md file, the scripts Claude wrote, and your API integrations, running a new campaign is basically a few prompts:

"Repeat the same workflow but change the ICP to Director of Marketing at ecommerce companies with 100 to 500 employees in the UK. Search for 300 companies, enrich contacts, write sequences, and push to Instantly as a new campaign called 'Ecom Marketing UK Feb 2026'."

Claude Code reuses the scripts it already wrote, calls the same APIs, and generates a fresh campaign. What took 40 minutes the first time might take 15 the second time and 10 the third. Over the course of a month, a single person can run multiple targeted campaigns that would have previously required an SDR team and an ops person to manage.

Teams that are getting the most out of this approach treat it like a testing engine. Instead of sending 10,000 emails to one broad ICP, they send 500 emails each to 20 narrow ICPs and compare response rates. This "micro-campaign" approach lets you figure out which segments respond best before investing heavily. Our guide to the outbound email stack for GTM teams in 2026 goes deeper on how the best teams are structuring their sending infrastructure.

What This Looks Like at Scale

For teams or agencies running this at serious volume, the numbers start to look pretty compelling. A single GTM engineer using Claude Code can realistically build and launch 3 to 5 campaigns per week, each targeting a different micro-segment. That is 12 to 20 campaigns per month, each with 300 to 1,000 contacts.

The total cost? A Claude Max subscription ($200/month), data enrichment API costs (which vary, but typically run $300 to $500/month depending on volume), and your sending tool ($100 to $300/month). You are looking at roughly $500 to $1,000/month for the entire stack, which replaces what previously required an SDR, a data ops person, and a copywriter.

For agencies managing multiple clients, the economics are even more compelling. Each client gets their own project folder with a dedicated CLAUDE.md file containing that client's ICP, value prop, and sending configuration. An agency running 10 clients can build and manage campaigns for all of them from the same Claude Code setup, just switching between project folders. The data enrichment costs scale linearly with volume but the labor stays flat because Claude Code does the execution. That is a meaningful margin improvement over the traditional agency model where headcount scales with client count.

One agency founder we spoke with described it this way: his team used to spend two to three days building each campaign manually through Apollo, Clay and a handful of point tools. Now they build the same campaign in under an hour.

The bottleneck shifts. It is no longer "how do we get more leads?" or "how do we write more emails?" The bottleneck becomes "which segments should we test next?" and "what messaging resonates best?" Those are strategic questions, not operational ones. And that is a much better problem to have.

FAQ

How long does it take to build the first campaign? Expect 30 to 60 minutes for your first run, including setup. Subsequent campaigns using the same project folder and scripts take 10 to 20 minutes.

Do I need to know how to code? No. Claude Code writes all the code for you. You communicate in plain English (or whatever language you prefer). That said, basic comfort with a terminal helps. If you can copy and paste commands, you can do this.

What is the best sending tool to pair with Claude Code? Instantly and SmartLead are the most popular because they have well-documented APIs. Lemlist, Replyio and Salesforge are also solid. 

Can I use this for LinkedIn outreach too? The core workflow (ICP definition, lead pulling, enrichment) is the same. The output format changes. Instead of generating email sequences, you would prompt Claude Code to write LinkedIn connection request messages and follow-up scripts. Tools like HeyReach have APIs that Claude Code can push to.

What if my data provider does not have a Python SDK? Claude Code works with any REST API. If your provider only offers REST endpoints, Claude Code will write the HTTP request code, handle authentication, and parse the responses. A Python SDK is nice to have but not a requirement.

How do I handle prospects who are already in my CRM? Add a deduplication step before Phase 3. Export your existing CRM contacts as a CSV and prompt Claude Code: "Before enriching, cross-reference contacts.csv against crm_export.csv and remove any duplicates based on email or domain + name match."

What happens if an API fails mid-workflow? Claude Code handles errors well. If an API call fails, it will typically retry or report the error and continue processing the remaining records. You can also ask it to save progress after every batch so that a failure at row 400 does not lose the work done on rows 1 through 399.

Related articles

Claude Code for RevOps: How Revenue Operations Teams Are Using AI Agents to Fix CRM Data, Automate Pipeline Ops & Build Systems
Claude Code for RevOps: How Revenue Operations Teams Are Using AI Agents to Fix CRM Data, Automate Pipeline Ops & Build Systems

Using AI Agents to Fix CRM Data and Streamline Revenue Operations for Scalable Growth

avatar

by Jan, February 24, 2026

Claude Code for Sales Managers: A Practical Guide to Deal Reviews, Rep Coaching, Pipeline Inspection, and Forecast Prep in 2026
Claude Code for Sales Managers: A Practical Guide to Deal Reviews, Rep Coaching, Pipeline Inspection, and Forecast Prep in 2026

Speed Up Coaching and Forecast Prep with Data You Can Trust

avatar

by Jan, February 23, 2026

How to Build a Client Onboarding System in Claude Code for GTM Agencies
How to Build a Client Onboarding System in Claude Code for GTM Agencies

How To Cut Client Onboarding from Weeks to Hours with Claude Code

avatar

by Jan, February 22, 2026

How to Run Closed-Won Analysis with Claude Code
How to Run Closed-Won Analysis with Claude Code

How Claude Code Turns Your CRM Data into Actionable Sales Strategies

avatar

by Jan, February 21, 2026