Claude Code v2.1.160: Major Background Agent Session Reliability Release
Claude Code v2.1.160 delivers a comprehensive reliability overhaul for background agent sessions, resolving over ten distinct bugs that caused sessions to lose history, freeze, re-run original prompts, or behave erratically after disconnects and restarts. The fixes address long-standing issues across macOS, Windows, and terminal multiplexers including tmux, with particular focus on sessions that resume after being idle, after system sleep, or after overnight re-attachment.
Sources & Mentions
4 external resources covering this update
Background Agent Reliability: 10+ Fixes in v2.1.160
Claude Code's background agent system (claude agents, claude --bg, and dispatched background sessions) receives its most comprehensive reliability patch to date in v2.1.160. The release addresses more than ten distinct bugs, many of which caused sessions to silently lose conversation history, restart work from scratch, or become unresponsive in ways that were difficult to diagnose.
Session Continuity Fixes
Several bugs caused background sessions to forget their conversation history or re-run the original prompt after reconnection:
Completed sessions re-running the original prompt. Restoring a completed session from claude agents was incorrectly dropping chat history and re-executing the original prompt, causing potentially destructive or redundant work. This is now fixed.
Overnight re-attachment losing conversation. Background sessions that were re-attached after being idle overnight were losing their conversation and re-running the original prompt. Long-running overnight tasks now resume correctly with their full history intact.
Background sessions not correctly appearing as Completed. Background agents that had resumed work were incorrectly shown under the Completed status in the claude agents view rather than their actual state.
claude --bg Reliability
Cold-start socket failure. claude --bg was occasionally failing with "socket missing" when the background daemon was still starting up on a heavily loaded machine. The failure is now handled gracefully.
Windows directory locked after claude rm. On Windows, the directory a background session was started in could not be deleted after claude rm until the background daemon fully exited. This is now resolved.
claude agents Interface Fixes
Freeze on session list exit. The claude agents view was freezing for several seconds when returning to the session list, caused by the auto-updater re-checking for updates on every exit from a session. The redundant check is now eliminated.
Input becoming unresponsive on Windows. Esc, arrow keys, and typing became unresponsive on Windows when attached to a background session or in the agent view while the host was under heavy CPU load. This is now fixed.
Terminal Rendering Fixes
Render artifacts in Apple Terminal and tmux. Background agents were emitting terminal sync-output markers to terminals that do not support them, specifically Apple Terminal and tmux, causing render artifacts when entering a running agent.
Mouse wheel scrolling transcript instead of history. Immediately after opening a session from the agents list, mouse wheel scroll was scrolling the prompt history rather than the transcript. The scroll target is now correctly set on session open.
CJK IME composition displaced. CJK input method editor composition was appearing at the bottom-left of the screen instead of at the input caret in the claude agents view. This is now fixed, restoring correct IME behavior for East Asian language users.
Additional Fixes
Voice mode failure with non-ASCII paths. Voice mode was failing to connect when the project directory or branch name contained non-ASCII or special characters.
Auto mode classifier latency improvement. The auto mode classifier's reasoning on routine actions has been reduced, lowering the frequency of "could not evaluate this action" blocks that were interrupting background agent workflows.