Zenaique

Identify the consistent shape behind Devin, OpenHands, and Claude Code subagents

Flashcard·Medium·4.0 · 0·~30s·Asked atInfosysNykaaStability Ai
Attempt it
TL;DR

All three ship a strong primary agent with a rich tool surface plus bounded subagents for scoped subtasks; what differs is the autonomy boundary and whether subagents are user-invoked or implicitly spawned.

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

Picture a senior engineer leading a project. The senior keeps the plan in their head and does the harder work themselves. When a small, well-defined piece comes up (read this file, run this test, format this code), the senior delegates to a junior, gives them a clear scope and a deadline, and uses the result. The senior does not run a committee meeting where five juniors argue about every decision; that would be slow and confusing. Devin, OpenHands, and Claude Code subagents all use the same senior plus juniors shape. The differences come from how independent each tool lets the senior be, and from whether you the human get to spawn juniors directly or only the senior can.

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.

Devin, OpenHands, and Claude Code's subagent feature look like three separate product bets, but underneath they ship the same architecture. Each has a single strong primary agent with a rich tool surface, and each lets that primary spawn bounded subagents for scoped subtasks. The convergence is not coincidence; it is the equilibrium the field reached after the 2024 wave of flat-council and debate-ensemble experiments demonstrated that coordination cost dominates substantive work at production scale.

This deep dive walks the shared architectural shape, explains why context isolation is the load-bearing reason subagents exist, lays out the autonomy-boundary axis that distinguishes the three products, and closes with the operational discipline (per-subagent observability) that turns the pattern from a demo into a debuggable production system.

The shared shape in detail

The primary agent owns the overall task and the long-horizon plan. It has a large tool surface: shell, file editor, browser, search, planner, file system operations. It runs the main loop: read the current state, decide the next action, call a tool, observe the result, update the plan, repeat. The primary is the single source of truth about what the agent is trying to accomplish, and any human-facing reporting goes through it.

Subagents are fresh agent instances spawned by the primary for bounded units of work. Each subagent gets a focused task description, a smaller tool surface (often just one or two tools), and explicit budgets (max turns, max tokens, max wall-clock). A subagent runs in its own context window, isolated from the primary's growing trajectory. When the subagent finishes, it returns a structured result (typically a short summary plus optional structured data) and the primary integrates it.

The fan-out is bounded by design. The primary has a budget for how many subagents can run in parallel (often 2-5) and a queue for serial spawning beyond the parallel cap. Each subagent's tool surface is a subset of the primary's. This is the difference between controlled fan-out and the unbounded swarm pattern that produced cost runaways in earlier multi-agent demos.

Return-value structure matters. A subagent that returns free prose forces the primary to spend tokens re-parsing it. A subagent that returns a structured object (JSON, Pydantic) integrates cleanly and supports per-field observability. The structured return is part of what makes the pattern production-ready.

Context isolation as the load-bearing reason
The autonomy-boundary axis: where the three products differ
Why flat-council architectures lost
Operational discipline: per-subagent observability
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.

  • Devin from Cognition AI runs long-horizon coding sessions with a primary agent and implicit subagent spawning for scoped subtasks.
  • OpenHands (the open-source successor to OpenDevin) ships the same primary plus subagents pattern with a more interactive local-dev orientation.
Sign in to see more production examples.

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

QWhy does context isolation matter so much that it justifies the cost of spawning a fresh agent?
A

Long sub-tasks (parse a giant file, run a test sweep, do a directory scan) generate hundreds of intermediate tool-call results that are noise relative to the primary's plan. If those intermediates land in the primary's context, they push the relevant plan tokens toward the lost-in-the-middle zone and degrade later decisions. A subagent absorbs the noise in its own context and returns only the structured result the primary needs.

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

Reading these systems as flat councils where many peer agents debate, when they are actually primary plus bounded subagents systems with controlled fan-out.

Sign in to see all red flags and common mistakes.

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

  • State the shared architectural shape across Devin, OpenHands, and Claude Code

  • Name the bounding mechanism that prevents subagent spawning from running away

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