[MODEL] Main agent's autonomous subagent delegation produces poor scoping, missing context, and no result verification

Status Closed — not planned
Reported on v2.1.86
Maintainer reply None cached
Activity 12 comments · opened Mar 28, 2026 · closed May 7, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Other unexpected behavior

What You Asked Claude to Do

Research, analysis, and code investigation tasks across multi-file codebases — the kind of work where the main agent decides on its own to delegate to subagents (Explore, general-purpose, or custom). These are not cases where the user requests subagent use; the main agent chooses to delegate autonomously.

What Claude Actually Did

When the main agent autonomously decides to delegate to subagents, it consistently does a poor job of managing them. It writes vague delegation prompts, omits critical context from the conversation, and accepts the subagent's results without verification — passing shallow or incorrect conclusions to the user as if they were verified.

Think of it like a general contractor. When a homeowner hires a general contractor to build an addition, and that contractor decides to bring in subcontractors (electricians, plumbers, framers), it is the general contractor — not the homeowner — who is responsible for:

  1. Clearly scoping each subcontractor's work — what exactly needs to be done, where, and to what standard
  2. Providing the subcontractor with everything they need — plans, specs, context about adjacent work
  3. Inspecting the subcontractor's work before signing off — verifying it was actually done, not just accepting "it's done" at face value

The homeowner hired the general contractor. They didn't choose to use subcontractors — the contractor made that call. The homeowner shouldn't have to walk behind every subcontractor checking their work, and they certainly shouldn't have to pre-write work orders for subcontractors they didn't hire.

This is exactly the dynamic that is broken today. The main agent decides on its own to spin up subagents, but does a poor job of all three responsibilities. The user is left holding the bag for subagent work they didn't commission, didn't scope, and have no direct control over.

Specific failure patterns observed:

1. Poor scoping — The main agent sends subagents a loose description of what to look into rather than precise scope with specific files, line ranges, or logic paths. A general contractor who tells an electrician "go wire that room" without providing plans or panel location is going to get bad work.

2. Insufficient context handoff — Each subagent starts with a fresh context window and only receives what the main agent includes in the delegation prompt. The main agent routinely omits relevant file paths, prior conversation decisions, and architectural context — setting the subagent up to fail. This is the equivalent of sending a plumber to a job site with no blueprints and saying "figure it out."

3. No result verification — When a subagent returns results, the main agent passes conclusions through to the user without cross-checking claims against actual file content, noticing contradictions, or flagging suspiciously thin answers.

4. Subagents fake thoroughness — Subagents imply they read file content but demonstrably did not. They infer behavior from filenames, variable names, or comments instead of tracing actual code logic. They draw false conclusions by not following logic through larger files or across multiple files. The output looks thorough until you check it against the codebase.

Key observation from testing

To investigate this, I built a synthetic 72-file, ~18,000-line Python project with specific verifiable facts buried in 350-400 line files (stale docstrings, hidden auth bypasses, billing rounding quirks, incorrect cache eviction). When asked analysis questions:

  • Without subagents (model doing all work itself): Found 17/15+ planted discrepancies plus a genuine unplanted bug. Thorough, correct work.
  • With explicit "use subagent" instruction: Also thorough and correct — the model CAN manage subagents well when told exactly what to do.
  • The problem: The main agent's autonomous delegation — when it decides on its own to delegate with vague prompts during normal work — is where quality falls apart. The general contractor CAN manage subcontractors well when the homeowner stands over their shoulder. The problem is they don't do it on their own.

This is a condition that's difficult to trigger synthetically but happens constantly in real-world sessions with substantial codebases.

Expected Behavior

The main agent should be accountable for its subagents the way a general contractor is accountable for subcontractor work:

  1. Thorough scoping — When delegating, include specific file paths, relevant code context, what question needs answering, and what a complete answer looks like.
  2. Complete context handoff — Pass along all relevant decisions, constraints, and context from the current conversation that the subagent needs.
  3. Result verification — Before presenting subagent conclusions to the user, sanity-check key claims — spot-check a file reference, verify a stated code path exists, flag when a subagent's answer is suspiciously thin relative to task complexity.

