[BUG] Cowork mode: sub-agent spawning completely broken — "Prompt is too long" at 0 tokens for all models
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
In Cowork mode (v2.1.121), any attempt to spawn a sub-agent via the Agent tool fails immediately with "Prompt is too long" at 0 tokens processed. This happens for all models including Sonnet and Opus. The failure occurs before the task prompt is even evaluated, meaning the system prompt forwarded to sub-agents already exceeds context limits on its own.
Normal Claude Code sub-agent system prompts are tiny (~517 tokens for Explore, ~480 for Worker Fork). Cowork appears to be forwarding the full parent session system prompt to sub-agents instead — which includes the complete <computer_use> block, <claude_behavior> instructions, full <available_skills> list, deferred tools manifest (~300+ tool names), CLAUDE.md, and more. This is likely 80,000+ tokens before the task prompt is appended.
The feature flag tengu_mcp_subagent_prompt in ~/.claude/.claude.json appears to control this behavior and is currently false for Cowork users. Setting it to true locally has no effect because it is reset by GrowthBook on every app startup.
What Should Happen?
Sub-agents should receive a lean, task-specific system prompt (~500 tokens, matching the existing Explore/Worker Fork stubs in the app bundle) — NOT the full parent Cowork session system prompt. Parallel agent workflows should execute normally.
Error Messages/Logs
Prompt is too long
agentId: a333b5c5913f81ebc
total_tokens: 0
tool_uses: 0
duration_ms: ~1500-5000ms
Steps to Reproduce
- Open Claude desktop app in Cowork mode (v2.1.121)
- 2. Ask Claude to spawn any sub-agent via the Agent tool, e.g.: "Search the web for X" or any task requiring parallel agents
- 3. Observe: immediate "Prompt is too long" failure, 0 tokens processed, duration ~1500ms
- 4. Reproduced with model: sonnet, opus, and general-purpose (default) agent types
- 5. Reproduced across multiple app restarts
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.121 (Cowork / Claude Desktop)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Investigated in depth. Key findings:
- The feature flag
tengu_mcp_subagent_promptin~/.claude/.claude.jsonisfalsefor Cowork users and is listed incachedExperimentFeatures, meaning it's GrowthBook-controlled and resets on every app startup. Setting it totruelocally has no effect. - - Normal Claude Code sub-agent prompts (Explore, Worker Fork) are ~500 tokens. The prompt being forwarded in Cowork is likely 80,000+ tokens based on the immediate 0-token failure.
- - - Suggested fix: enable
tengu_mcp_subagent_promptfor Cowork/local-agent sessions, which should swap in the lean sub-agent stub instead of forwarding the full parent system prompt.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