Claude courses
Course 3 · Lesson 2 of 6

Course 3 · Lesson 2 · about 20 minutes

Two agents, one inbox

By the end, two agents that Claude built from your prompt share a shop's support inbox: one sorts the messages and can only read, the other saves a draft reply for each. Neither can send anything, and you read every draft yourself.

From lesson 1
You ask in Chat about a gym member. Where does Claude get the answer?

From the connector. Claude asks it and reads its reply, and never opens members.csv, so the phone numbers in the file never reach Claude. Today you limit two agents the same way, by what you ask for.

ThinkDelegation

Where does one job split in two?

An agent is a helper Claude can start for one job, with its own instructions and its own short list of tools. Claude Code calls these subagents. Two of them pay off when one job is really two: one stage reads and sorts, the next one writes.

Sorting incoming requests and then answering them, or reading invoices and then flagging the odd ones. The practice kit uses a shop's support inbox.

Most second stages write something. Name what they must never do with it: send it, pay it, delete the original.

PredictDiligence

What can each agent see and do?

Guess before you build anything. The Check shows you.

The sorting agent has just read five customer messages. Claude now starts the drafting agent. What does the drafter know about the sorter's work?
Show the answer

Only what Claude hands it in the request. Each agent starts fresh, with its own instructions and the one message Claude sends it. It can still open files, so the drafter reads the inbox and the rules itself. The sorter's list reaches it only because Claude passes it on, which is why the prompt in step 5 says "give its whole list".

Your prompt says the sorter can only read files. Later you ask it to save its list as a file. What happens?
Show the answer

It says it can't. Claude gave it reading tools and nothing else, so it has no way to write a file, however it's asked. It can't even ask you, because there's no writing tool to ask about. When you describe an agent, give it one job and only the tools that job needs.

Do

Describe two agents and let Claude build them

Five steps, about 15 minutes. Tick each one when it's done.

Claude, in your session INBOX-SORTER Job: sort inbox.txt Can: read files Can't: write or send REPLY-DRAFTER Job: a draft per message Can: read, create files Can't: send, run commands The list goes back via Claude drafts: 1-maria.txt to 5-ida.txt Neither agent has a tool that sends anything.
What you're buildingTwo agents, one job each, and only the tools that job needs.
  1. Put the kit in a folder and open it in the Code tab.

    Unzip the kit and open the folder in the Code tab with the mode set to Manual, as you did in lesson 1.

    The Brightline Kettles kit

    Brightline Kettles is a made-up kettle shop. The ZIP holds inbox.txt with five customer messages, policies.txt with the shop's reply rules, and a short README.txt. Unzipping it gives you a folder called kettle-support.

    Download the ZIP (1 KB)
  2. Give Claude the build prompt.

    Paste it into the Code tab and press Enter.

    Make two agents for this folder, saved inside it so they're here whenever I open it. inbox-sorter reads inbox.txt and gives back one line per message: number, sender, topic (fault, delivery, return, question or praise) and urgency (high, normal or low). It can only read files. reply-drafter writes one reply per message, following policies.txt exactly, and saves each as a new file in a folder called drafts, named like 1-maria.txt. It never changes inbox.txt or policies.txt. Neither agent can send anything, run commands or go online. Give each one only the tools its job needs. Don't write any replies yourself, and don't run the agents yet. Before you say it's done, check both agent files are set up the way the Code tab reads them, and show me each agent's name, job and tools.

    The first line asks for agents that stay with the folder, so they're there every time you open it.

    The inbox-sorter and reply-drafter lines give each agent one job and say what it hands back. "It can only read files" and "It never changes" are the limits.

    "Give each one only the tools its job needs" is the line Claude turns into each agent's list of tools. "Neither agent can send anything" means no agent gets a tool that sends.

    "Don't write any replies yourself" keeps Claude from doing the agents' work, and the last line asks for proof before it says it's done.

  3. Approve what Claude asks.

    Claude saves each agent as a short text file in a folder named .claude inside your kit folder. Finder and File Explorer hide folders whose names start with a dot, so you may not see it, and you don't need to.

    Expect a request to create each of the two files. One of them may offer a choice that starts "Yes, and allow Claude to edit files in this project's .claude folder". Either yes saves the agents. Claude may also ask to run a command to check the files; ask "why do you need this?" first if you're unsure.

    Read each request before you approve it, and say no to anything you didn't ask for. Before it says it's done, Claude shows you each agent's name, job and tools: reading only for the sorter, reading and creating files for the drafter.

  4. Ask Claude to explain what it built.

    Send this in the same session and read the answer:

    Explain what you built as if I've never seen code. One line per file. For each agent, tell me what it can't do.

    The answer should say the sorter can't write, change or send anything, and the drafter can't send, run commands or go online. Claude may add that the drafter's tool for creating files works anywhere in the folder, so its instructions are what keep it in drafts. That's true, and it's why you read each file name before you approve one.

  5. Start a new session and run the two agents.

    A session only finds agents in a folder that existed when the session started, and Claude has just made that folder. Click + New in the sidebar, choose the same kettle-support folder, check that the mode still says Manual, and send:

    Use the inbox-sorter agent to sort inbox.txt. Then give its whole list to the reply-drafter agent and have it write the drafts. Don't write or change any file yourself.

    Claude hands the inbox to inbox-sorter, waits for its list, then passes the list to reply-drafter. The drafter asks five times to create a file. Each request names reply-drafter and a file in drafts, so approve those. If a request names any other file, say no.

    To watch an agent while it works, open the ⋮ menu in the session's title bar and choose Background tasks.