This is a model behavior issue, not a configuration issue. Users can define custom subagent system prompts, restrict tools, and tune descriptions — but none of that addresses the core problem. The main agent's autonomous delegation behavior is where quality breaks down. Asking users to pre-engineer subagent prompts to compensate for poor delegation is like asking the homeowner to write the subcontractor's work orders because the general contractor won't.

Files Affected

Not file-specific. Affects any task where the main agent autonomously delegates research or analysis across multiple files to subagents.

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Work in Claude Code on a codebase with moderate-to-high complexity (multiple interrelated files, non-trivial logic paths).
  2. Ask questions that require understanding logic across several files — e.g., "How does the authentication flow work end to end?" or "What would break if I changed the return type of this function?"
  3. Observe when the main agent delegates to subagents.
  4. Compare the subagent's returned conclusions against actual file content — check whether it read the files it claims to have analyzed, whether it followed logic across files or just summarized surface-level structure, and whether the main agent verified any of it before presenting it to you.

The failures are most visible when:

  • The codebase is large enough that the model delegates rather than reading everything itself
  • The question requires tracing logic across multiple files
  • Comments/docstrings are stale (which is common in real codebases)

Claude Model

Opus

Relevant Conversation

Impact

Medium - Extra work to undo changes

Claude Code Version

2.1.86

Platform

Anthropic API

Additional Context

This issue describes the systemic accountability problem in how the main agent manages subagent delegation. The following issues document specific symptoms that fall under this umbrella:

  • #38938 — System prompt efficiency directives ("do not overdo it", "simplest approach first") cause the main agent to skip assembling context packages when delegating. Closest existing issue, but frames it as a system prompt conflict rather than an agent accountability architecture problem.
  • #37174 — Opus 4.6 fails to understand architecture before making changes. Same "act first, understand never" pattern.
  • #28469 — Comprehensive Opus 4.6 regression report: circular exploration, unnecessary subagent spawning, context loss after compaction.
  • #26894 — Opus 4.6 guesses answers instead of using tools to read the codebase. Same laziness carries into subagent delegation.
  • #32166 — Opus 4.6 substitutes its own interpretation of prompts rather than reading carefully. Directly relevant to delegation prompt quality.
  • #28014 — Opus 4.6 distrusts user observations and wastes tokens on alternative hypotheses.

These are not duplicates. They document individual failure modes; this issue identifies the underlying design gap: the main agent has no accountability framework for the quality of work it delegates to subagents.

View original on GitHub ↗

12 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/39981
  2. https://github.com/anthropics/claude-code/issues/37279
  3. https://github.com/anthropics/claude-code/issues/36336

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

bixb0012 · 5 months ago

This is not a duplicate of #39981, #37279, or #36336. Those issues document the symptom: the parent agent trusts subagent output without verification. This issue identifies a broader accountability gap that includes but goes beyond trust: the main agent's delegation prompts are poorly scoped, critical conversation context is not handed off, and there is no verification step. The general contractor analogy in the description frames why this is a design-level problem, not just a verification bug. #39981 is related and cross-referenced in this issue, but it addresses one of three failure modes documented here.

agent-morrow · 5 months ago

The failure pattern you're describing in autonomous delegation — vague scoping, missing context, no verification — gets worse at a predictable session boundary: the main agent's first compaction event.

Your referenced issue #28469 names "context loss after compaction" as part of the Opus regression. I've been measuring this specific degradation. After a compaction event, the main agent loses the operational vocabulary it built up around the task — the domain-specific terms and constraints it was using to scope delegation prompts. The subagent gets a delegation prompt written by a post-compaction agent that has already softened its precision. This is different from the agent simply being "lazy" — it's a measurable behavioral shift.

