Series

Agentic AI: How AI Agents Work

How AI agents work, measured on the Claude API: the agent loop, tool calling, planning, context engineering, MCP, multi-agent systems, coding and computer-use agents, evals, reliability and cost. Read them in order, or jump to whatever you're curious about.

  1. What an AI Agent Is: The Loop, Measured

    An agent is a model in a loop that picks tools and decides when it's done. Build one in 160 lines, trace a run, and measure tokens, cost and latency.

    Agents & Tool Use
  2. How Tool Calling Works Inside the Model

    Tool schemas become prompt tokens, and a tool call is a predicted token. Strict mode, parallel calls and tool descriptions, measured on Claude Haiku 5.5.

    Agents & Tool Use
  3. Reasoning and Acting: ReAct, Planning and Thinking, Measured

    ReAct, plan-and-execute and adaptive thinking on one 36-task tool set: accuracy, tokens and cost on Claude Haiku 5.5, and where more reasoning stops paying.

    Agents & Tool Use
  4. Reflection and Self-Correction in Agents, Measured

    Self-critique, test feedback and Reflexion on 40 coding tasks with Claude Haiku 5.5: what each one fixes, what it breaks, and what a fix costs.

    Agents & Tool Use
  5. Context Engineering: Keeping a Long Agent Run Inside the Window

    What fills an agent's context window, and six ways to manage it, measured on 22 long tasks with Claude Haiku 5.5: accuracy, peak tokens and cost.

    Agents & Tool Use
  6. MCP: Connecting Agents to Tools

    How the Model Context Protocol works on the wire, how to plug MCP servers into an agent loop, and what happens to tool choice as tools pile up.

    Agents & Tool Use
  7. Multi-Agent Systems: Orchestrators, Sub-agents and A2A, Measured

    One agent or a lead with sub-agents? Measured on 26 tasks with Claude Haiku 5.5: accuracy, token multiples, cost and wall time, plus A2A on the wire.

    Agents & Tool Use
  8. Coding Agents: How They Fix Real Bugs, Measured

    How coding agents solve SWE-bench-style issues with search, edit and test tools, measured on 28 bugs from real Python repos with Claude Haiku 5.5.

    Agents & Tool Use
  9. Computer-Use and Browser Agents: Pixels Versus the Page

    How Claude's computer and browser toolsets work, what a screenshot costs in tokens, and 20 browser tasks run three ways on a sandboxed intranet.

    Agents & Tool Use
  10. Research Agents: Web Search, Fetch and Citations, Measured

    Claude's web search and fetch tools on 30 fresh questions: one search vs a research loop, cost per answer, and a hand audit of 60 citations.

    Agents & Tool Use
  11. Evaluating Agents: pass@k, pass^k and Run-to-Run Noise, Measured

    SWE-bench, τ-bench, OSWorld and GAIA explained, then 1,140 repeated agent runs: pass@k vs pass^k, run-to-run spread, cost per solved task and judge agreement.

    Agents & Tool Use
  12. Long-Horizon Reliability: Compounding Errors, Retries and Checkpoints

    Why long agent runs fail more often than their steps do, measured on Claude Haiku 5.5, and what retries, idempotency keys, checkpoints and budgets fix.

    Agents & Tool Use
  13. Sandboxing and Permissions for AI Agents, Measured

    What a sandbox costs per tool call, what it keeps out, and how many tool calls each allow/ask/deny policy interrupts, measured on 100 agent runs.

    Agents & Tool Use
  14. Training Models to Be Agents: Trajectories, Environments, Rewards

    How models learn to act: fine-tuning on agent trajectories, sandboxes by the million, rewards a program can check, multi-turn RL and reward hacking.

    Agents & Tool Use
  15. Cost and Latency of Agents: Caching, Effort, Models and Batch, Measured

    Cost per completed task and time per task on one 36-task set, lever by lever: prompt caching, effort, Haiku vs Sonnet, a Sonnet lead and the Batch API.

    Agents & Tool Use
  16. An Agent End to End: A Docs-Maintenance Agent, Measured

    One docs-maintenance agent built from everything this series measured, run 612 times on real docs with seeded defects: what it finds, misses and costs.

    Agents & Tool Use