The Teaching Agent

Claude Code Agents: Fundamentals

Chapter 4 · The Teaching Agent

A teaching (or tutor) agent has a genuinely different purpose from most agents in this course: it exists to build your own understanding of a concept, not to produce a finished piece of work on your behalf. This chapter covers designing one, briefing it well, and — just as importantly — recognizing when it's the wrong tool for what you actually need.

Designing a Teaching Agent's Definition

The description field matters especially here, since it's easy to confuse a teaching agent with a coding agent if the description doesn't draw a clear line: "Use this agent when you want a concept or piece of unfamiliar code explained so you understand it yourself. Do not use it when you want code written, fixed, or changed — use a coding agent for that." Tool access can stay minimal — typically just enough to read the specific code you're asking about (Read, Grep), with no need for Edit or Write at all, since this agent's whole job is explanation, not modification. Model choice should favor a genuinely capable reasoning model — a good explanation requires real understanding of the concept and the judgment to adapt it to what you already know, not just retrieving a definition.

Writing the System Prompt for a Tutor

A tutor agent's system prompt should instruct it to:

  • Ask what the learner already knows before launching into a full explanation, rather than assuming a fixed starting level
  • Ground new concepts in analogies to things the learner has already confirmed they understand
  • Favor checking understanding along the way over delivering one long, uninterrupted explanation
  • Define any jargon the moment it's introduced, rather than assuming it's already familiar

Briefing a Teaching Agent Well

Chapter 3's brief-writing principles apply directly here, with one addition specific to teaching: state your current level of understanding explicitly, not just the topic. "Explain decorators" gives a tutor agent nothing to calibrate against; "explain decorators — I'm comfortable with regular functions and passing functions as arguments, but I've never used the @ syntax" gives it a genuine starting point to build from.

A Worked Example

Given the brief above, a well-designed tutor agent wouldn't open with a formal definition of decorators. It would more likely start from what's already confirmed known — "since you're already comfortable with passing a function as an argument, a decorator is really just a function that takes your function as an argument, does something around it, and gives back a new function to use instead" — before introducing the @ syntax as a shorthand for exactly that pattern already just explained, rather than as a new, separate thing to learn from scratch.

Tell it what you already know, not just what you don't
A tutor agent has no way to guess your starting point on its own — per Chapter 1, it starts cold. Stating explicitly what you're already comfortable with is often more useful than stating what confuses you, since it gives the agent solid ground to build the explanation on top of.

When Not to Use a Teaching Agent

If what you actually want is code written or fixed quickly, routing that request through a teaching agent instead of a coding agent wastes time on an explanation you didn't need — you'll get understanding when what you wanted was a finished result. The two are genuinely different goals, and picking the right agent for which one you actually want in the moment matters more than it might seem.

A good explanation isn't the same as a correctness guarantee
A teaching agent explaining why a piece of code works (or how a concept generally functions) is not the same as verifying that your own specific code is actually correct or bug-free. Don't mistake a clear, confident-sounding explanation for a review of your actual implementation — that's a code-review agent's job (Chapter 6), not this one's.

Hands-On Exercises

Exercise 1

Write a description field for a teaching agent that clearly distinguishes it from a coding agent, following this chapter's own example.

📄 View solution
Exercise 2

Rewrite the brief "explain recursion" into a genuinely well-formed brief for a teaching agent, stating a specific starting level of understanding.

📄 View solution
Exercise 3

A developer asks a teaching agent to "explain why this function is broken and what's wrong with it," expecting the code to also get fixed as part of the answer. Explain what's likely to go wrong with this expectation, using this chapter's own material.

📄 View solution

Chapter 4 Quick Reference

  • A teaching agent builds your own understanding — it doesn't produce finished work on your behalf
  • Description should explicitly rule out coding tasks; tools can stay minimal (Read/Grep, no Edit/Write)
  • Favor a capable reasoning model — good teaching requires real understanding and adaptation, not retrieval
  • Brief it with your current level of understanding, not just the topic you want explained
  • Don't route "just fix it" requests through a teaching agent — use a coding agent instead
  • A clear explanation is not a correctness guarantee — that's a code-review agent's job