Repository navigation
Conversation
Cmd+Left/Right switched sessions everywhere, so it stole line start/end in terminals, the file editor and text fields. In a terminal it now sends Ctrl+A / Ctrl+E (Ctrl+Left/Right stays xterm's word jump off the Mac), and text fields and editors keep their own handling. Cmd+Up/Down and Cmd+Shift+[ / ] still switch sessions; the grid keeps Cmd+Arrow for cards. Session switching in the Projects tab followed the Sessions sidebar, which jumped between projects. It now follows the project's own list: the session pane when working, the track cards on the overview. Every session's file tab shares one viewer, and showing a tab reopened it from the text captured when the file was first opened, so switching sessions or toggling the explorer threw away typed edits. The viewer now copies its buffer and cursor back onto the tab before showing another, and leaves the buffer alone when the same tab repaints. Replacing a background session's file no longer wipes the file on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
worktreeList parses `git worktree list --porcelain -z`, and worktreeAdd can now start a branch at a given commit, track a remote branch or check out a detached HEAD. Also: delete a branch, list branches, find the merged ones and the default branch, and read the last commit. These back the Worktrees tab.
worktrees.js finds a project's repositories (an attached folder that is not a repository is searched a few levels down), lists every worktree of each with git, and tells main, Switchboard, Claude, Codex and side-by-side worktrees apart. Every action re-checks that its path is a worktree of one of the project's repositories. Actions: create (new, existing, remote or detached; path from a template, next to the repository by default; copy local files by pattern), remove (with the branch), lock, unlock, move, repair, prune, the merged ones, and attach to or detach from the project. Commands to run after creating or before removing come from the project's settings only. projects.js gains registerWorktreeFolder and moveFolderPath, so a worktree made or moved here keeps the project's rows and cwds right.
Between Git and Settings, the tab lists every worktree of the project's repositories, grouped by repository: branch, folder, where it came from (main, project, Claude, Codex), locked or missing, local changes, ahead/behind, last commit and the sessions running in it. Filter and sort like the git-worktree-manager extension does. From the tab: create a worktree (new, existing, remote or detached; the folder comes from a template, next to the repository by default), remove it and its branch, lock, unlock, move, repair, prune, remove the merged ones, start a Claude or Codex session or a terminal in it, attach it to or detach it from the project, open its folder and copy its path. Worktree settings hold the folder template, the files to copy into a new worktree and the commands to run after creating and before removing one.
- Removing one worktree no longer prunes the records of others whose folder is missing for now (moved by hand, on a drive that is not mounted). - A setup command that ignores SIGTERM is killed, and one that leaves a process in the background answers when the shell exits. - Remove merged does not tick a worktree with no commits of its own or with sessions running in it, ignores a stale base choice, and lists branches git kept. - A folder attached through a symlink matches git's real path. - Copy patterns: ignores apply inside a folder copied whole, links are copied as links. - Remote names with a slash, and git run with LC_ALL=C and no optional locks, so its messages are recognised and a status never takes the index lock.
Combines repository history with the Git workspace, removes the redundant recent-commits section, and keeps repository selection synchronized across Changes and History.
Extra claude CLI arguments, appended to the launch command as raw shell
like the pre-launch command, e.g. --settings '{"outputStyle": "Learning"}'.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The sidebar and its resize handle were 100vh tall, but they sit in the app container, which ends above the 22px status bar. So the container's content ran 22px past it, and overflow: hidden still let a focus() or scrollIntoView() scroll it: the whole window then slid up 22px, cutting off the top of the sidebar and the project header, and stayed that way. The last 22px of the sidebar lists were also always hidden. The sidebar and the handle now take the container's height, and the container uses overflow: clip, so nothing can scroll it.
Contributor
|
Thanks, this is good stuff, the only challenge i have with it is that it shows All worktrees rather than the current project, so it creates a confusion. For that reason i moved it under 'Git'. However still + New Session will create a new session of a different worktree under current project that might be unrelated to this project and it breaks the project boundary. Would love to hear your use case for that. |
Contributor
Author
|
Actually I just used the work tree feature tab to scan more multiple folders to have the possibility to manage different work tree from different places create for esemplo by cloud code directly. |
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
Adds a Worktrees tab to projects, between Git and Settings. It lists every git worktree of the project's repositories and manages them from one place. It's inspired by the VS Code extension git-worktree-manager.
Today Switchboard only knows about the worktrees it creates itself under
<project>/repos/. Worktrees made by Claude (.claude/worktrees/), by Codex or by hand don't show up anywhere. This tab shows them all and adds the git operations that are missing: lock, move, prune and repair.What's included
List: worktrees are grouped by repository (by
--git-common-dir), and each group can be collapsed. Each row shows:The list has search and sort, and it refreshes when the window gets focus.
Repository discovery: an attached folder that is a repository is used as is. In a folder that isn't, it looks for
.gitentries up to three levels deep. It skipsnode_modules,dist,buildand hidden folders, except the ones worktrees conventionally live in (.claude,.codex,.repos,.worktrees).Create: a new branch from a start point, an existing local or remote branch, or a detached HEAD.
<repo>.worktrees/<branch>, the extension's convention. It sits outside the repository, so nothing needs to be added to.gitignore..env*, run a setup command, and open a Claude, Codex or terminal session in it.Remove: shows the worktree's state and running sessions first. It offers force when the worktree is dirty and unlock when it's locked. It can also delete the branch, and asks again before using
-Dwhen the branch isn't merged. The main worktree can't be removed.Maintenance: lock with a reason, unlock, move, repair, prune with a preview, and Remove merged. Remove merged only ticks worktrees that are clean, unlocked, have no sessions running and have commits of their own.
Switchboard integration:
Per-project settings (stored under the settings key
worktrees:<projectId>, no schema change):$BASE_PATH,$BASE_NAME,$REF_NAME,$INDEXand so on;Security
Following your review of #99:
wtAttr, local to the view sinceescapeAttrisn't onmain). Every text value goes throughescapeHtml.escapeHtmlfromutils.js. It pushesx"><img src=x onerror=alert(1)>'&through repository names, paths, branch names, lock reasons and commit subjects, then checks that no element and no extra attribute comes out.git worktree list. The main worktree is refused for anything that changes it. Git always runs with argv, never through a shell.$SHELL -lc, orcmd.exe /d /s /con Windows).prune, so it can't drop the records of worktrees on a disconnected drive.alert/confirm: every dialog is an in-app modal.Changes to existing files
git.js:new worktree, branch and merge helpers;
worktreeAddgains optionalstartPoint,createBranch,trackanddetachoptions. Existing callers behave as before.One change that affects every git call: git now runs with
GIT_TERMINAL_PROMPT=0,GIT_OPTIONAL_LOCKS=0andLC_ALL=C. This means:statusdoesn't take the index lock;Happy to scope this to the new helpers if you prefer.
projects.js:registerWorktreeFolderattaches an existing worktree without running git;moveFolderPathmoves a folder row and the project's default and track working directories.attachWorktreeis unchanged.main.js,preload.js: the tab's IPC endpoints, each wrapped inguarded().projects-view.js: the tab registration (three small edits).index.html: the new script tag.style.css: a.wt-*block placed after the Git tab styles.README.md: a line in "Features at a glance" and a section under "Worktrees".Size: about 3.8k lines, of which ~2.75k are code and ~1k tests.
Testing
npm test: 483/485. The 2 failures aredb-schema-reconcileand fail onmaintoo. The new tests cover:test/git-worktrees.test.js);test/worktrees.test.js).escapeHtml(test/project-worktrees-view.test.js)..claude/worktrees/worktree. I checked:.envand a setup command;worktree list --porcelain -z. With older versions the tab shows a clear error.