Agencies charge tens of thousands of dollars to build voice agents that handle real bookings, real CRMs, and real phone calls. With Claude Code, you can build the same thing in just over an hour — no hand-written code, no prompt engineering from scratch, and no deep API knowledge required. This is the exact workflow I use at Ambotix AI to build production-grade voice agents for clients.

This post walks through the complete build: architecture, tool setup, agent configuration in Retell AI, n8n workflow creation, automated batch testing, SMS confirmations via Twilio, and a client-facing analytics dashboard. By the end, you'll have a clear picture of how to put this together yourself.

What "Production-Grade" Actually Means Here

Most voice AI demos show you a bot that can answer a question. What I'm building here is different. This agent handles multiple booking intents in a single call — new bookings, reschedules, cancellations, availability checks, live transfers, and FAQs — while pulling caller data from a CRM in real time and sending confirmation SMS messages automatically.

It also ships with a client-facing dashboard so business owners can see call volume, booking rates, average call duration, and sentiment — all pulled live from Retell's call logs. That's what makes it an actual asset to a business rather than a tech demo.

The Full Architecture Before You Touch Claude

Before opening Claude Code, get clear on what you're building. Here's the architecture for this agent — a physio clinic booking system, but the pattern applies to any appointment-based business:

  1. Inbound call via Twilio SIP trunk routes to the Retell AI agent.
  2. Back-end lookup fires immediately on call start — searches GoHighLevel by the caller's phone number. If found, the agent greets them by name and skips re-collecting their details. If not found, it falls through to a normal greeting.
  3. Intent classification routes into six buckets: transfer to staff, new booking, reschedule, cancellation, availability check, and FAQ via knowledge base.
  4. GoHighLevel via n8n handles all calendar operations — checking free slots, creating contacts, booking, rescheduling, and canceling appointments.
  5. SMS confirmations and reminders go out via Twilio after each action, plus a scheduled n8n workflow checks every 5 minutes for appointments within 1-hour and 24-hour windows.
  6. Post-call webhook from Retell fires at call end, pushing transcript, summary, sentiment, and extracted fields into a dashboard.

Sketch this out in Excalidraw or on paper before you start. The diagram gives Claude the context it needs to make consistent decisions across the prompt, the n8n workflows, and the tool configurations.

Setting Up Claude Code in VS Code

You need either the Claude Pro or Claude Max plan — the Pro plan handles most of this build fine. Install Visual Studio Code, then search for the Claude Code extension (nearly 10 million installs). After installing, sign in with your Anthropic web account so the extension draws from your plan's usage.

One setting to change immediately: go to VS Code settings, search "Claude," and enable Allow Initially Skip Permissions. This lets Claude run commands and API requests automatically without prompting you for approval on every action. Without it, you'll be clicking through confirmation dialogs constantly.

Open a fresh folder as your workspace. This is the local environment Claude Code will read from, write to, and run terminal commands inside.

The CLAUDE.md File — Your Project System Prompt

This is one of the most important parts of the setup. A CLAUDE.md file acts as a persistent system prompt that Claude loads at the start of every new conversation. Because you'll be using /clear throughout the build to prevent context bloat, this file ensures Claude never loses track of what it's building.

Prompt Claude to generate this file by giving it:

  • Business context: the client's website URL, services, locations, and operational details.
  • Your role: you're an AI agency owner building this agent for a client.
  • The tech stack: Retell AI, GoHighLevel, Twilio, n8n, Claude Code.
  • What's coming: tell it you'll be providing prompting formats, API documentation, and workflow instructions throughout the session.

Keep the file under 250 lines. Too long and it eats context on every load. The goal is a lean reference document, not an essay.

The Agent Pipeline MD — Teaching Claude Your Build Process

Beyond the CLAUDE.md, create a second file: an agent pipeline MD that defines the exact build sequence Claude should follow. This matters because it keeps outputs consistent across conversations and stops Claude from trying to do everything at once.

The five-step sequence I use:

  1. Build the Retell AI voice agent — prompt, LLM config, voice, call settings, tools as placeholders.
  2. Research and build the n8n workflows against the GoHighLevel API.
  3. Connect the n8n workflows to the Retell agent as live tools.
  4. Run manual and automated batch tests via the Retell API.
  5. Output a full summary of the completed agent.

