Desktop app's worktree-per-session model traps persistent documents on feature branches, causing knowledge loss
Problem
The Claude Code desktop app creates a git worktree for every session. This is great for code isolation, but it creates a serious problem for any file that needs to persist across sessions and branches — planning documents, architecture notes, CLAUDE.md updates, and other knowledge-layer content.
These files get checked out into the session's worktree on a feature branch. When that branch is squash-merged, the session ends without committing, or worktrees are pruned, the document changes are lost. Even when they're committed, they're stranded on a feature branch and don't reach main until the PR lands — which may be days later, or never if the approach changes.
Why this matters
Modern development requires two parallel layers of work:
- Code — belongs on branches, isolated per feature, merged via PR
- Knowledge — planning docs, architecture notes, decision logs — needs to persist above the branch model, continuously updated as work progresses
The worktree model collapses these two layers into one. There's no way in the desktop app to designate files or folders as branch-agnostic — everything is subject to the same branch/worktree isolation as the code itself.
Concrete scenario
A user maintains a docs/ folder with active planning files, architecture notes, and a CLAUDE.md that multiple sessions depend on. They want to update these docs continuously while doing active coding across multiple sessions on different branches. Currently:
- Docs edited in a coding session land on that session's feature branch
- Other sessions don't see the update until the branch is merged
- Squash merges can silently drop doc-only commits
- Worktree pruning can delete uncommitted doc changes entirely
- The only workaround is launching Claude via CLI — unavailable in the desktop app
Expected behavior
The desktop app should support at least one of:
- Branch-agnostic file designation — a way to mark paths (e.g.
docs/,CLAUDE.md) as always reading/writing frommain, never isolated into the session's worktree - Persistent context session type — a session mode that operates directly on
mainwithout worktree isolation, intended for knowledge management rather than feature development - Auto-commit and sync of designated paths — changes to designated files are automatically committed to
mainat session end, independent of the feature branch
Environment
- Claude Code desktop app (Windows 11)
- Git monorepo with active lane pool (multiple concurrent sessions)
- Worktrees created automatically per session with no opt-out
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