Repository navigation
Switch sessions between git worktrees from the top bar - #80
Merged
Merged
Conversation
A session moves into another worktree of its repository, or back to the main checkout, the way it switches branches. The worktree button in the top bar lists the working trees, and picking one ends the session's process and resumes the same conversation there with `claude --resume`. "New worktree…" makes one with `git worktree add` in `.claude/worktrees/<name>` on a new branch of that name, started from origin's default branch or the current commit. A name that only an existing branch has is refused. New sessions always start in the main checkout. - Before a session moves, Claudiu checks that it is idle and asks when uncommitted files stay behind. The shell restarts in the new folder, and open files follow when the new folder has them. - A session that `claude --worktree` put in a worktree has that worktree recorded in its transcript, and Claude Code restores it over the launch folder. Claudiu appends the null `worktree-state` line that Claude Code's ExitWorktree writes. It is the only write Claudiu makes to a transcript. - The hand-off skeleton takes its message from the caller and says "Switching to <worktree>…". The old view stays up behind it while the target is readied, and the new view replaces it in the same update, so the sidebar never shows the session as ended and the pane is never empty. - A new terminal view starts on the grid of the view it replaces, or of the one shown. Its first frame is drawn before layout, so on the default 120x32 grid the skeleton's prompt jumped to the middle of the pane for a frame. - Worktree rows have an x that removes the worktree, and its branch once merged. Ending the last session in a worktree offers to remove it. The branch menu has a title, an x that deletes a local branch after counting the commits it would lose, and rows for branches another worktree holds, which switch the session there. - A wheel notch scrolls the terminal by 0.8 of the system's notch instead of the panels' 1.6. Refs #79
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
New worktrees go to <data dir>/worktrees/<repo>-<hash>/<name> instead of <repo>/.claude/worktrees, so git status never lists them and the .gitignore offer is gone. Worktrees already in .claude/worktrees keep working as session folders but are no longer removable from Claudiu. Settings has a Worktrees page listing the folders by repository, each with Show in file manager and Remove. Remove asks inside the page. A folder whose repository is gone can be deleted after a confirmation. Refs #79
m4rocks
force-pushed
the
worktree-sessions
branch
from
October 29, 2026 08:13
d8d8a6a to
52e0248
Compare
m4rocks
force-pushed
the
worktree-sessions
branch
from
October 29, 2026 08:18
52e0248 to
d8d8a6a
Compare
…rktree Covers tabs moving with the session (and staying when edited or missing), the file tree's root, the replaced shell, the skeleton's message, and cancelling the uncommitted-files question.
A running session's row now shows the project and age, the title with its status dot, and the branch of the session's own working tree. Recent and older rows are unchanged.
The path hint was flex_none, so a long path took the whole row and squeezed the project name to nothing. Menu items now take a `detail` that renders on a second line, and the new-session menu passes the path there.
On a running row the close button slides in from the right on hover and pushes the age to the left, and slides back out when the pointer leaves. The row is 60 px tall with explicit line heights, which fixes the uneven padding above and below its three lines. The status dot is now a Lucide circle: a rotating circle-dot-dashed while Claude works, circle-small when idle, circle-check when it finished while unwatched, and circle-question-mark when Claude Code is waiting for the user. A change of state turns, shrinks and fades the old icon out while the new one does the reverse. The waiting state comes from the "waiting" status in Claude Code's session registry, so a permission prompt shows it as well as a question. The not-running ring is unchanged.
Show running sessions on three lines, and fix the new-session menu for long paths
# Conflicts: # README.md # src/app/headless.rs # src/app/mod.rs
42 tasks done
This branch was successfully deployed
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
A session switches between the git worktrees of its repository the way it switches branches. New sessions start in the main checkout.
app/switch.rsis new: the switch.app/worktrees.rsis new: the menu, the dialog and removal.git/worktree.rsis new: names, folders,add,remove,.gitignore.claude::worktree_recordedandclear_recorded_worktreeappend the line Claude Code's ExitWorktree writes. Only a session thatclaude --worktreeput in a worktree needs it.Workspace::startgives a new terminal view the grid of the view it replaces, or of the one shown. Before, its first frame was drawn on a 120x32 grid.Evidence
The headless test
switching_between_worktreeschecks at every step of a switch that the session stays shown and running behind its skeleton, and that a restarted terminal starts on the pane's grid. Before the fixes:After:
A scratch repo was used with the real
claude -p.claude --resume <id>, run in a freshgit worktree addfolder and then in the main checkout, kept the same session id and transcript file, and wrote noworktree-stateline.Not checked in the app:
claude --worktreelands in main when switched back. The line is appended while its idle process still runs.Risk
Easy to undo: this branch is one commit. The worktree folders and branches it makes stay on disk and in git until removed.
What could break:
git fetch origin, so creating a worktree from main fails offline.Refs #79