This separation produces noticeably better outputs than asking Claude to build everything in one shot. Each stage gets focused context.

API Keys and Credentials

Give Claude all credentials up front so it can work autonomously without stopping to ask for them mid-build.

  • Retell AI API key: Settings → API Keys → create a new full-scope key.
  • GoHighLevel API key: Settings → Private Integrations → create new → select all scopes. Copy the key once generated.
  • Twilio credentials: Console → API Keys → create a key, grab the SID and secret. Also note your Account SID for REST API access.
  • n8n API key: Settings → n8n API → create with no expiration. Also copy your n8n instance URL (formatted as yourappname.app.n8n.cloud).

Tell Claude to store these in a setup.md file and create the credentials config — but explicitly tell it not to start building the agent yet. If you don't say that, it'll start building immediately.

Installing n8n Skills and the MCP Server

There are two GitHub repositories — one for n8n skills and one for the MCP server — that give Claude detailed knowledge of how to construct n8n workflows. Point Claude at both URLs and tell it to install them, passing your n8n instance URL and API key.

Once done, Claude will confirm the skills are installed and that it can now create JavaScript expressions, handle workflow patterns, and configure n8n nodes correctly. This is what allows it to build working GoHighLevel integrations rather than guessing at the structure.

Research Pass Before Building

Before touching the agent, have Claude do a research pass on the Retell AI and GoHighLevel API documentation. Paste in the documentation URLs and tell it to read and understand how the two systems interact — particularly around calendar operations, contact lookups, and webhook formats.

Also add a prompting format MD file at this stage. This is a standardized template for how voice agent prompts should be structured. I've made mine available free in the resource library — link in the description. Give it to Claude and tell it to follow this format for every prompt it writes.

After the research pass, do a /clear. Fresh context window. The MD files persist, so Claude picks up right where it left off — but without the accumulated noise of the setup conversation.

Building the Retell Voice Agent

This is where the real build starts. Use plan mode first. Describe the full architecture to Claude — back-end lookup, six intent buckets, GoHighLevel for all calendar operations, SMS confirmations, post-call webhook to n8n — and ask it to generate a plan before touching anything.

Review the plan. Check that it has:

  • Dynamic variables for the inbound number lookup (returning customer name, contact details, existing bookings).
  • Six intent routes with distinct conversational flows for each.
  • Placeholder tools for all n8n endpoints (check availability, book, reschedule, cancel, transfer).
  • Call settings — I set max call length to 6 minutes and end-on-silence to 30 seconds.
  • Knowledge base attached from the business website URL.
  • Post-call data extraction fields configured in the agent settings.

Once the plan looks right, tell Claude to build only the Retell configuration — not the n8n workflows yet. Switch to bypass permissions and let it run. It'll use the Retell API to create the agent, configure the prompt, attach tools, set the voice, and build the knowledge base automatically.

One thing to watch: Claude occasionally creates local JSON files instead of deploying via the API. If that happens, just tell it to create the agent via the API and it'll comply.

Reviewing the Retell Agent Config

Open your Retell dashboard and click into the agent. Check:

  • The prompt: look for the dynamic variable injection at the top of each call (the lookup result feeding into the greeting), all six intent handlers with clear routing logic, and confirmation of new vs. returning customer flows.
  • Functions tab: check availability, book appointment, reschedule, cancel, transfer — all should be there with n8n placeholder URLs.
  • Speech settings: back-channeling words add to conversational naturalness — worth keeping.
  • Call settings: verify your 6-minute limit and silence timeout.
  • Post-call extraction: this is what feeds the dashboard later.

Once everything checks out, use /compact to compress the conversation before moving to the next phase. I do this at around 60% context usage to keep output quality high.

Building the n8n Workflows

Now tell Claude to build all the GoHighLevel workflows inside n8n: check availability, book appointment, reschedule, cancel. Instruct it to verify against the GoHighLevel API documentation so the calendar interactions are correct.

