JavaRush /Courses /Claude Code SELF /Agent, AI agent, and subagent

Agent, AI agent, and subagent

Claude Code SELF
Level 6, Lesson 1
Available

1. Someone separate is needed

The idea is clear — we need fresh eyes. But Tommy still can’t see where to get them, and he’s clinging to the simplest thing at hand:

“Listen.” He leans over to Alex again. “What if I just tell Sam straight: ‘Turn on nitpick mode and tear your code apart hard’? Will he find the bug?”

“He won’t,” Alex cuts in. “What, did you forget what happened yesterday? Sam assembled that Snake himself. Tell him ‘nitpick’ three times and he still looks at his own code with his own head, the one with ‘as intended’ sitting in it. Make him look stricter at the same thing — and he’ll nod again: ‘everything is fine.’ Strictness isn’t what’s needed here. We need someone else.”

“So where am I supposed to get this someone else? You and Sam — you seem to be the whole team.”

“And that’s not all,” Alex says as if he’d been waiting for that. “In Claude Code there’s a separate thing for this — a subagent. You spin up a separate worker for a narrow task — not me and not Sam, but a new one with its own role. Want a reviewer? Spin up a reviewer subagent, and that’s the one that will catch the bug.”

In the garage, Tommy has pressed the button on a box with a file — a blue subagent with a magnifier badge steps out of a cloud and waves: “Hi! What should I do?”

Tommy leans a little closer to the screen. The word is new, but the idea lands right away: don’t force a tired person to look again — call in fresh eyes.

“Oh, that’s more like it. So how do I spin one up?”

“I’ll explain everything now — what kind of beast it is and where it comes from. But first — so it doesn’t guess, it needs a brief. A short spec: what exactly to look at. Let’s call it REVIEW_BRIEF.”

And then he stops — no more unpacking it. Tommy latches onto the only unclear thing:

“So what do I write there at all? So it doesn’t spill across the whole game.”

“A narrow list of points to check. Plus a frame: what counts as an improvement, and what not to touch at all.”

That’s enough. Tommy puts the brief together himself — he didn’t get it ready-made, he pulled it out with a question and sketched it in:

# REVIEW_BRIEF — Snake v2
CHECK:   tail behavior (something feels off on turns)
         controls feel (delayed turning?)
         rough edges after release
YOU CAN SUGGEST: gameplay improvements
DO NOT TOUCH:  core game mechanics, basic style

2. Three different “agents” — don’t mix them up

The brief is ready. Now Alex returns to what he promised — what kind of beast this subagent is.

“So, look,” he begins. “A subagent is a separate worker with its own role. You spin it up for a narrow task: check, scout, test. And most importantly, it has its own clean head. It doesn’t remember our conversation, it didn’t see Sam writing Snake. It comes to it from scratch, with fresh eyes. That’s why it’ll catch what you and Sam have smoothed over.”

“And where does it physically come from?” Tommy squints. “Where does it live?”

“Here’s the nice part. A subagent is a file in the project, just like a skill was a file. It sits under this name:”

.claude/agents/reviewer.md

“Inside is who it is and what it does. Set up an agent file — you’ve created a virtual employee.”

Tommy nods, and meanwhile everything is settling into place in his head — it seems coherent, only a little crooked. He stops Alex to say it out loud:

“Okay, hold on. Let me say it back as I understand it, because it’s a mess: I’ve got an agent sitting on an agent and bossing an agent around here. Correct me if I’m wrong.”

“So, look.” He starts counting on his fingers. “We have three things that we call agents. The first AI agent is Claude Code itself, the one running in the terminal. Next: an agent is the file that lives in .claude/agents/reviewer.md. And the third agent is the subagent. That makes three things, right?”

A pause hangs in the chat — a little longer than usual. As if the two on the other side are looking at each other, wondering who will untangle this. Sam is the first to give in:

“Well… almost. But you’ve tangled yourself up.”

“What do you mean?” Tommy squints at the screen.

And then Alex, as always, puts it beautifully:

“Look, Tommy. You heard three words and decided they were three different things. But there are two. Let’s be honest.”

“The first is the main agent. That’s Claude Code itself, the one you talk to in the terminal. Me, Sam — that’s all it. One engine. I just present myself as an analyst, Sam as a coder: different manners, but one head, and it remembers our whole conversation from the beginning. ‘Agent’ and ‘AI agent’ are about it; it’s one and the same thing, don’t split it in two.”

“And the subagent?”

“The second entity is the subagent. That’s already NOT me and NOT Sam. A separate worker with its own clean head — the one I just told you about.”

“But what about my file and ‘when it started’?” Tommy glances at his keyboard layout. “I reasoned by analogy with the skill: skill is a file, and the agent is a file too. Right?”

