Claude Code Background Agents Now Preserve Permission Mode and Get Session Lifecycle Improvements

Claude Code

Claude Code 2.1.141 fixes a significant workflow bug where background agents launched via /bg or the ←← shortcut would silently revert to default permission mode, ignoring whatever mode the parent session had configured. The update also improves the claude agents dashboard with better session lifecycle management: completed agents that leave a background shell running now correctly move to the Completed state, idle background sessions are automatically retired after 5 minutes, and the new --cwd <path> flag lets developers scope the session list to a specific directory. A visible spinner improvement rounds out the release β€” the spinner now warms to amber after 10 seconds of thinking, giving a clearer signal that Claude is still processing.


Background Agents No Longer Revert Permission Mode

Until version 2.1.141, launching a background agent via /bg or the left-arrow shortcut (←←) had a subtle but disruptive behavior: the new background session would silently reset to the default permission mode, ignoring the mode configured in the originating session. For developers running in auto mode, plan mode, or with custom permission profiles, this meant background agents could start behaving with unexpected permissions β€” either prompting more than expected or operating with broader access than intended.

Version 2.1.141 resolves this by ensuring that background agents inherit the parent session's active permission mode at launch time.

Claude Agents Dashboard: Session Lifecycle Improvements

Several improvements land in the claude agents dashboard view (introduced in 2.1.139) to make session state management more accurate and less cluttered:

Completed State for Long-Running Background Shells

Previously, an agent that finished its assigned work but left a background shell process running would remain stuck in the "Working" state indefinitely β€” giving the impression the agent was still active when it had completed its task. Version 2.1.141 correctly moves these sessions to the Completed state once the agent's work is done, regardless of whether a shell subprocess remains open.

Automatic Retirement of Idle Background Sessions

Empty idle background sessions created when a user presses ←← (to open the background session panel) but doesn't assign any work now get automatically cleaned up. The daemon retires these orphaned sessions after 5 minutes, preventing the claude agents list from accumulating stale placeholder rows.

Scoping with --cwd <path>

A new claude agents --cwd <path> flag lets developers scope the session list to a specific working directory. This is useful in multi-project or mono-repo setups where the agent dashboard otherwise lists sessions from across the entire system.

Spinner Feedback During Long Thinking Periods

A small but useful visual change: the spinner now transitions from its default color to amber after 10 seconds of continuous thinking. This provides a low-friction signal that Claude is still processing a complex turn β€” distinguishing extended thinking from a stalled or unresponsive session without interrupting the user.