[BUG] Claude Code 2.1.252: run_in_background=false is ignored when the Fork Subagent path is enabled

Status Open
Reported on v2.1.252
Maintainer reply None cached
Activity 1 comment · opened Sep 1, 2026

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?

Claude Code 2.1.252 appears to have a client-side issue affecting local Agents on Windows: run_in_background=false is ignored when the Fork Subagent path is enabled.

The session transcript confirms that the Agent tool call explicitly contains:

{
  "run_in_background": false
}

but Claude Code immediately returns an asynchronous Agent result such as:

{
  "isAsync": true,
  "status": "async_launched"
}

and the UI shows:

Backgrounded agent

A/B testing strongly ties this behavior to the Fork Subagent gate:

Default Claude Code 2.1.252:
run_in_background=false
→ Backgrounded agent

CLAUDE_CODE_FORK_SUBAGENT=0:
run_in_background=false
→ synchronous foreground Agent
→ parent waits for Response/Done

This suggests that the Fork Subagent path in Claude Code 2.1.252 overrides normal foreground/background control for local Agents.

What Should Happen?

When run_in_background=false is supplied, the Agent call should wait for the Agent to complete and return its result synchronously before the parent continues. This is exactly the observed behavior when CLAUDE_CODE_FORK_SUBAGENT=0 is set: the Agent stays in the foreground and the parent waits for the result.

Error Messages/Logs

Steps to Reproduce

  1. Launch Claude Code 2.1.252 on Windows with default settings (no fork/background/coordinator environment variables preset at User or Machine scope).
  2. Ask Claude to invoke the Agent tool once with run_in_background=false (general-purpose local Agent, no tools needed).
  3. Observe: Claude Code immediately returns isAsync=true / status=async_launched and the UI shows "Backgrounded agent" instead of waiting for the Agent result.
  4. Repeat with the process-scoped environment variable CLAUDE_CODE_FORK_SUBAGENT=0: the Agent then runs synchronously in the foreground and the parent waits for its result.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.252(Claude Code)

Platform

Other

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Could Anthropic confirm:

  1. Is it intentional that enabling the Fork Subagent path can cause run_in_background=false to be ignored?
  2. Is CLAUDE_CODE_FORK_SUBAGENT=0 currently a supported or recommended workaround?
  3. Is a fix for this behavior planned in a version after 2.1.252?

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