Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Running Tasks in Parallel | Section
Introduction to Claude Code

Running Tasks in Parallel

Sveip for å vise menyen

Subagents allow Claude Code to delegate specific tasks to separate agents while the main conversation remains focused on the overall workflow. Each subagent completes its assigned work independently and returns only its results and a summary to the primary agent.

This helps reduce unnecessary context in the main conversation. Research, tool calls, intermediate files, and detailed reasoning from each task remain inside the relevant subagent instead of filling the primary context window.

Subagents can also run independent tasks in parallel. In this example, Claude is asked to complete an entire outreach workflow:

  • Find five new dental practice leads;
  • Use the lead-scraping skill to verify and save them;
  • Generate a personalized website mockup for each lead;
  • Draft an outreach email for every prospect;
  • Save the completed messages as Gmail drafts.

The primary agent acts as the coordinator. It reviews the available skills, determines which tasks depend on earlier results, and decides which steps can happen simultaneously.

For example, several subagents can search for leads at the same time. After the leads are reviewed and approved, Claude can start a separate mockup-generation subagent for each prospect. Once the mockups are ready, the email drafts can be created.

You can monitor these agents through the background tasks panel. It shows which tasks are running, how long they have been active, and how many tokens they are using. You can also open an individual task to review its conversation.

Different models may be assigned based on task complexity. A more capable model can handle difficult creative or technical decisions, while a faster model can complete predictable tasks. This helps balance quality, speed, and token usage.

Subagents are most useful when a workflow contains several clearly defined tasks, especially when some of them can run independently. Instead of completing every step one at a time, Claude can coordinate the process and produce several finished results in parallel.

question mark

What is the main role of the primary agent when using subagents?

Velg det helt riktige svaret

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 15

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Seksjon 1. Kapittel 15
some-alt