Build an AI Agent in 10 Minutes with Claude Code
Ask most people how to build an AI agent and you get a shopping list: an orchestration framework, a graph library, a vector store, a week of glue code, and a diagram nobody can maintain. That was a fair answer eighteen months ago. It is now the slow way to do it, and the frameworks are increasingly the part you rip out later.
The hard part of building an agent has moved from orchestration code to specification. You don’t write the loop anymore — you assemble the agent from files Claude Code already knows how to load, and the scaffolding really is six steps you can finish in one sitting.
|
| Six steps, no orchestration code — just files Claude Code loads for you. |
The below topics are covered in this blog -
1. Why “building an agent” got dramatically simpler
2. Step 1 — Install Claude Code
3. Step 2 — Build context with CLAUDE.md
4. Step 3 — Build memory
5. Step 4 — Build skills
6. Step 5 — Build the agent team
7. Step 6 — Run on autopilot with Routines
8. The four building blocks, compared
9. Common mistakes
10. The Takeaway
1. Why “building an agent” got dramatically simpler
An agent is a control loop wrapped around a model: decide the next action, take it, observe the result, repeat until done. You used to write that loop yourself. Claude Code ships it. What you supply now is context and constraints — who the agent is, what it knows, what it can touch, and when it should stop — expressed as plain markdown files the tool discovers and loads on its own.
That is the whole shift. Instead of coding orchestration, you author four kinds of file: persistent context (CLAUDE.md), accumulated memory, on-demand skills, and specialized subagents. The roadmap below is the map for the rest of this post — six steps, in order.
|
|
| The six-step build: install, context, memory, skills, agents, autopilot. |
2. Step 1 — Install Claude Code
This is the foundation everything else sits on. As of mid-2026 the recommended install is the native installer, which has zero dependencies — no Node.js, no npm — and auto-updates in the background. The npm package is still fully supported if you prefer to pin versions or standardize on npm across a team; that route needs Node.js 18 or later.
# Recommended: native installer (no Node.js needed)
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Alternative: npm (requires Node.js 18+)
npm install -g @anthropic-ai/claude-code
# verify
claude --version
You authenticate in the browser on first launch with a Pro, Max, Team, Enterprise, or Console account — the free Claude.ai plan does not include Claude Code. Pick whichever surface fits your workflow: the terminal, the desktop app, or the VS Code side panel. They read the same files, so nothing below is surface-specific.
3. Step 2 — Build context with CLAUDE.md
CLAUDE.md is the always-on onboarding doc. Claude Code reads it at the start of every session and re-reads the project-root copy after a compaction. It can live at several scopes: a project file (./CLAUDE.md, shared via git), a personal file for every project (~/.claude/CLAUDE.md), and a gitignored CLAUDE.local.md for private notes. Claude walks up the tree and concatenates what it finds.
# CLAUDE.md
## Role
Senior backend engineer on a TypeScript / Node service.
## Voice
Terse. No filler. Explain trade-offs, not basics.
## Banned
No new dependencies without asking. Never touch src/legacy/.
## Defaults
Tests with vitest. Conventional commits (feat:, fix:, chore:).
The discipline that matters: CLAUDE.md is billed to context on every single turn. Put conventions and pitfalls here — the things that differ from tool defaults — not facts Claude can rediscover from the codebase in one session. A bloated CLAUDE.md quietly taxes every request and, past a couple hundred lines, actually reduces how well Claude follows it.
4. Step 3 — Build memory
Separate from CLAUDE.md, Claude Code keeps its own auto memory: notes it writes based on what it learns and the corrections you make. Each project gets a directory at ~/.claude/projects/<project>/memory/ containing a MEMORY.md index plus per-topic markdown files. The index loads at session start; the topic files load on demand. Run /memory to browse, edit, or delete anything it has saved — it is all plain markdown.
~/.claude/projects/my-service/memory/
MEMORY.md index: what is stored where
debugging.md fixes to problems solved once
conventions.md patterns inferred from the code
preferences.md how you like to work
The mental split: CLAUDE.md is your instructions to Claude; auto memory is Claude’s notes to itself. Because it accumulates automatically, the same mistake tends not to land twice — but treat it as advisory, not enforcement (more on that in the mistakes section).
5. Step 4 — Build skills
A skill is a folder with a SKILL.md file (plus optional scripts) that Claude Code loads on demand when your task matches its description. It turns a 200-word workflow you keep re-typing into one reusable, discoverable capability. Personal skills go in ~/.claude/skills/; project skills go in .claude/skills/ and version-control with the repo.
~/.claude/skills/changelog/SKILL.md
---
name: changelog
description: Summarize recent commits into a grouped changelog.
Use when asked to write release notes.
---
Read the last 20 commits. Group by feat / fix / chore.
Output markdown with a heading per group. Omit merge commits.
The single most important line is the description. It is the trigger — Claude reads it every session and pulls in the body only when the current task matches. A vague description means the skill silently never fires. Describe the situation to use it in, not just what it does.
6. Step 5 — Build the agent team
A subagent is a specialized Claude instance with its own context window, its own tools, and one job. It runs in isolation and returns only its result, which keeps your main conversation clean. Files live in .claude/agents/ (project) or ~/.claude/agents/ (personal), one file per agent, and each can pin its own model.
.claude/agents/qa-gate.md
---
name: qa-gate
description: Reviews a diff and fails anything below 95/100.
Use after any code change.
model: sonnet
tools: Read, Grep, Bash
---
You are a strict reviewer. Score the diff out of 100 on
correctness, tests, and clarity. State the score. If below
95, list exactly what must change. Do not soften.
A workable division of labour: heavier models for the roles that analyse and plan, faster models for the roles that execute, and a hard QA gate that fails work below a fixed bar. Match the model to the job instead of paying for the top model on every step. The key constraint is scope — one file, one job. That is what makes the team debuggable.
7. Step 6 — Run on autopilot with Routines
The final step turns your agent team into something that runs without you sitting there. Routines let you schedule work to run on Anthropic’s cloud rather than your laptop — set it once and walk away. Anthropic showcased cloud Routines and dynamic workflows at Code with Claude Tokyo in 2026 as a way to move recurring agent work off the local machine.
Concretely, this is where a scheduled trigger fires a skill or an agent on a cadence — a daily summary at 8am, a weekly report dropped into your docs — on the cloud, not a machine you have to keep awake. This surface is newer and moving fast, so confirm the current syntax and availability in the docs before you wire a production job to it.
8. The four building blocks, compared
| Dimension | CLAUDE.md | Auto memory | Skills | Subagents |
|---|---|---|---|---|
| What it is | Always-on instructions | Claude’s own notes | On-demand workflow | Isolated specialist |
| Loads when | Every session start | Index at start, rest on demand | When task matches description | When invoked |
| Who writes it | You | Claude, automatically | You | You |
| Lives at | ./CLAUDE.md, ~/.claude/CLAUDE.md | ~/.claude/projects/<project>/memory/ | ~/.claude/skills/ or .claude/skills/ | .claude/agents/ or ~/.claude/agents/ |
| Scope | Project or user | One repository | Project or user | Single task |
| Best for | Conventions and pitfalls | Learnings you didn’t write down | Repeated multi-step workflows | Parallel or context-heavy jobs |
| Token cost | Paid every turn — keep lean | Index every session | Near zero until triggered | Separate context — protects main |
| Version-controlled? | Project copy, yes | No — local, gitignore it | Project copy, yes | Project copy, yes |
| Failure mode | Bloat taxes every request | Advisory, not enforced | Weak description never fires | Too many tools, wrong pick |
9. Common mistakes
- Putting everything in CLAUDE.md. It is always-on context, so every line is billed on every turn and, past a couple hundred lines, adherence actually drops. Facts Claude can learn from the repo in one session belong in the code or in auto memory — CLAUDE.md is for conventions and pitfalls only.
- One mega-agent with every tool. Tool-selection accuracy degrades as the tool count climbs; the agent starts confidently picking the wrong one. One file, one job, a narrow tool set. Route between focused subagents instead of overloading a single one.
- Treating skills as prompts. A skill is on-demand context gated by its description. If the description does not name the situation to use it in, the skill never triggers and you never notice. Write the trigger, then the task.
- Assuming memory enforces rules. Auto memory is advisory context the model usually follows — not a guarantee. If a rule must hold every time (never touch a directory, never skip a check), use a PreToolUse hook, which actually blocks the action, not a memory line that merely suggests it.
- Running Routines as fire-and-forget. A scheduled agent with write access and no QA gate scales your mistakes on a timer. Put a review step between the agent and anything it can publish, commit, or send — especially once it runs unattended on the cloud.
10. The Takeaway
The six steps are just files: install the tool, write the context, let it build memory, package your workflows as skills, split the work across scoped subagents, and schedule the whole thing. No orchestration framework, no graph library, no glue.
Be honest about the ten minutes, though: that is the scaffold, not the finished agent. Standing up the structure is genuinely fast now. Making it good — tight CLAUDE.md, skills whose descriptions actually fire, subagents scoped so tool selection stays accurate, a QA gate that holds — is iteration, and that is where the real work lives. The teams that win are not the ones who scaffolded fastest. They are the ones who kept tuning the specs.
About the Author
Atique Ahmed — Principal AI Architect. 7x Microsoft MVP and Guinness World Record holder for Programming Excellence. Founder of Codez Tech.
atiqueahmed.com · LinkedIn · GitHub
This is Day [DAY_NUMBER] of a daily GenAI and agentic AI series on CodezTech.

0 comments :
Post a Comment