Worktree sessions under a channel #51
No reviewers
Labels
No labels
bug
docs
enhancement
good first issue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pedromcaraujo/forge!51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "worktree-sessions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #50. Groundwork for #40.
Run more than one Claude session per project, each on its own git worktree and branch, without a NixOS rebuild.
What changes
name, orname@baseto branch from something other than HEAD). Forge then creates the worktree and branch, starts a session in it, and switches to it.×to close it. On a phone they follow their channel's pill. They share the channel's issues drawer and upload dir.claude --worktree. Clicking a stopped one (e.g. after a reboot) restarts its session.How
<channel>~<name>.--url-arg(/<channel>/?arg=<name>). The launcher script accepts only a plain name and only attaches to an existing session, so a crafted URL can't start a session in the wrong place./worktrees(list/create/open/close) and starts sessions with the same session script ttyd uses, now factored out.worktreeDir(default.claude/worktrees, relative to the channel cwd and added to the repo's local.git/info/exclude) and a per-channelworktreestoggle.Fixes along the way
=name:). A bare-t forgeprefix-matchesforge~xwhen the channel's own session is down.KillMode=process: it can now be the process that spawns the shared tmux server, so a redeploy must not kill it.Tested
name@base, a worktree made outside Forge, and invalid names/base refs.?arg=values ($(...),../x, two args): all refused, nothing runs.A channel can now run extra Claude sessions, each on its own git worktree, listed indented under the channel in the sidebar and created from the palette ("Create worktree"). No rebuild per session: a worktree session is the tmux session `<channel>~<name>`, served by the channel's existing ttyd via `--url-arg` (`/<channel>/?arg=<name>`). - forge-tmux sidecar: /worktrees list/create/open/close. Close removes the worktree only when clean (409 + confirm otherwise); the branch is kept. - New `worktreeDir` option (default `.claude/worktrees`, relative to the channel cwd) and per-channel `worktrees` toggle. - tmux targets are now exact (`=name:`); a bare `-t forge` prefix-matched `forge~x` when the channel's own session was down. - Session command factored into one script shared by ttyd and the sidecar. - forge-tmux gets KillMode=process, since it may now spawn the tmux server. Closes #50