AI Coding Subagents: How Context Isolation, Delegation, and Model Tiering Actually Work

    When an interviewer asks whether you have used subagents, the question is really about three things: whether you understand that the real bottleneck in AI coding assistants is context capacity rather than model intelligence, whether you can move exploratory work out of the main conversation, and whether you avoid trading task quality for slightly lower call costs. This article explains the problem, the mechanism, practical configuration, and the boundaries of subagents, covering read-only role definitions, least-privilege tooling, model tiering, observability, foreground versus background execution, and multi-agent parallelism.

    When an interviewer asks “have you used subagents?”, it sounds like a check on tool proficiency. In practice it tests three things: whether you understand that the real bottleneck of AI coding assistants is context capacity rather than model intelligence; whether you can strip a one-off exploration process out of the main execution path; and whether you would sacrifice task quality just to save a little on call costs. Below, this is broken down in the order of problem, mechanism, practice, and boundaries.

    1. The Contradiction: Process Artifacts Are Eating Your Context

    When you use an AI coding tool for anything moderately large, you almost always hit the same phenomenon. Ask it how a feature is wired together, and it will search for keywords, read config files, walk the call chain, and run the tests to check the logs. By the time it gives you the answer, your main conversation has accumulated several screens of content you will never look at again: a dozen file fragments, a handful of meaningless search hits, a few stack traces.

    The key is to understand the nature of context. First, it is a finite, shared resource: when the input side is filled with process artifacts, less room is left for actual reasoning. Second, it decays strongly: information further back usually carries less weight in reasoning, so those early screens of search results not only fail to help but keep raising the cost of every request. Third, it is replayed repeatedly: the longer the history, the larger the wasted overhead per turn. Put together, you get a counterintuitive result: the longer you chat and the more you explore, the more confused the assistant becomes.

    So “context management” is not a trick; it is an architectural problem. Subagents cut in precisely at this contradiction.

    2. What a Subagent Really Is: Isolating Exploration in a Separate Window

    A subagent can be understood as a separate assistant instance dispatched to handle a specific class of task. Three differences from the main conversation matter most: it has its own independent context window; it has its own configured role and behavioral constraints; and it has its own restricted set of available tools. When the main assistant encounters a matching task, it delegates the work. The subagent does the exploring inside its own window and finally returns only a conclusive summary to the main conversation.

    The payoff is direct. Suppose you want to figure out which layer the authentication logic lives in within an unfamiliar project. With inline execution, the contents of dozens of files enter the main conversation in full. With delegation, the subagent reads those files, and all that comes back to the main conversation is two or three lines of conclusion; the file contents never enter at all. The noise of exploration stays on the subagent’s side, and only the conclusion crosses the boundary.

    This leads to three general criteria:

    • Task nature: any work that produces a large amount of “intermediate output you will never look at again” is a candidate for delegation: repository-wide search, log and build output analysis, a survey of the current state before a bulk refactor, mapping cross-module impact.
    • Structural nature: tasks whose output is highly convergent and can be expressed as a short piece of text or a small structure are the best fit for delegation, because the handoff cost is lowest.
    • Frequency: if you repeatedly dispatch the same kind of work with the same instructions, it should be solidified into a resident role with a clear responsibility rather than described ad hoc every time.

    3. Practical Details: Constraints, Tiering, and Observability

    Once you understand the concept, what really determines results is how you configure it. This breaks down along four dimensions.

    3.1 Establish Role and Read-Only Constraints at the Prompt Layer

    A subagent’s role definition is written in its own role description, usually placed in a project-level or user-level role directory, defined once and reused across projects. A commonly overlooked practice: explicitly state in the role description that “no files may be modified; output only localization conclusions and the evidence behind them,” instead of expecting tool permissions to cover everything. Prompt-layer constraints and permission-layer constraints are complementary: the former governs intent, the latter provides the fallback.

    An example of a read-only review role:

    1. Name: readonly-auditor
    2. Responsibility: read-only review of code and configuration; modifies no files
    3. When to use: when you need to locate problems across multiple modules or assess impact
    4. Workflow:
    5. 1. Use search capabilities first to narrow the candidate set; do not read the whole repository
    6. 2. Once key locations are found, excerpt only the minimum necessary fragments
    7. 3. Output a structured conclusion: conclusion / evidence locations / open questions
    8. Constraints:
    9. - No write or commit operations of any kind
    10. - Do not output full file contents; output path and line-level references only
    11. - If information is insufficient, list explicitly what is missing; make no speculative assertions

    3.2 Minimize Tools and Permissions

    The tool set given to a subagent should be “just enough.” A role dedicated to search, summarization, and review does not itself need change, release, or commit capabilities. Narrowing permissions brings two benefits: it reduces the risk of accidental operations, and it narrows the role’s behavioral space, which also lowers the divergence of its output. The test is simple: if a role should never write files, do not give it the means to write.

    3.3 Tier Models, and Use Cheaper Capability in the Right Place

    Tasks of different complexity differ enormously in what they demand of a model. Search and localization, formatting and organization, and bulk classification can be handled by a smaller, faster, cheaper model. Architecture trade-offs, cross-module refactoring design, and root-cause inference for difficult defects require the strongest model. The principle of tiering is not “save wherever possible” but matching stronger and weaker capability to task difficulty: use a weak model for a hard task, and the money you saved comes back as rework.

    3.4 Add Observability

    Delegation is inherently opaque: the main conversation cannot see what the subagent did. So the handoff format must be pinned down, otherwise you get an unverifiable narrative. Workable practices include: requiring conclusions to carry evidence locations; requiring a distinction between “confirmed” and “inferred”; and requiring a reproducible verification method for key conclusions (which command, which test). The definition files in the role directory, along with run logs and operation records, are themselves auditable evidence; when troubleshooting, go back to those rather than reconstructing from memory.

    4. Foreground, Background, and Multi-Agent Coordination

    A single subagent solves “isolation”; multiple agents solve “parallelism.”

    Foreground execution is characterized by a visible process and the ability to intervene at any time, which suits exploratory tasks with an undecided direction that you need to watch and adjust as you go. Background execution keeps the main conversation unblocked, which suits clearly scoped, time-bounded bulk work, such as a style-consistent refactor or a survey of the current state at scale. The deciding factor is the task’s uncertainty: if it is uncertain, keep it in the foreground; if it is certain, send it to the background.

    Going further, multiple agents can divide the work and run in parallel. One easily overlooked prerequisite must be stressed here: the benefit of parallelism only materializes when the task can be cleanly split. Two agents modifying the same batch of files will have conflict costs that quickly eat the parallel gains. So the practical split is usually “by scope” rather than “by stage”: different modules, different directories, and different test suites each owned by one agent; or one agent handles exploration and localization while another does independent review, forming cross-validation. Paired with this is a convergence step: results from all branches must be aggregated into a single conclusion with an explicit way to handle conflicts, otherwise you have merely turned serial chaos into concurrent chaos.

    5. Subagents Are Not a Cure-All: Boundaries and Costs

    Being able to articulate the boundaries in an interview demonstrates more depth than listing only the advantages. Subagents carry at least four kinds of cost:

    • Lossy handoff. A subagent cannot see the full intent of the main conversation, and your original goal can be distorted after a single retelling. So a delegation instruction must be written as a self-contained task description, including background, scope, and expected output format, rather than a vague “take a look at this.”
    • Isolation means information goes out of sync. The subagent does not know the preferences you add later, and the main conversation does not know where it made a trade-off. Work with tight coupling that needs back-and-forth confirmation is often faster inline.
    • Repeated exploration gets amplified. Multiple subagents each exploring the same code from scratch is pure resource waste. In a stable project, persisting exploration results as documentation or a structured index pays off far more than delegating repeatedly.
    • Extra latency and complexity. A single delegation means at least two rounds of interaction plus one context reassembly; wrapping a simple task in this machinery is over-engineering.

    So the final decision framework compresses to one sentence: when a side task floods the main conversation with large amounts of intermediate output you will never look at again, delegate it; when that kind of work recurs in a stable form, solidify it into a role; when the task itself is light, or needs frequent back-and-forth with the main conversation, just do it inline.

    6. How to Layer the Answer in an Interview

    Back to the original question, a well-layered answer is organized roughly like this: first make clear that subagents solve context isolation and task convergence, not “spin up several more assistants”; then cover the three configuration dimensions of role definition, tool minimization, and model tiering, explaining how you control cost and risk; next give the applicable conditions for foreground versus background execution and multi-agent parallelism, and proactively point out that parallelism requires the task to be splittable; finally add the pitfalls you have hit: lossy handoff, repeated exploration, over-engineering, and how you mitigate them with structured output agreements and persisting results. Cover all four layers, and you have essentially answered what the interviewer wanted to know.