Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes the methodology of detecting Claude Code Worktree conversations. I know that I'm the one who originally suggested that Claudine scan for worktrees under
.claude/worktrees/*🙈, but I've found a number of issues with this method in practice:.claude/worktrees/*are fairly ephemeral: Claude is liable to delete them when a session closes, especially if they don't contain changes from the 'main' worktree--worktreeflag--have a distinct project folder of the form<workspace-name>--claude-worktrees-<worktree-name>, but a Conversation can have a different worktree session open than the one reflected in its project folder (if any)--worktreeflag) expect to be resumed from the base Workspace folder, not the.claude/worktrees/*subdirectory, so the Conversation'sworkspacePathfield should really be the base Workspace path, even if there's an active worktree sessionThe basic crux of this PR is that Claudine no longer pays any attention to the
.claude/worktreesfolder: instead, ifmonitorWorktreesistrue, Claudine pulls in conversations from project folders matching the format<monitored-workspace-name>--claude-worktrees-*(which generally persist even after the corresponding directory in.claude/worktrees/is deleted). Additionally: a Conversation'sworktreeNamefield is now parsed fromworktree-stateJSONL messages rather than its filepath.Changes
ConversationParser.ts:'worktree-state'JSONL entries to extract worktreeName (set on session open, cleared on session close)extractWorkspacePathnow strips the--claude-worktrees-*suffix from the project folder name before resolving the workspace path, so worktree conversations resolve to the base workspace pathparseMessageContentwas written to normalize message content that Claude Code would sometimes emit as a bare string or single object (instead of an array of content blocks)ClaudeCodeWatcher.ts:getEffectiveWorkspaceRoots,getClaudeWorktreePaths,resolveWorkspacePathForFile,extractWorktreeName, andapplyWorkspaceMetadatagetProjectDirsToScannow uses a prefix match whenmonitorWorktreesis enabled, picking up project directories of the form<workspace-name>--claude-worktrees-*alongside the base workspace directory.isFromCurrentWorkspaceandisFromExcludedWorkspaceuse a similar prefix-match strategy whenmonitorWorktreesis onStandaloneMessageHandler.ts:monitorWorktreessetting to the webview (it was previously missing from the settings snapshot)types:'worktree-state'as a validClaudeCodeJsonlEntrytype with aworktreeSessionfieldTaskCardOther Notes
RELEASE_NOTES.mdrather thanCHANGELOG.md--is that where I should be recording changes?monitorWorktrees(again: another of my own suggestions 🙈🙈) can arguably be deleted. It does have an effect, but the concept of "project folders" might be more Inside Baseball than needs to be surfaced in a user-facing setting. It's important to note that as of this PR:monitorWorktreeshas no effect on whether theworktreeNamefield and WT badges are parsed from a Conversation, it only filters out certain conversations based on their project folder.Checklist
npm testpassesnpm run lintpassescd webview && npm run build)CHANGELOG.md(if user-facing change)vscode.l10n.t()for i18n