Spawned Task Agents Do Not Inherit Protocol Context
Summary
When using Claude Code's Task tool to spawn sub-agents, the spawned agents do not read or inherit protocol documents that the parent agent has loaded. This causes recurring false findings because sub-agents invent ad-hoc approaches instead of using documented canonical paths.
Environment
- Tool: Claude Code CLI
- Model: claude-opus-4-5-20251101
- Platform: WSL2 / Linux
Problem Description
My project has extensive documentation specifying:
- Canonical file locations (e.g.,
/data/{jurisdiction}/legislation/) - Verification protocols requiring specific lookup sequences
- Guardrails in
.claude/CLAUDE.mdand protocol files
When Claude Code spawns Task agents to perform work:
- Spawned agents do NOT read existing protocols before executing
- Spawned agents do NOT inherit the parent's loaded context
- Spawned agents invent ad-hoc approaches that search incorrect locations
- Result: False findings (e.g., "file does not exist" when it does)
Reproducible Pattern
- Parent agent loads protocol specifying canonical path:
/data/{jurisdiction}/legislation/ - User requests audit of all jurisdictions
- Spawned audit agent searches only
/executions/*/test_data/(wrong location) - Agent reports 35% of jurisdictions "missing legislation"
- Manual verification shows 100% have legislation in canonical location
- User must intervene to correct
This pattern has recurred across multiple sessions despite adding explicit paths to .claude/CLAUDE.md, creating dedicated protocol documents, and logging 700+ deviations.
Root Cause
The issue is behavioral, not informational. Documentation exists and explicitly addresses this. The problem is spawned agents not reading documentation. Creating more documentation does not help because it also will not be read.
Request
Please analyze whether Task agent spawning could inherit loaded protocol context from the parent agent, or provide guidance on workarounds.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