---
title: "Subagent with its own context window pattern for AI agents | Agentic Pattern Language"
description: "Send a side task to a subagent with a fresh context window; only its short summary comes back. Sourced from Anthropic, LangChain, and Cognition."
url: https://agenticpatternlanguage.com/patterns/subagent-own-context-window/
---

13 [Systems of agents](https://agenticpatternlanguage.com/#systems-of-agents)

# Subagent with its own context window

Send a side task to a subagent with a fresh context window; only its short summary comes back.

Also called Context isolation, Context quarantine, Sub-agent architectures

![](https://agenticpatternlanguage.com/_astro/cognition.ai.5FRYKL0B_1jiH7C.webp) Anthropic, LangChain, Cognition, Cursor

[How to read this](https://agenticpatternlanguage.com/notation/)

## Part of

* [Orchestrator and workers](https://agenticpatternlanguage.com/patterns/orchestrator-workers/)
* [Agent loop](https://agenticpatternlanguage.com/patterns/agent-loop/)

## Alternatives

* [Compaction](https://agenticpatternlanguage.com/patterns/compaction/)
* [Structured note-taking](https://agenticpatternlanguage.com/patterns/structured-note-taking/)

## The problem

A side task such as a search or a test run would fill the main context with output used once.

> Running tests, fetching documentation, or processing log files can consume significant context.

Anthropic [Create custom subagents](https://code.claude.com/docs/en/sub-agents)

> Codebase exploration generates large intermediate output that would bloat the main context.

Cursor [Subagents](https://cursor.com/docs/subagents)

## Therefore

> Each subagent might explore extensively, using tens of thousands of tokens or more, but returns only a condensed, distilled summary of its work (often 1,000-2,000 tokens).

Anthropic [Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) Sep 29, 2025

> Subagents are specialized AI assistants that Cursor's agent can delegate tasks to. Each subagent operates in its own context window, handles specific types of work, and returns its result to the parent agent.

Cursor [Subagents](https://cursor.com/docs/subagents)

> Delegating tasks to subagents is one effective way that an agent can manage its own context. Subagents provide context isolation, so that the details of individual tasks can be withheld from a supervisor agent’s context window.

LangChain [Organizing Context in a Multi-Agent Harness](https://www.langchain.com/blog/organizing-context-in-a-multi-agent-harness) Sep 8, 2026

## In use

Claude Code

> Claude delegates to Explore when it needs to search or understand a codebase without making changes. This keeps exploration results out of your main conversation context.

Anthropic [Create custom subagents](https://code.claude.com/docs/en/sub-agents)

Cursor

> Cursor includes two built-in subagents that handle context-heavy operations automatically. These subagents were designed based on analysis of agent conversations where context window limits were hit.

Cursor [Subagents](https://cursor.com/docs/subagents)

Claude Research

> Subagents facilitate compression by operating in parallel with their own context windows, exploring different aspects of the question simultaneously before condensing the most important tokens for the lead research agent.

Anthropic [How we built our multi-agent research system](https://www.anthropic.com/engineering/multi-agent-research-system) Jun 13, 2025

## Where it breaks

The subagent starts without the main agent’s context, so it can redo work or miss what matters.

> The subtask agent lacks context from the main agent that would otherwise be needed to do anything beyond answering a well-defined question.

![](https://agenticpatternlanguage.com/_astro/cognition.ai.5FRYKL0B_nfciS.webp) Cognition [Don’t Build Multi-Agents](https://cognition.ai/blog/dont-build-multi-agents) Jun 12, 2025

> A subagent doing a simple task may be slower than the main agent because it starts fresh.

Cursor [Subagents](https://cursor.com/docs/subagents)

> subagents may redo context-gathering operations, like file reads, already done by the supervisor.

LangChain [Organizing Context in a Multi-Agent Harness](https://www.langchain.com/blog/organizing-context-in-a-multi-agent-harness) Sep 8, 2026

## Sources

1. [Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) Prithvi Rajasekaran, Ethan Dixon, Carly Ryan, and Jeremy Hadfield, Anthropic, Sep 29, 2025
   > Sub-agent architectures provide another way around context limitations.
2. [Organizing Context in a Multi-Agent Harness](https://www.langchain.com/blog/organizing-context-in-a-multi-agent-harness) Thushanth Bengre, Chester Curme, LangChain, Sep 8, 2026
   > Subagents provide context isolation, so that the details of individual tasks can be withheld from a supervisor agent’s context window.
3. [Don’t Build Multi-Agents](https://cognition.ai/blog/dont-build-multi-agents) Walden Yan, Cognition, Jun 12, 2025
4. [How we built our multi-agent research system](https://www.anthropic.com/engineering/multi-agent-research-system) Jeremy Hadfield, Barry Zhang, Kenneth Lien, Florian Scholz, Jeremy Fox, and Daniel Ford, Anthropic, Jun 13, 2025
5. [Subagents](https://cursor.com/docs/subagents) Cursor
6. [Create custom subagents](https://code.claude.com/docs/en/sub-agents) Anthropic
7. [Subagents (Deep Agents)](https://docs.langchain.com/oss/python/deepagents/subagents) LangChain
   > Subagents are useful for context quarantine (keeping the main agent’s context clean) and for providing specialized instructions.

Added Nov 14, 2026