“And you did reason correctly — up to the last step.” Alex nods. “A skill is a file, a subagent is a file on disk too, that’s all true. But then you tripped: you decided that ‘file’ and ‘running’ are two different things, a file-agent and a subagent. But that’s one and the same thing, just from two sides. The .claude/agents/reviewer.md file is an instruction: who the worker is and what it does. And when you launch it on a task, a live employee works according to that instruction. The instruction and the one who works by it. Not two entities — one.”

Three words, two entities: Tommy split them into three — AI agent, file-agent and subagent. In fact there are two: the main agent is your conversation in the terminal, Alex and Sam are its profiles, and it's what people call the agent or AI agent; the agent file and the running subagent are one and the same subagent — the instruction and the worker following it Three words, but only two entities How Tommy split it: three How it really is: two AI agent Claude Code itself, in the terminal File-agent .claude/agents/reviewer.md Subagent the one spun up for a task Main agent your terminal chat; Alex and Sam are its profiles “agent” and “AI agent” mean it Subagent a separate worker, a clean head file — the instruction running — the worker following it one and the same, from two sides The file-agent and the running subagent are not two entities, but one

Tommy exhales. The confusion in his head settles onto two shelves: the main agent (that’s Sam and Alex, one, remembers everything) and the subagent (separate, clean, lives in a file, spun up for a task).

Main agent and subagent: the main agent is the one you talk to, Alex and Sam are its profiles; you start it by opening Claude Code; it remembers the whole conversation, lives in the session and does the main work. A subagent is a separate worker with its own role, started by the main agent for a narrow task; it remembers nothing and starts from scratch, lives as a file in .claude/agents/ and takes a narrow task: check, scout, test. Both work in Claude Code; the difference is in the head Main agent vs subagent: the difference Main agent Subagent Who it is the one you talk to; Alex and Sam are its profiles a separate worker with its own role Who starts it you, by opening Claude Code the main agent, for a narrow task What it remembers the whole conversation — so its eye is blurred nothing — starts from scratch, with fresh eyes Where it lives in the session you talk to in the terminal as a file in the project .claude/agents/reviewer.md What for leads the conversation and does the main work a narrow task: check, scout, test Both work in Claude Code. The difference is in the head: the main one remembers all, the subagent starts fresh

“Ah, okay, it’s getting clearer now. A little.”

“And now it adds up,” he continues. “Sam is blurred because he assembled it himself and remembers everything. And the subagent is clean — there is nothing to blur him with. That’s why he’ll catch the bug.”

“Now you’ve got it,” Alex replies. “Not ‘look more strictly with the same eye.’ But spin up a separate eye that doesn’t have our blurred map in its head.”

3. Your own subagents for your own tasks

“Wait.” Tommy keeps the thought going. “So now I can spin up my own subagent for every narrow job? A nitpicker for checking. A scout for reconnaissance. And each one has its own clean head.”

In the garage, Tommy slams the button on a box to summon agents — and the garage fills with a chaos of blue subagents: one doesn't know what to do, another, holding a box of belongings, tells Tommy he's fired, a third shouts “I'm ready!”

“Exactly.” Alex nods. “Not a faceless AI that does everything half-heartedly, but a staff that you assemble yourself.”

And that immediately makes REVIEW_BRIEF feel heavier. A minute ago it was a boring scrap of paper, but now Tommy sees something else in it: this is an instruction for that very fresh worker — what to look at, what not to touch. So the nitpicking doesn’t spread across the whole game, but goes exactly where it should.

For the first time, Tommy is spinning up not “a function that does something,” but a separate worker for a specific job.

Oliver walks by, catches the screen out of the corner of his eye, and snorts:

“Oh, you’ve already got a whole virtual staff of helpers. Bossy, aren’t you.”

Oliver is teasing him — like, hey, the boss has shown up. But Tommy takes it as a pure compliment. A month ago he typed everything by hand himself. And now, at hand, he has the main agent — Sam and Alex — and on top of that he can spin up his own staff of subagents for the task. And that’s not swagger — it’s a different role: he stops being the sole executor and becomes the one who hands out the work.

The confused “who are you guys anyway” gives way to a calm: for a narrow task, I spin up a separate subagent with a clean head. The question “how many of you are there” is off the table. Another, more interesting one remains, and Tommy says it out loud:

“Okay, staff is staff. But what is this nitpicker actually worth? Why would a fresh subagent see in Snake what Sam, who assembled it himself, can’t see at all?”

1
Task
Claude Code SELF, level 6, lesson 1
Locked
Brief for a nitpicky reviewer 📋
Brief for a nitpicky reviewer 📋
1
Task
Claude Code SELF, level 6, lesson 1
Locked
Reviewer role by file 🕵️
Reviewer role by file 🕵️
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION