Skip to content
The 31 guidesFREN中文
Guides
Part 4 · guide 2 of 8 Level: Intermediate Reading time: 14 min

Agents in the service of a project

Concretely, what is an agent good for in a real project? Code review, research, parallel execution, tasks that run on their own. The patterns that change how you work.

In this guide
  1. 01Four ways to use it day to day
  2. 02Multi-agent: divide to rule better
  3. 03Agents that run on their own
  4. 04How to use it well
  5. 05Frequently asked questions

In short

In a real project, a coding agent plays four roles: it implements a feature, reviews a diff (Claude Code ships /review and /security-review out of the box), digs through a codebase to bring back the answer, and applies repetitive changes everywhere. On a big job, an orchestrator splits the work across parallel sub-agents, at the cost of a heavier bill. In every case: a scoped task, context written in a memory file, autonomy set to the stakes, and a systematic review of the result.

Do this first: Setting up your agents

You know what an agent is and how it loops. But as long as we stay at “it wrote me a function”, we miss the point. The real click comes the day you stop seeing the agent as autocomplete++ and start seeing it as a teammate you point at a bounded task. Then it’s no longer a gadget: it changes how you work. And all the value rests on a few patterns: ways of using it that we’ll go through one by one.

Four ways to use it day to day

An agent isn’t one thing. It’s a role you assign to it. Depending on what you ask, the same tool becomes four different teammates.

The doer

The daily bread. You describe a feature in plain English, “add an endpoint that returns the 10 latest articles, with pagination and a test”, and the agent implements it: it reads the existing code to align with your conventions, writes the function, writes the test, runs it, fixes if it breaks. You, you review the diff. You’ve gone from “the one who types” to “the one who validates”. It’s 80% of your usage, and that’s already huge.

The reviewer

This one we forget too often. Instead of asking the agent to write, you ask it to review: it takes your diff and goes through it with a fine-tooth comb, logic bugs, a secret forgotten in a commit, a silent regression, an unhandled edge case. It’s a tireless second pair of eyes, one that never gets weary at 6 p.m. on a Friday. Claude Code ships this out of the box, nothing to install: /review (an alias of /code-review) goes through the current diff looking for bugs, and /security-review combs your branch’s changes for security flaws, injections, authentication, data exposure. We cover the method in Review, audit, secure. A dedicated reviewer catches what your eye, tired from writing the code, no longer sees.

The researcher

“Where is authentication handled in this project?” “How does this lib actually do its caching?” Instead of opening 40 files by hand, you send an agent to dig, your codebase, the docs, the web, and it brings back the answer, minus the pile of files. It’s an explorer that reads fast, keeps the essentials, and summarizes them for you. You keep your focus for deciding, it does the grunt work.

The cleaner-upper

Renaming a variable across 60 files. Migrating from an old API to the new one everywhere. Updating dependencies and fixing what breaks. These tasks are repetitive, mechanical, mind-numbing for a human, and perfect for an agent that doesn’t tire and doesn’t skip a line out of distraction. You describe the transformation once, it applies it everywhere, methodically.

Multi-agent: divide to rule better

For a small job, a single agent is plenty. But on a big undertaking, auditing a whole codebase, leading a deep migration, a single agent eventually chokes: its context fills with a thousand details, it loses the thread, it confuses files. The answer is orchestration. A lead agent splits the work, delegates pieces to several sub-agents that work in parallel, each with its own clean context, then gathers their feedback and synthesizes.

Lead Orchestrator agent splits the task, dispatches, synthesizes
delegates in parallel
  • Sub-agent 1 · its own context Research reads the docs, the web
  • Sub-agent 2 · its own context Code writes the feature
  • Sub-agent 3 · its own context Review hunts for bugs
Each has its own context: more work done without saturating a single window.
An orchestrator splits the job and delegates to a fleet of sub-agents, research, code, review, that work in parallel, each with its own context. The orchestrator synthesizes the feedback.