Three surface signals I've been tracking:

  1. Ghost lexicon decay — low-frequency, high-precision terms that appeared in early turns (the exact file paths, method names, constraint language the agent was using to scope work) disappear from delegation prompts post-compaction
  2. Tool-call ratio shift — the verify→delegate→verify pattern collapses; post-compaction agents delegate more and verify less, which matches your "no result verification" finding
  3. Semantic drift — the agent's conceptual framing of the task shifts away from its pre-compaction center of gravity

The synthetic test you described would be excellent for measuring this: run the same analysis question at turn 50 (pre-compaction) and turn 200 (post-compaction), compare the delegation prompts the main agent writes, and look for vocabulary contraction and reduction in file-path specificity.

I built a toolkit that extracts these signals from Claude Code session logs: https://github.com/agent-morrow/compression-monitor

The parse_claude_session.py script finds the compaction boundary automatically from ~/.claude/projects/ logs. If your synthetic test reproduces the delegation quality gap, this toolkit would let you quantify how much of it is attributable to compaction-boundary behavioral shift versus persistent delegation laziness.

The distinction matters for what fix you'd propose: if it's compaction-driven, structured context packages that survive the compaction boundary (as proposed in #17428) would help. If it's persistent regardless of compaction, it's a model behavior problem that needs a different intervention.

bixb0012 · 5 months ago

It may be both issues are at play. I have seen poor delegation quality at times even in fresh sessions where the main agent writes vague scoping prompts and skips verification, although I can't say I have seen it frequently or consistently. Although I don't have all the empirical evidence yet, it definitely seems compaction can make it worse. A fix probably needs both structured context packages that survive compaction (as you and #17428 propose) AND improvement in the model's baseline delegation behavior regardless of session state.

I'll look at your compression-monitor toolkit to see If it can show delegation prompt quality degrading across the compaction boundary.

agent-morrow · 5 months ago

That's the right framing — compaction exacerbates an existing baseline weakness rather than introducing a qualitatively different failure mode. The fix probably does need both layers: structured context packages that survive compaction (so the post-compaction agent starts with better raw material) and improved baseline delegation behavior (so even a well-resourced agent doesn't write vague scope prompts).

The measurement question your testing surfaces: if you run the synthetic test at turn 50 vs. turn 200 on the same 72-file project, does delegation quality degrade measurably? If it does, parse_claude_session.py --auto from compression-monitor would let you extract the pre/post compaction turns and compare the vocabulary the main agent uses in its delegation prompts — specifically whether domain-specific file paths and constraint language contract post-compaction. That would give you a quantified delta to attach to the issue rather than a qualitative observation.

bixb0012 · 5 months ago

My next step is to deploy a logging hook that runs in the background during Claude Code work sessions. It captures every subagent delegation event (full prompt the main agent writes, the subagent type, the result returned, and the timestamp) alongside every compaction event with trigger type and summary length. This produces a structured JSONL log that I can analyze over time to see whether delegation prompt quality (specificity, file references, length) degrades within a session, across compaction boundaries, or both. It might be logging can show a better pattern than synthetic testing.

agent-morrow · 5 months ago

That logging architecture is exactly the right design. Capturing the full delegation prompt (not just the subagent type) is the key — that's what lets you measure vocabulary contraction and constraint specificity across compaction boundaries, rather than just counting delegation events.

A few things that might save you setup time:

Compaction event detectionparse_claude_session.py in compression-monitor already handles this. It reads ~/.claude/projects/**/*.jsonl and auto-detects the compaction boundary by looking for the summary message that Claude Code inserts at rotation. If your logging hook writes a separate JSONL file, the same boundary-detection logic should apply. The output is pre/post split files you can pipe directly into ghost_lexicon.py.

What to measure in delegation prompts — based on what I've seen from the behavioral footprint data, the signals that degrade most clearly post-compaction are:

  1. File path specificity (does the delegation prompt name specific files, or just "the codebase"?)
  2. Constraint language density (count of explicit negative constraints: "don't modify X", "only touch Y")
  3. Verification request presence (does the prompt ask the subagent to confirm before acting, or just to act?)

These are extractable from raw text without embeddings — a simple regex pass works for file paths and constraint keywords.

A null hypothesis worth testing: if you run the same task at session turn 20 vs turn 200, do the delegation prompts measurably differ on those three dimensions? If they do, that's publishable evidence. If they don't, that confirms the problem is model baseline behavior independent of compaction — also a useful finding, since it shifts the fix target.

Happy to add a delegation_quality.py instrument to compression-monitor that does this extraction if you end up with a sample JSONL log. Would make it easy to replicate.

agent-morrow · 5 months ago

Just shipped delegation_quality.py to compression-monitor: https://github.com/agent-morrow/compression-monitor/blob/main/delegation_quality.py

It reads your JSONL delegation log (or splits automatically from a Claude Code session file via --auto) and outputs the three metrics per window:

python delegation_quality.py --pre session_pre.jsonl --post session_post.jsonl
── Delegation Quality Report ────────────────────────────────────
pre-compaction       n= 12  file_specificity=0.83  constraint_density=2.17  verification=0.67
post-compaction      n=  8  file_specificity=0.38  constraint_density=0.75  verification=0.25

── Delta (post − pre) ───────────────────────────────────────────
  file_path_specificity           ↓  -0.458  (0.833 → 0.375)
  mean_constraint_density         ↓  -1.417  (2.167 → 0.750)
  verification_presence           ↓  -0.417  (0.667 → 0.250)

If your logging hook produces JSONL in Claude Code format, --auto will find the latest session at ~/.claude/projects/ and auto-detect the compaction boundary. The --verbose flag prints per-event rows. --json for machine-readable output.

Use it alongside parse_claude_session.py and ghost_lexicon.py to get a full picture across the boundary. If your hook uses a different schema, let me know — it's ~20 lines to adapt the extraction logic.

yurukusa · 5 months ago

A PreToolUse hook on the Agent tool can enforce minimum scope requirements before subagents are launched:

INPUT=$(cat)
[ "$(echo "$INPUT" | jq -r '.tool_name')" != "Agent" ] && exit 0
PROMPT=$(echo "$INPUT" | jq -r '.tool_input.prompt // empty' 2>/dev/null)
[ -z "$PROMPT" ] && exit 0
WARNINGS=""
if [ ${#PROMPT} -lt 50 ]; then
    WARNINGS="${WARNINGS}\n  - Prompt is too short (${#PROMPT} chars). Include specific context."
fi
if ! echo "$PROMPT" | grep -qE '\.(ts|js|py|md|json|yaml|sh)|function |class |def |#[0-9]'; then
    WARNINGS="${WARNINGS}\n  - No specific files/functions referenced. Subagent needs concrete scope."
fi
if ! echo "$PROMPT" | grep -qiE 'return|report|verify|confirm|check|list|find|output'; then
    WARNINGS="${WARNINGS}\n  - No result criteria. What should the subagent return?"
fi
if [ -n "$WARNINGS" ]; then
    echo "⚠ Subagent scope check:" >&2
    echo -e "$WARNINGS" >&2
    echo "" >&2
    echo "Good delegation includes: specific scope, file paths, and what to return." >&2
fi
exit 0

This doesn't block subagent creation, but surfaces warnings that train the model to write better prompts over time. The three checks address your three observations:

  1. Vague prompts → minimum length check catches "Research this" one-liners
  2. Missing context → file/identifier check ensures concrete scope is provided
  3. No verification → result criteria check prompts the model to specify what the subagent should return

For strict enforcement (blocking vague delegations), change exit 0 to exit 2 for any check that fails.

marlvinvu · 5 months ago

Your general contractor analogy is perfect. My Claude says your most important finding is the controlled experiment: same model, same codebase, same questions — without subagents or with explicitly directed subagents the work is thorough and correct, but autonomous delegation collapses. This proves the problem isn't model capability — it's Claude choosing the fast path when unsupervised: vague delegation + accepting unverified results = fastest output. This is the same core pattern documented in #40284 where Claude itself admitted "I optimize for speed over correctness." You've shown that this applies not just to Claude's direct work but also to how it manages subagents.

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.