NNabeel Hassan

Blog · July 11, 2026 · 8 min read

How I Build and Test AI Voice Agents in Minutes with Claude Code and Comet

By Nabeel HassanAI Engineer · ICPC World Finalist

TL;DR: At Fortell AI I built a pipeline that takes a voice agent from a client brief to a tested, hardened draft in minutes instead of days. The trick is treating agent-building as two separate problems and pointing an AI coding tool at each: Claude Code generates and configures the agent and its automation layer from a spec, and Comet browser automation runs the agent through dozens of messy call scenarios before a human ever hears it. This is how I compress the build-and-test loop, and where it still needs a person.

I build production voice and chat agents for a living, most recently for hospitals, real estate, vet clinics and car garages at Fortell AI in the UK. The part nobody outside the work sees is that building the agent is maybe a third of the job. The other two thirds are configuring everything the agent touches, then testing it against the twenty ways a real caller will break it. That testing loop is where days disappear. So I built a pipeline to collapse it. Here is how it works.

Why the build loop is slow (and it is not the prompt)

When people picture building a voice agent, they picture writing the prompt. That is the easy hour. The slow part is everything around it.

A production agent for, say, a car garage is not one artifact. It is a conversation flow, a set of custom functions that hit your automation layer, calendar and CRM wiring, a telephony number with A2P registration, and a pile of edge-case handling that only reveals itself when someone calls in angry with a dog barking in the background. I described the full shape of that stack in how I build production AI voice agents with Retell, and the integration spine in how to connect Retell AI to n8n.

The reason it is slow is not typing. It is the round trips. You build a version, you call it, it fumbles when the caller interrupts or asks something off-script, you fix one thing, you call it again. Each loop is a few minutes of manual dialing and listening. Multiply that by the fifty scenarios a real agent needs to survive and you have burned a week. The pipeline exists to kill those round trips.

Half one: Claude Code builds the agent from a spec

The first insight is that most of what goes into a voice agent is structured and repetitive, which is exactly what an AI coding tool is good at. I do not hand-write every custom function and every n8n node from scratch for each new client. I write a spec, and I let Claude Code turn that spec into the concrete artifacts.

What the spec actually contains

The spec is a plain description of the vertical and the business: what the agent should own, what it must escalate, the actions it can take, the fields it needs to collect, and the tone. For a car garage that might be booking a service slot, quoting a rough labour window, capturing the vehicle registration and mileage, and handing off anything that sounds like a breakdown on the roadside. It reads a lot like the ownership line I draw for every vertical, the same way I split owned versus escalated calls in AI voice agents for veterinary clinics.

What Claude Code generates from it

From that spec, I have Claude Code scaffold the pieces that would otherwise be manual:

The point is not that Claude Code writes a perfect agent. It does not, and I would not ship what it produces untouched. The point is that it gets me from a blank project to a coherent, wired-together draft in one pass, so my time goes into judgement and edge cases rather than boilerplate. This is the same reason I keep business logic in n8n rather than the prompt: structured, regenerable pieces are cheap to rebuild, and a swappable architecture means a regenerated function does not force a rebuild of everything else. I made that full argument in Retell vs Vapi vs Bland.

Half two: Comet tests the agent like a difficult caller

A generated agent that has never taken a hard call is not tested. It is a hypothesis. The second half of the pipeline is where Comet, an AI browser automation tool, earns its place: it drives the agent through the scenarios a human tester would, without a human sitting on the phone for each one.

Why browser automation instead of manual dialing

Every voice platform I use has a web dashboard where you can start a test call, watch the transcript render live, and read the call analysis afterward. That dashboard is a web app, which means a browser agent can operate it. So instead of me dialing a number fifty times, I point Comet at the platform, have it kick off a test call for each scenario, and have it read back what happened from the transcript and the post-call analysis.

The scenarios are the fixtures Claude Code helped generate, plus the nasty ones I add from experience:

What the loop looks like

Comet runs a scenario, captures the transcript and the analysis, and I get a readout of where the agent held and where it broke. A broken scenario feeds straight back into half one: I adjust the spec or the flow, regenerate or hand-edit the affected piece, and re-run just that scenario. The loop that used to be dial, listen, hang up, edit, repeat becomes a batch I can run and read. That is the whole reason a vet clinic agent could go from brief to a testable draft the same day at Fortell, then get hardened over the following week against real edge cases rather than imagined ones.

Where the pipeline still needs a human

I want to be honest about the limits, because "AI builds and tests AI agents" is exactly the kind of claim that gets oversold.

Judgement on the escalation line is mine. Deciding what an agent must never handle, where the safety boundary sits, and how aggressively it hands off is a human call with real stakes. I set that line; the pipeline just enforces it once set. In a clinical or emergency context especially, that boundary is the whole product.

The analysis still needs reading by someone who has heard real calls. An automated readout tells me a scenario passed or failed. It does not tell me the agent sounded robotic, or paused half a beat too long in a way that makes a nervous caller hang up. Those judgements come from listening, and I still listen to a sample.

Compliance and telephony are not a generation step. A2P 10DLC registration, number provisioning, and the delivery rules that decide whether a confirmation text actually arrives are real-world processes with lead times. No amount of code generation shortcuts them, and I covered why that matters in the missed-call textback build.

Regenerating is not the same as maintaining. A generated agent is a fast start, not a finished product. The value is in the first draft and the test loop, not in pretending the human is out of the picture.

What this actually buys you

The pipeline does not make a good agent by itself. A skilled person still designs the conversation, sets the boundaries, and decides what "good" sounds like. What it buys is speed on the parts that were never the hard part: the wiring, the boilerplate, and the tedious round trips of testing. That is a real advantage. It means I spend my hours on the judgement calls that determine whether an agent is trustworthy, and almost none on the plumbing that determines whether it merely runs.

If you have ever wondered why some voice-AI builds ship in days and others crawl for a month, this is usually the difference. It is not that one team writes better prompts. It is that one team has automated the loop and the other is still dialing the phone by hand.


I build and test production AI voice agents for clinics, garages, real estate and service businesses, using the kind of Claude Code plus Comet pipeline described here. If you want an agent built properly and hardened against the calls that actually break it, book a call.

FAQ

Can Claude Code build an AI voice agent?

It can scaffold the structured, repetitive parts fast: the custom function definitions the agent calls mid-conversation, the n8n workflow skeleton behind each one, the conversation-flow structure including the escalation branch, and test fixtures. You write a spec describing what the agent owns and escalates, and Claude Code turns it into a wired-together draft in one pass. It does not produce a shippable agent untouched. Your time then goes into judgement and edge cases instead of boilerplate.

How do you test a voice agent without dialing it manually?

Point an AI browser automation tool like Comet at the voice platform's web dashboard. It starts a test call for each scenario, reads the live transcript and the post-call analysis, and reports where the agent held and where it broke. That turns the slow dial-listen-hangup-edit loop into a batch you run and read, so an agent can be hardened against interruptions, silence, off-script requests and emergency escalations in a fraction of the time.

What part of building a voice agent still needs a human?

The judgement calls. Deciding the escalation line and safety boundary is a human decision with real stakes, especially in clinical or emergency contexts. Listening to a sample of calls to catch a robotic tone or an awkward pause needs a person who has heard real calls. And compliance and telephony, like A2P 10DLC registration and number provisioning, are real-world processes with lead times that no code generation shortcuts.

Building something in this space?

I take on AI-agent, automation and product work directly — scoped fast, shipped fast.

Book a discovery call →

Keep reading