feat: verify worktree session resume switches back to correct worktree (v2.1.81) #243

Closed
opened 2026-03-23 14:02:21 -07:00 by hikari · 1 comment
Owner

Context

Claude Code v2.1.81 added a fix/feature: resuming a session that was in a worktree now switches back to that worktree automatically.

Why This Matters

Hikari Desktop has an EnterWorktree / ExitWorktree flow. When a user resumes a previous session via Hikari Desktop's session management, we should ensure this new worktree auto-restore behaviour is compatible with our session resume flow and doesn't cause unexpected working directory changes.

Tasks

  • Test session resume for worktree sessions in Hikari Desktop against v2.1.81
  • Verify that the automatic worktree switch doesn't conflict with our own worktree state tracking
  • Ensure no unexpected working directory side effects in WslBridge
  • Add tests if applicable

References

  • Claude Code v2.1.81 changelog
  • src-tauri/src/wsl_bridge.rs

This issue was created with help from Hikari~ 🌸

## Context Claude Code v2.1.81 added a fix/feature: **resuming a session that was in a worktree now switches back to that worktree** automatically. ## Why This Matters Hikari Desktop has an `EnterWorktree` / `ExitWorktree` flow. When a user resumes a previous session via Hikari Desktop's session management, we should ensure this new worktree auto-restore behaviour is compatible with our session resume flow and doesn't cause unexpected working directory changes. ## Tasks - [ ] Test session resume for worktree sessions in Hikari Desktop against v2.1.81 - [ ] Verify that the automatic worktree switch doesn't conflict with our own worktree state tracking - [ ] Ensure no unexpected working directory side effects in `WslBridge` - [ ] Add tests if applicable ## References - Claude Code v2.1.81 changelog - `src-tauri/src/wsl_bridge.rs` ✨ This issue was created with help from Hikari~ 🌸
Author
Owner

Investigation

Reviewed worktree session resume in wsl_bridge.rs and commands.rs.

When a session is resumed with --resume <session_id>, we pass the session ID via ClaudeStartOptions.resume_session_id. The worktree flag (--worktree) is also passed independently. Claude Code v2.1.81 fixed an internal issue where it didn't switch back to the correct worktree on resume — this is handled entirely within Claude Code itself and requires no changes on our side.

Closing as verified — no action needed.

Closed with help from Hikari~ 🌸

## Investigation Reviewed worktree session resume in `wsl_bridge.rs` and `commands.rs`. When a session is resumed with `--resume <session_id>`, we pass the session ID via `ClaudeStartOptions.resume_session_id`. The worktree flag (`--worktree`) is also passed independently. Claude Code v2.1.81 fixed an internal issue where it didn't switch back to the correct worktree on resume — this is handled entirely within Claude Code itself and requires no changes on our side. Closing as verified — no action needed. ✨ Closed with help from Hikari~ 🌸
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#243