Why is this better than one big agent? Three concrete reasons:

  • Clean context per task. The sub-agent looking for where auth lives doesn’t need to know how rendering is done. Each one keeps a clear head, focused on its piece. No pollution, no confusion.
  • Parallelism. Three sub-agents combing through three corners of the code at once is three times faster than one waiting in line. On an audit, that counts.
  • Cross-checking. A sub-agent verifying another’s work means fewer mistakes. The code goes through one head, the review through another, exactly like a real team where nobody signs off on their own work.

This is precisely how a workflow (or a “fleet”) of agents tackles a security audit or a big migration: an orchestrator, specialists, a synthesis. Claude Code ships a ready-made pattern for it: /batch followed by an instruction studies the codebase, splits the change into independent units, shows you the plan, then launches one sub-agent per unit, each in its own git working copy (a worktree).

Agents that run on their own

So far, you launch the agent and you wait. But an agent can also run in the background or on a schedule, without you sitting there. An automatic PR review every morning before you arrive. A tech watch that summarizes the day’s news. A monitor that watches a service and pings you if it goes off the rails. This is where the mini-machine truly comes into its own: a small PC that never sleeps, with an agent working while you live your life. We dig into all this in the next guide, for now, just remember it’s possible.

How to use it well

The patterns are the what. Here’s the how, five reflexes that make the difference between an agent that helps you and one that wastes your time.

0 of 5 steps done Your ticks stay in this browser.

  1. Bound the task

    An agent shines on the precise and flounders on the vague. “Redo the frontend” sends it in circles; “add a sort button on the date column, like the one on the name column” puts it on rails. The more framed your request, the better the result. That’s the whole point of Framing a task with an LLM.

  2. Give it the context

    The agent doesn’t know your project by heart. Give it the conventions, the pitfalls, the architectural choices, once and for all, in a memory file it rereads every session. See Memory files. A well-briefed agent does in one shot what a blind agent fails at three times.

  3. Choose the right level of autonomy

    Sensitive task or kickoff of a session? You validate every move. Reversible refactor covered by tests? Let it run and review at the end. Autonomy is a dial you turn notch by notch, according to the stakes.

  4. Review the result. Always.

    Even when it’s green, even when it compiles. The agent may have “succeeded” at the task by taking a shortcut you wouldn’t have, or by breaking something elsewhere. You remain the last filter. It’s your name on the commit.

  5. Capitalize

    What works once and you’ll do ten more times, a quality check, a deployment procedure, a review format, turn it into a skill. You codify the know-how once and for all, and all your future agents benefit. See Skills.

Frequently asked questions

When should you run several sub-agents instead of a single agent?

On big jobs, such as auditing an entire codebase or migrating a whole repo. A single agent then ends up filling its context with details, loses the thread and mixes up files. For a small job like fixing a bug, one agent is still the right choice: each sub-agent burns its own tokens, and a fleet of five agents costs five times as much.

What does Claude Code's /batch command do?

Followed by an instruction, it studies the codebase, splits the change into independent units and shows you the plan. It then launches one sub-agent per unit, each in its own git working copy, called a worktree. It's a ready-made pattern for spreading a big change across several agents working in parallel.

Why does splitting work across several agents give better results?

Each sub-agent keeps a clean context focused on its own piece of the task, without being cluttered by the rest. Several sub-agents searching different corners of the code at the same time go faster than one working through them in turn. And when one checks another's work, there are fewer mistakes, just like a team where nobody signs off on their own work.

Can an agent work while I'm away from the screen?

Yes. An agent can run in the background or on a schedule: an automatic review of pull requests every morning, a tech watch summarising the day's news, monitoring that alerts you when a service goes wrong. A machine that stays on day and night, like a mini-PC, is the ideal host for this kind of work.

How do you turn a procedure you keep repeating into a reflex for the agent?

Codify it as a skill. A quality check, a deployment procedure or a review format you redo again and again gets written down once in that form. All your future agents then benefit from that know-how without you having to explain it again.

Terms in this guide: AgentCommitClaude CodeAPIOrchestratorSub-agentGit

Spotted a mistake?

A command stopped working, a price changed?

Tools change every month. Tell me what is wrong in this chapter and I will fix it and update its date.

Only the page, your message and the optional contact are kept. Nothing else.

Guide 20 of 31 · part 4 no guides read yet Open the list of guides