How do you build an AI agent with Claude? You give Claude a job, the tools to do that job, and a loop that lets it work until the job is done. Claude reads the task, decides which tool to use, reads the result, and decides what to do next. Your code, or Claude Code, runs the loop and executes the tools. That loop is the whole agent.
Most tutorials skip straight to code. This one starts with the choice that matters: which way of building fits your job.
Which way of building an AI agent with Claude should you pick?
Path one: Claude Projects. No code at all. You create a Project inside Claude, write instructions describing the job, and upload reference documents. Every conversation in that Project starts with those instructions and documents loaded. This fits a personal agent: a research assistant, a content helper, a briefing writer. It does not run on a schedule, and it cannot call your business systems.
Path two: Claude Code. You run Claude in your terminal, and it builds and runs things for you: code, scripts, workflow definitions. You describe the agent in plain language, Claude Code writes the code, and you test it. It fits developers and technical founders who want an agent that lives in their codebase and their tools.
Path three: the Claude API. You write the agent loop yourself, in Python or TypeScript, calling the Claude API with a set of tools you define. This is the most flexible path and the most work. It fits a product: an agent you ship to customers, or one that must run unattended on your own infrastructure.
Service business owners who want a follow-up or briefing agent should start with path one or two. Builders shipping software end up on path three. The rest of this post follows path three, because understanding the loop teaches you what the other paths are doing for you.
How does the agent loop actually work?
The loop is simple, and every agent framework is a variation of it:
- You send a task, plus the list of tools Claude may use, plus its instructions.
- Claude reasons and either answers in text or returns a tool call, saying which tool to run and with what inputs.
- Your code runs the tool: a database lookup, a CRM search, an email send, a file read.
- You hand the result back to Claude as a tool result, and Claude reasons again.
- The loop repeats until Claude answers in plain text, which is the final result, or until you hit a limit you set.
That is it. Claude never touches your systems directly. Your code is the hands, Claude is the judgement. This separation is also the safety model: an agent can only do what its tools allow.

What tools should you give your agent?
Tools are functions with a name, a description, and a schema for their inputs. Claude reads the descriptions and decides when each tool fits. Three rules make tools work:
- Name them like verbs. get_customer, send_email, search_documents. Claude picks tools by name and description, so vague names produce vague choices.
- Keep each tool narrow. One tool, one job, one clean result.
- Return useful errors. When a tool fails, the error message goes back to Claude, and a clear error lets it recover. A blank failure stalls the loop.
Beyond your own functions, the Model Context Protocol, or MCP, is how agents reach outside systems: databases, CRMs, browsers, files. An MCP server exposes a system's tools in a standard shape, so Claude Code can use them without you writing a custom integration for each one. When we connect an agent to a client's CRM or to n8n, MCP is usually the bridge. Our custom automation builds use this pattern: Claude reasons, MCP tools act, n8n runs the scheduled work.
What are Claude Code skills, and when do they matter?
Skills are packages of instructions that teach Claude Code how to do a specific job well. Instead of pasting the same long instructions into every session, you install a skill and Claude Code loads it when the job matches.
Skills matter most when the job has failure modes a newcomer would not see: the buffering quirk of an MCP server, the schema mistake that makes a tool unusable, the verification step everyone skips. A good skill is a checklist written by someone who already made those mistakes.
How do you write instructions an agent will actually follow?
Agent instructions fail when they are too vague, too long, or contradictory. What works:
- State the job in one sentence first, with the approval rule included.
- List what it must always do and must never do. Always check the CRM before drafting. Never invent a price, a client name, or a result.
- Give it examples of good output. One example beats ten adjectives.
- Tell it what to do when stuck. "If the CRM lookup fails, say so and stop" beats an agent that improvises.
Keep instructions short enough to hold in mind. If your instruction file runs to pages, split it: the core job in the system prompt, the detail in reference documents the agent can read when needed. This is the same idea behind our RAG chatbot work: the agent answers from your material, not from memory.
What does a real business agent look like?
Take the lead follow-up agent, the one we build most often for service businesses. The trigger is a new lead in the CRM. The agent's tools are: look up the lead, check previous conversations, and draft a reply. Its instructions say: acknowledge like a person, ask one question, never pitch first, and stop if the lead replies with anything that needs a human.
The loop runs like this. New lead arrives, the agent reads the record, checks history, and drafts a reply for a human to approve. Nothing sends itself. That is the pattern to copy: automate the drafting and the lookup, keep the sending.
How do you test an agent before trusting it?
Never point a new agent at real customers on day one. Test in this order:
- Run it on ten old cases where you already know the right outcome, and compare.
- Read every tool call, not just the final answer.
- Try the hostile cases: missing data, duplicate records, an angry message, a request it should refuse.
- Put a human in the loop for the first real runs, approving every action.
Set limits from the start: a maximum number of loop steps, a timeout, and a rule that any tool that changes money, sends a message, or deletes data needs approval.

What mistakes do first-time agent builders make?
The same five, almost every time. Too many tools: start with three. No stopping rule: cap the steps. Contradicting instructions: pick a priority. Trusting the first demo: one good run is not a tested agent. Automating the send: the first version should draft, not send.
The fix for all five is the same discipline: small scope, clear instructions, human approval, then expand.
How does this connect to chatbots and automation?
A chatbot answers questions. An agent does jobs. The chatbot is a subset: one tool and one job. The agent adds tools and a loop, so it can look things up, decide, act, and check its work. If your need is answering questions on your website, a chatbot is enough, and our AI chatbot work covers it. If your need is following up leads or running a repeatable process, that is an agent, and it usually sits on the same automation layer: n8n for scheduling, the CRM as the system of record, Claude for the judgement.
Frequently asked questions
Do I need to know how to code to build an AI agent with Claude?
No, not to start. Claude Projects needs no code, and Claude Code lets you build by describing what you want. You need code when the agent must run unattended, ship as a product, or integrate deeply with your systems.
What is the difference between Claude Code and the Claude API?
Claude Code is a ready-made agent that runs in your terminal and builds things for you. The Claude API is the raw model with a tool interface, which you wrap in your own loop.
How much does it cost to run an AI agent with Claude?
It depends on the model, the number of loop steps, and how much context each step carries. Short, well-scoped agents with few tools are cheap to run. If you want a number for your use case, book a discovery call and we will scope it from the actual job, not a guess.
Can an agent work without my supervision?
Yes, for narrow, reversible jobs: drafting, lookup, summarising, triage. For anything that sends messages, moves money, or changes customer data, keep human approval until the action has proved boring.
What is MCP and do I need it?
MCP, the Model Context Protocol, is the standard way to connect an agent to outside systems like CRMs and workflow tools. You need it when your agent must act on real business systems. If it only needs your own code's functions, plain tools are enough.
Start small. Pick one job that eats an hour a day, give Claude three tools and a short instruction set, and test it on old cases before it touches a real customer. And if you would rather have it built for you, our custom automation work starts exactly there: one job, done properly, then the next.

