What task are you trying to do?
I want PawWork to develop inside a git worktree as a normal way of working, so that I can run multiple independent tasks on the same repo without file conflicts, keep experimental changes isolated from my main checkout, and let background work happen without disturbing my foreground session.
Once a session is bound to a worktree, every default behavior of the agent (relative paths, terminal, file tree, VCS view) should resolve from that worktree until the session leaves it. The agent may still use absolute paths or workdir overrides for one-off cross-boundary work, but the default must hold for the whole session.
What do you do today?
PawWork already lets me create worktrees through the project UI, but the agent runtime treats the session's working directory as immutable. To make the agent operate inside a worktree I have to pass workdir or absolute paths on every single tool call. The agent forgets, and edits leak back into the main checkout.
There is no agent tool to enter or leave a worktree mid-session, no persisted binding between a session and a worktree, and the system prompt always reports the original project root as the working directory even when I expect work to happen elsewhere.
What would a good result look like?
Worktree becomes a first-class session execution context. When the session is bound to a worktree, every surface that touches the working directory (agent tool calls, terminal, file tree, VCS, LSP, watchers, system prompt) defaults to that worktree. When I exit the worktree the session goes back to the project root cleanly. Closing PawWork and reopening it later restores the same active worktree.
The detailed v3 design lives in the pinned design comment below.
What would count as done?
- The agent has
EnterWorktree and ExitWorktree tools that bind / unbind the active session to a worktree.
- Once entered, every tool call (
bash, read, write, edit, glob, grep, etc.) resolves relative paths from the active worktree by default.
- The titlebar shows the active worktree slug and branch; project-root sessions show neither; non-git projects also hide the branch segment.
- A new Settings page lists every PawWork-tracked worktree across all projects, grouped by project, with delete (two-step confirm). Delete is blocked when the worktree is currently bound as
activeDirectory of any open session (definition in the design comment).
- Closing and reopening PawWork restores the active worktree silently when it is still valid; falls back to project root with a visible warning when it is gone.
EnterWorktree(name=...) (creating a managed worktree) requires .worktrees/ to be in .gitignore; PawWork prompts to add it (creates .gitignore if missing) on the first such attempt and writes the line unstaged on consent. Declining fails the creation with a clear message asking the user to handle ignore manually. EnterWorktree(path=...) (entering an existing worktree elsewhere) does not need this check.
- Subagents inherit the parent session's active directory at dispatch time and cannot transition it themselves.
- Sessions created before this design lack
executionContext; loading them backfills ownerDirectory = activeDirectory = Project.directory with no active worktree, no warning. The synthesized field is written back on first load.
- Works on macOS and Windows.
What should stay out of scope?
- No path remapping when an exported session is opened on another machine.
- No per-worktree permission set; permissions remain project-root scoped.
- No direct A→B worktree switch; agent must
ExitWorktree then EnterWorktree.
- No automatic base-branch inference for
EnterWorktree; new worktrees branch from project root HEAD.
ExitWorktree does not clean up, merge, or open PRs.
- No global audit log surface; the session transcript and the Settings list are enough.
- No worktree slug in the URL route; route only encodes session id.
- No "dirty root" warning when creating a worktree (
git worktree add does not touch the main checkout).
- No multi-window write-lock for the same session id; users should not open the same session in two windows.
Which audience does this matter to most?
Both
Extra context
What task are you trying to do?
I want PawWork to develop inside a git worktree as a normal way of working, so that I can run multiple independent tasks on the same repo without file conflicts, keep experimental changes isolated from my main checkout, and let background work happen without disturbing my foreground session.
Once a session is bound to a worktree, every default behavior of the agent (relative paths, terminal, file tree, VCS view) should resolve from that worktree until the session leaves it. The agent may still use absolute paths or
workdiroverrides for one-off cross-boundary work, but the default must hold for the whole session.What do you do today?
PawWork already lets me create worktrees through the project UI, but the agent runtime treats the session's working directory as immutable. To make the agent operate inside a worktree I have to pass
workdiror absolute paths on every single tool call. The agent forgets, and edits leak back into the main checkout.There is no agent tool to enter or leave a worktree mid-session, no persisted binding between a session and a worktree, and the system prompt always reports the original project root as the working directory even when I expect work to happen elsewhere.
What would a good result look like?
Worktree becomes a first-class session execution context. When the session is bound to a worktree, every surface that touches the working directory (agent tool calls, terminal, file tree, VCS, LSP, watchers, system prompt) defaults to that worktree. When I exit the worktree the session goes back to the project root cleanly. Closing PawWork and reopening it later restores the same active worktree.
The detailed v3 design lives in the pinned design comment below.
What would count as done?
EnterWorktreeandExitWorktreetools that bind / unbind the active session to a worktree.bash,read,write,edit,glob,grep, etc.) resolves relative paths from the active worktree by default.activeDirectoryof any open session (definition in the design comment).EnterWorktree(name=...)(creating a managed worktree) requires.worktrees/to be in.gitignore; PawWork prompts to add it (creates.gitignoreif missing) on the first such attempt and writes the line unstaged on consent. Declining fails the creation with a clear message asking the user to handle ignore manually.EnterWorktree(path=...)(entering an existing worktree elsewhere) does not need this check.executionContext; loading them backfillsownerDirectory = activeDirectory = Project.directorywith no active worktree, no warning. The synthesized field is written back on first load.What should stay out of scope?
ExitWorktreethenEnterWorktree.EnterWorktree; new worktrees branch from project rootHEAD.ExitWorktreedoes not clean up, merge, or open PRs.git worktree adddoes not touch the main checkout).Which audience does this matter to most?
Both
Extra context
EnterWorktree/ExitWorktree(Add ExitWorktree tool to complement EnterWorktree anthropics/claude-code#29436), Codex App Handoff (https://developers.openai.com/codex/app/worktrees/), Cursor 3 Agents Window worktrees.packages/opencode/src/worktree/index.ts,packages/opencode/src/project/instance.ts,packages/app/src/**.