Follow-up to the sessions design (#59). With many sessions under one user, the remaining pain of the shared-HOME model is workspace trampling: two agents editing the same checkout, needing to be reminded to use git worktrees.
Fix it structurally at the session layer instead of by convention:
claude-box-session add (and the settings-daemon add form) should default workingDirectory to a fresh per-session directory instead of inheriting a shared cwd.
- When the requested cwd is inside an existing git clone that another session already uses, create a
git worktree for the new session automatically (e.g. ~/worktrees/<repo>-<session> or .worktrees/<session> inside the clone) and point the session there.
- Seeded
main session keeps today's behavior (back-compat; single-session boxes are unaffected).
- Document the "one session = one directory" convention in the README sessions section.
Open questions: worktree cleanup on claude-box-session rm (remove if clean, keep + warn if dirty?), and whether the auto-worktree applies only when a collision is detected or always.
Follow-up to the sessions design (#59). With many sessions under one user, the remaining pain of the shared-HOME model is workspace trampling: two agents editing the same checkout, needing to be reminded to use git worktrees.
Fix it structurally at the session layer instead of by convention:
claude-box-session add(and the settings-daemon add form) should defaultworkingDirectoryto a fresh per-session directory instead of inheriting a shared cwd.git worktreefor the new session automatically (e.g.~/worktrees/<repo>-<session>or.worktrees/<session>inside the clone) and point the session there.mainsession keeps today's behavior (back-compat; single-session boxes are unaffected).Open questions: worktree cleanup on
claude-box-session rm(remove if clean, keep + warn if dirty?), and whether the auto-worktree applies only when a collision is detected or always.