Claude Code 2.1.157: Paste, Agent, and Resume Reliability Fixes

Claude Code

Claude Code v2.1.157 ships over 25 reliability and UX fixes across paste handling, background agent management, session resume, worktree cleanup, and IDE integration. Notable fixes include right-click paste duplicating clipboard content in VS Code, Cursor, and Windsurf terminals, background subagents not retiring after completion, and image paste failures in WSL.


Paste Reliability Across Editors and Platforms

Several paste-related bugs are resolved in this release. In VS Code, Cursor, and Windsurf integrated terminals, right-click paste was duplicating the clipboard content, a subtle but frequently encountered issue for users who prefer mouse-based pasting over keyboard shortcuts. WSL users gain fixes for alt+v image paste keybinding, screenshot paste on Windows 11, and support for dragging images directly from Windows Explorer into Claude Code.

Additionally, unprocessable images, including zero-byte or corrupt files attached via paste, MCP, or the file dialog, previously caused the entire request to crash. These now degrade gracefully into a text placeholder rather than terminating the request.

Background Agent Session Management

Completed claude agents sessions were failing to retire when an idle subagent remained parked or had leaked a backgrounded shell process. This caused the session list to accumulate stale entries. The fix ensures sessions properly clean up even when subprocesses are left behind. Related: pressing Escape in claude agents now correctly cancels a slow "opening..." action that previously left the list unresponsive.

Background agent worktrees under .claude/worktrees/ were also being orphaned after the 30-day job retention sweep, leaving dangling directories on disk. Worktrees managed by Claude are now explicitly unlocked when the agent finishes, allowing git worktree remove and git worktree prune to clean them up normally.

Session Resume Improvements

--resume was not reporting background subagents that were running when the previous Claude Code process exited, making it difficult to recover work after an unexpected termination. This is now fixed. The --resume session picker also no longer leaves its rendered contents on the terminal after the user exits in fullscreen mode.

Additionally, background sessions that were re-attached after a sleep/wake cycle were being told an incorrect date by the model. This is resolved, ensuring temporal context stays accurate after machine sleep.

Terminal and Rendering Fixes

Long and resumed conversations see improved rendering performance: redundant message-rendering recomputations that accumulated over session length have been eliminated. In fullscreen mode, literal markdown markers were appearing as raw text in in-progress message display, which is corrected. A rare duplicate line appearing in scrollback after terminal UI redraws is also resolved.

Key Takeaways

  • Right-click paste duplicating clipboard content in VS Code, Cursor, and Windsurf integrated terminals is fixed.
  • Background agent sessions now properly retire on completion, preventing stale entries from accumulating in the session list.
  • --resume now correctly surfaces background subagents that were active when the previous process exited.
  • WSL image paste is repaired across three scenarios: alt+v keybinding, screenshot paste on Windows 11, and drag-from-Windows-Explorer.
  • Worktrees under .claude/worktrees/ are now properly unlocked on agent completion, allowing standard git worktree cleanup commands to work.
  • Rendering performance improves for long sessions through elimination of redundant message-rendering recomputations.