Zenaique

Identify the design property that makes Claude Code's subagent feature predictable

MCQ·Medium·4.0 · 0·~1 min·Asked atDatadogFreshworksTypeface
Attempt it
TL;DR

Claude Code subagents run in a clean context with a scoped prompt and a defined return shape, so neither side can pollute the other.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine your manager hires a contractor to fix one thing. The contractor does not need to read every old email in your inbox to do the job, and the manager does not want the contractor's working notes filling up the company shared drive. The contractor gets a sealed brief, does the work in a private notebook, and hands back a one-page result. Claude Code subagents work the same way. The parent gives the subagent a tight brief, the subagent thinks privately in its own fresh context, and only its final summary comes back. That envelope of isolation is what stops chaos from leaking in either direction.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Claude Code's subagent feature is one of the cleanest illustrations of a discipline that every production multi-agent system eventually adopts: minimise what crosses the boundary between agents. The question being probed here is whether you can name that discipline and explain why it makes the feature predictable rather than just naming the feature itself.

The wrong answers are not random. They are the three most common misconceptions about what a subagent is, each one tied to a different production failure pattern. Recognising why each is wrong is the senior-level signal.

One-line summary: a subagent is a sealed envelope. The parent passes a brief in, the subagent does its work privately, and a structured summary comes back. That envelope is the whole architectural bet.

What context isolation actually means in Claude Code

The contract

When the parent invokes a subagent, the runtime sets up three things. First, a fresh conversation context that does not include the parent's running transcript. Second, a scoped system prompt that defines the sub-task. In Claude Code this is typically a markdown file checked into the project (for example .claude/agents/code-reviewer.md) so it lives with the codebase. Third, a defined return interface, usually a structured summary that the parent reads back as a tool result.

What gets passed across the boundary

The brief, which is whatever the parent writes when calling the subagent, plus tool definitions and any working files the subagent needs to read. Nothing else. The 50-turn parent session never reaches the subagent's input.

Why the design is shaped this way

Long-running coding sessions accumulate noise: half-tried fixes, dropped hypotheses, debugging chatter, irrelevant file contents loaded earlier. That noise is fine inside one agent's loop but actively harmful if it pollutes a fresh reasoning task. Isolation makes the subagent reason from facts you chose to include, not from everything that ever happened in the session.

Inbound isolation: why the parent cannot pollute the subagent
Outbound isolation: why the subagent cannot pollute the parent
The pattern beyond Claude Code, and when to skip subagents entirely
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Anthropic Claude Code ships `code-reviewer`, `test-runner`, and `debugger` subagents as built-in patterns that teams customise per project.
  • Cursor's agent mode uses a similar parent plus scoped subtask pattern for refactor and review tasks.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow would you debug a subagent that returns a bad summary without context the parent had?
A

Inspect the subagent's input bundle (system prompt plus the brief the parent passed), expand the brief with the missing facts, and consider whether the subagent's tool surface is too narrow. If the parent context is truly needed, that is a signal the work was wrongly factored out.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Assuming subagents inherit the parent chat. They do not, and that is exactly why they stay predictable across long parent sessions.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • What context isolation means in the subagent contract (fresh context, scoped prompt, defined return)

  • Why inbound isolation prevents the parent's drift from biasing the subagent

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Why AutoGen 0.4 makes TerminationCondition a first class primitive instead of leaving it to convention
Flashcard·Medium