The one thing Claude will need from you that it can't get automatically is your GoHighLevel location ID. Find it in the URL when you're inside your sub-account. Paste it in and Claude handles everything else — it creates the calendars, configures custom fields, sets staff availability (8am–5pm), and builds the workflows.

If Claude tries to hand you manual steps, push back: "Can you do this automatically? What's the bare minimum you need from me?" Nine times out of ten it can handle it with just one more piece of information.

Each workflow follows a consistent pattern: JavaScript node to set time formats and API parameters → GoHighLevel API call → format the response → trigger SMS confirmation. The inbound lookup workflow is the same — takes the calling number, searches GoHighLevel contacts, returns the result as variables back to Retell.

SMS Confirmations and Reminders

After testing, I switched SMS delivery from GoHighLevel's conversation API to Twilio directly. GoHighLevel's workflow API doesn't expose enough SMS control without setting up a connected number, whereas Twilio works immediately with the credentials already in the project.

The reminder workflow runs on a 5-minute cron inside n8n. It pulls all GoHighLevel appointments, checks if any fall within 1 hour or 24 hours from the current time, and fires the appropriate SMS. Claude builds this automatically once you describe the logic.

Running Automated Batch Tests

Once the workflows are live, have Claude run a batch test suite using the Retell API's chat test endpoint. Give it these instructions:

Test all scenarios — new booking, reschedule, cancellation, availability check, FAQ. If you find any errors, fix them and re-run that specific test to confirm the fix.

Claude will write Python test scripts, fire them against the agent, read the results, identify any failures, update the agent or workflow that caused the error, and re-test. I ran seven scenarios in this build — it caught and fixed a "silence after tool call" bug where the agent wasn't speaking after receiving a tool response. One setting change across all four tools resolved it.

After the batch tests pass, check your GoHighLevel appointment list to confirm real bookings were created. Then do a manual live call test.

Connecting a Twilio Number via SIP Trunk

To test with a real phone call, you need a Twilio number connected to Retell via a SIP trunk. Buy a number in the Twilio console (Phone Numbers → Buy a Number), then give Claude the Retell SIP URI from the Retell/Twilio documentation and ask it to create the SIP trunk via API and attach the number to your agent.

Claude lists all available numbers in your Twilio account via the API, creates the trunk, and configures the routing. Once done, call the number. The first call I made after setup correctly identified my number from GoHighLevel and greeted me by name — the back-end lookup working exactly as designed.

The Client Dashboard

The last piece is a Next.js dashboard deployed to Vercel with password protection. Describe what you want to Claude: post-call data from Retell's API, an n8n webhook that aggregates the metrics as JSON, and a dashboard showing total calls, bookings, booking rate, average duration, sentiment, and a scrollable recent call log.

Use plan mode here — building a web app uses significant tokens and you want to confirm the architecture before it starts writing files. Once the plan's confirmed, switch to bypass permissions and let it build.

The dashboard Claude produced for this build pulls directly from Retell's call logs via n8n, calculates booking metrics, and displays everything behind a username/password login. Business owners get a single URL and credentials — they can see every call, click into summaries, and track performance over 24 hours, 7 days, or 30 days. That's a deliverable you can hand to a client on day one.

The Production-Grade Voice AI Agent: What You End Up With

At the end of this build, the agent can handle a full inbound call flow for an appointment-based business: greet returning callers by name, book, reschedule, and cancel appointments, check availability, answer business FAQs, transfer to live staff, send SMS confirmations and reminders, and log every call with sentiment and extracted fields to a client dashboard. All of it built through Claude Code without writing a single line of code manually.

The real testing phase starts when actual clients use it. That's where you'll find edge cases Claude's batch tests didn't cover. But this build gets you to a deployable, functional agent fast — one that holds up under real-world conditions and gives the business owner full visibility into what's happening.

If you're building production-grade voice AI agents — whether for clients or your own business — new tools, API changes, and better patterns show up constantly. I drop build videos every two days covering exactly this kind of work. Subscribe to the channel to stay current, and join the free Voice AI Alliance community where builders share what's actually working in production: Subscribe on YouTube · Join the free community.

Watch the full build

Subscribe for new tutorials every 2 days

Voice AI builds, Claude Code workflows, and the tools we use to ship real AI agents.

Subscribe