Claude Code Pinned Background Sessions Now Stay Alive When Idle and Auto-Update

Claude Code

Claude Code v2.1.147 introduces smarter lifecycle management for pinned background sessions. Sessions pinned with Ctrl+T in claude agents now remain active indefinitely while idle, rather than being killed after the default ~1 hour timeout, and are automatically restarted in-place when a Claude Code update is available. When the host runs low on memory, non-pinned idle sessions are shed first, with pinned sessions only reclaimed as a last resort. This makes long-running background agents significantly more reliable for developers who leave tasks running overnight or across work sessions.


Pinned Background Sessions: Always-On When You Need Them

One of the most common pain points for developers using Claude Code's background agent system has been idle timeout: background sessions left running while a developer steps away would be killed after approximately one hour with no terminal attached. For long-running autonomous tasks, this created a frustrating gap β€” the agent would be terminated before the work was done.

Claude Code v2.1.147 resolves this for pinned sessions. When a session is pinned with Ctrl+T inside the claude agents interface, the background session supervisor now treats it differently from unpinned sessions. A pinned session keeps its process running while idle, exempt from the standard idle-timeout eviction policy.

Automatic Update Delivery Without Re-Attaching

Beyond idle persistence, pinned sessions now also receive Claude Code updates automatically. When the auto-updater applies a new version, an idle pinned session is restarted in-place onto the new version β€” meaning the session picks up the update without the developer needing to reattach, detach, and re-pin. This closes a gap where long-running pinned sessions could fall behind the current version while actively idle.

Memory-Pressure Priority

The new behavior introduces a clear eviction priority hierarchy when the host machine runs low on memory:

  1. Idle non-pinned sessions are shed first
  2. Idle pinned sessions are only reclaimed if freeing non-pinned sessions wasn't sufficient

This ensures that sessions a developer has explicitly marked as important are protected until the system has no other choice.

Who Benefits

This change is most impactful for developers who run overnight agentic workflows, leave background agents running while switching contexts, or use multi-session Claude Code setups where certain sessions serve as long-lived "worker" agents on ongoing tasks. The combination of idle persistence and in-place updates means pinned sessions behave closer to always-on background services rather than ephemeral processes.

Other Improvements in v2.1.147

The release also included improvements to the auto-updater's retry logic with better error reporting, improved diff rendering performance for large edits, and a fix to prevent prompt history from recording consecutive duplicate entries. A variety of bug fixes addressed shell snapshots, plugin agents, hook conditions, and PowerShell tool behavior on Windows.