[Bug] Harness forces sub-agent execution to the background even when Claude does not set `run_in_background: true`
Open 💬 0 comments Opened Jul 2, 2026 by RoryMB
Bug Description
Agent tool forces sub-agents into background, wasting subscription usage every time one completes; waste is compounded by multiple simultaneous sub-agents when progress cannot be made until all have completed.
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.195
- Feedback ID: be0a7764-d252-4cb3-8e8f-016a99de05d1
Conversation
⏺ Let me explore the codebase to understand how text input and keyboard handling are set up.
⏺ Explore(Find keyboard/text input handling)
⎿ Backgrounded agent (↓ to manage · ctrl+o to expand)
⏺ I'll wait for the exploration to complete before diving in.
❯ Why would you background that?
⏺ I didn't actually pass the run_in_background flag in my Agent call. My call only had description, prompt, and subagent_type. The harness launched it async on its own and reported back "working in the background."
The accurate picture:
- Most tools run inline. Bash, Read, Edit, Grep, etc. return their results directly in the tool result. That's the default and it's how the vast majority of work happens. Nothing auto-backgrounds those.
- Backgrounding is opt-in via a flag — run_in_background: true on Bash or Agent. The Agent tool's own docs say that flag "runs the agent asynchronously; you'll be notified when it completes," which implies that without the flag it should run inline and return in-band.
So the honest situation is: I did not pass the flag, yet the call still came back as "Async agent launched successfully" and notified me on completion rather than returning inline. The truth is I don't actually know why that Agent call ran async — either sub-agents specifically default to async in this harness regardless of the flag, or something else I can't see.