Agents 101¶
I have a series on YouTube that demystifies and simplifies AI Agents using just HTML pages with an API request: https://www.youtube.com/watch?v=GvBWGU-Bab4&list=PLsszRSbzjyvkWzP6wtfx_LK441YGFkziR
What Is an AI Agent?¶
A simple LLM, (Large Language Model), call takes input, produces output, and stops. An AI agent is different: it takes a goal, reasons about steps to achieve it, uses tools to act on the world, observes the results, and continues until the goal is met.
The key property is the loop: plan → act → observe → repeat.
Claude Code is an agent. When you ask it to "add a contact form to my website", it reads relevant files, writes code, runs tests, fixes errors, and stops when the job is done — without you directing each step.
Agent Types¶
Task agents execute a defined workflow: generate an invoice, send a summary email, update a spreadsheet. They are reliable and repeatable.
Research agents gather information from multiple sources, synthesise it, and return a structured report. They are best used with web search and browser MCPs.
Code agents read, write, and modify code. Claude Code itself is a code agent. They work best with a clear codebase context and a well-defined CLAUDE.md.
Orchestrator agents decompose a large task and delegate sub-tasks to specialised agents. Claude Code can spawn sub-agents using the Agent tool.
Multi-Agent Coordination¶
Complex business workflows benefit from multiple agents working in parallel or in sequence.
Example — weekly content pipeline:
- Research agent finds trending topics in your niche (web search MCP)
- Writer agent drafts three posts based on research output
- Editor agent reviews drafts for tone, length, and SEO
- Publisher agent formats and queues posts for scheduling
Each agent receives a specific, scoped task. The orchestrator — often Claude Code in your terminal — coordinates the handoffs.
Claude Code Sub-Agents¶
Claude Code can launch sub-agents mid-task using its built-in Agent tool. These run in parallel, preserving the main context window for high-level orchestration.
Use sub-agents when:
- You need to search a large codebase without polluting the main context
- You want to run independent tasks simultaneously (e.g. draft + research at the same time)
- A task requires deep focus on one domain while another is in progress
CLAUDE.md — Agent Configuration¶
CLAUDE.md is a markdown file that Claude Code reads at the start of every session. Use it to encode standing instructions that every agent in your project should follow:
# Project: My Business
## Rules
- Always write in British English
- Never commit without running tests
- Invoice templates are in /templates/invoices/
## Key files
- /docs/index.md — main site content
- /data/contacts.csv — CRM data
Place a CLAUDE.md in your project root for global rules, or in a subfolder for context-specific rules.