Interactive sessions background themselves by default instead of offering it

Status Open
Reported on v2.1.221
Maintainer reply None cached
Activity 0 comments · opened Aug 4, 2026

What happened

On 2.1.221, an interactive session prints Backgrounding after the current tool finishes… and moves itself to the background, dropping me into the session list. Nothing in the session asked for it, and it happens repeatedly across sessions.

Why this is the wrong default

Backgrounding a session is a useful feature. It is also a decision about where my attention goes for the next several minutes, and the product takes that decision without asking. A feature like this should be offered and taken, not applied.

The immediate cost is losing the thread of what I was doing. I am dropped out of a conversation I was reading, into a list, and have to navigate back and re-orient.

What the binary shows

CLAUDE_CODE_AUTO_BACKGROUND_TIMEOUT_MS shortens a tool's effective timeout so it auto-backgrounds sooner, and only for the main agent:

function A3o({requestedTimeoutMs:e, isMainAgent:t, canAutoBackground:r, env:n=process.env}){
  if(!t||!r) return e;
  let o = n.CLAUDE_CODE_AUTO_BACKGROUND_TIMEOUT_MS;
  if(!o) return e;
  let i = bp(o);
  if(isNaN(i) || i<=0) return e;
  return Math.min(e, Math.max(i, 2000));
}

Unset means unchanged, so this is not what is backgrounding the session.

The MCP path is gated on a remote flag defaulting to on, with an environment variable that only applies to non-interactive sessions:

if(t && !re.CLAUDE_AUTO_BACKGROUND_TASKS) return 0;
let r = re.CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS;
if(r !== void 0) return Math.min(Math.max(0,r), Ypy);
return Xe("tengu_mcp_auto_background", !0) ? Kpy : 0;

Note !re.CLAUDE_AUTO_BACKGROUND_TASKS: a user who sets that variable to 0 gets the string "0", which is truthy, so the obvious way to switch it off turns it on instead.

What I am asking for

  1. Do not background an interactive session by default. Offer it.
  2. If it stays on by default, document the trigger and the threshold for interactive sessions, and provide an off switch that is not sensitive to "0" being truthy.

CLAUDE_CODE_AUTO_BACKGROUND_TIMEOUT_MS is absent from the environment-variable reference. #78407 already reports the same omission for the MCP equivalent, and #77645 for the Bash timeout message.

Version

2.1.221, macOS.

View original on GitHub ↗