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.
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.
Hands-On Exercises
Write a description field for a teaching agent that clearly distinguishes it from a coding agent, following this chapter's own example.
📄 View solutionRewrite the brief "explain recursion" into a genuinely well-formed brief for a teaching agent, stating a specific starting level of understanding.
📄 View solutionA 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 solutionChapter 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, noEdit/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