If you see this instead

Claude says it can't find inbox-sorter
The session started before the agents existed. Start a new session on the kettle-support folder, as in step 5, and send the prompt again.
Claude writes the replies itself and never starts an agent
Paste: "Use the inbox-sorter and reply-drafter agents for this. Don't write the replies yourself." If it still can't find them, start a new session.
A request wants to change inbox.txt or policies.txt
Say no. Then go back to the first session and paste: "reply-drafter tried to change policies.txt. It may only create new files in drafts. Fix its instructions." Run it again in a new session.
Claude wants to install something
Before you approve, ask: "Why do you need this?" Building two agents needs nothing installed.
CheckDiscernment

Are the drafts right, and can the sorter write?

1 · SORT inbox-sorter 1 Maria fault 2 Paul delivery 3 Lena return 4 Omar question 5 Ida praise It reads, then sends back five lines 2 · HAND OVER Claude To reply-drafter: "Here is the list. Draft each one." Claude passes the list on in a request 3 · DRAFT reply-drafter drafts/1-maria.txt drafts/2-paul.txt drafts/3-lena.txt drafts/4-omar.txt drafts/5-ida.txt You approve each file it creates
Why the order mattersThe drafter can only work from what Claude hands it.

Open the drafts folder in Finder or File Explorer and read each file yourself, as the person who would send them.

You pass when drafts holds five files, 1-maria.txt to 5-ida.txt, each short and signed "Sofia, Brightline support". Maria gets a replacement sent today, with no return needed. Paul gets a carrier trace and an update within 1 working day. Lena gets a prepaid label and a refund to her original payment method. Omar is told not to use vinegar and to use the citric acid sachets. Ida gets a thank-you with no rules in it.

Maria asked for her kettle by Friday. Her reply shouldn't promise Friday, because the rules don't say how long a replacement takes. To check the length, ask Claude "How many words is each file in drafts?" Each should be under 80. If a draft breaks a rule, leave the draft alone: tell Claude in the first session which rule reply-drafter missed, ask it to fix the agent, and run it again in a new session.

Then send this in the session where you ran the agents: "Ask the inbox-sorter agent to save its list in a file called sorted.txt. Don't save it yourself." Claude should tell you the sorter can't write files, and no sorted.txt appears in the folder.

Two questions from memory

You ask the inbox-sorter to save its list as a file. Why can't it?

Its list of tools holds reading tools only, because your prompt said it can only read files. With no tool that writes, it can't save anything, however it's asked.

Why did you start a new session before you ran the agents?

A session only finds agents in a folder that existed when it started. Claude made that folder during the build, so a new session was the first one to see the two agents.

Lesson 3 opens by asking the first one again.

Does anything keep the drafter in the drafts folder?

Its instructions and your approvals. The tool that creates files works anywhere in the folder you opened, so in Manual mode you read each file name before you say yes. Lesson 5 builds a check that holds even when an agent ignores its instructions.

Course 3 so far

What you've built

Lesson 1: Gym connector
Lesson 2: Inbox agents
Lesson 3 puts an agent in your team's Slack.