{"version":"2.1.330","anchor":"non-git-worktree-directories-get-version-control-guidance-in","canonical_anchor":"non-git-worktree-directories-get-version-control-guidance-in","heading":"Worktrees can now come from a mod, including in projects that do not use git","tier":"notice","area":"Agents","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.330\/e\/non-git-worktree-directories-get-version-control-guidance-in","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.330","markdown":"### Worktrees can now come from a mod, including in projects that do not use git\n\nWorktree isolation now works when a mod or hook supplies the copy, even outside git, with reworded prompts, errors and cleanup\n\n**What**\n\nA worktree is a separate working copy of a project. Claude Code can give one to a helper agent so that agent's edits stay apart from yours. Before this release, worktree mode needed a git repository or a `WorktreeCreate` hook, which is your own script that makes the copy. A mod, meaning a user-written add-on, can now supply worktrees too. Prompts, error messages and cleanup were reworked around this.\n\n- The worktree mode check now waits for the mod loader. If the installed mod is not loaded, it fails with a new message saying worktree mode needs a git repository, `WorktreeCreate` hooks or a mod.\n\n- A new section of the worker prompt says a folder that is not a git repository still supports `isolation: \"worktree\"` when a mod or hook makes the worktrees. In that case git and gh do not work, so workers commit and publish with the project's own version control and finish with `PR: none`. Phase 3 counts such a worker as done.\n\n- The Agent tool's `isolation` setting is now one shared definition with a new description covering \"worktree\" and \"remote\". \"remote\" runs the agent in a cloud environment, always in the background, and is only offered to some users. The \"worktree\" description says a project without version control that can make worktrees gets its own label in the folder.\n\n- Workflow web-fetch agents with `isolation: 'worktree'` now get their copy through the hook-based creator, which may hand back a copy made in place. Their prompt then says \"worktree\" or \"project\" instead of \"git worktree\" or \"repo\", and each agent gets an agent ID assigned in advance.\n\n- The error for a returned path that is not a folder now names `WorktreeCreate` for the ordinary hook, or the other provider by name, and ends with \"answering\" instead of \"echoing\".\n\n- The symlink error now names the `vcs.isolate` hook when a mod made the copy. That part is left out when you entered a worktree that already existed.\n\n- The error \"Cannot create agent worktree: not in a git repository and no WorktreeCreate hooks are configured.\" can now use a default hint when an optional flag is set and no hook hint exists. When there is no hint, the text is the same as before.\n\n- The safety checks for hook-made worktrees moved into one shared function.\n\n- The `git branch -D` call that deletes a branch was replaced by a helper.\n\n- Worktree creation accepts new `newIn` and `skipsSetup` options.\n\n- Cleanup of stale worktrees now skips a worktree whose recorded path still exists.\n\n**Why**\n\nA project that does not use git can now give helper agents their own working copies, as long as a mod or a hook makes those copies. The messages now say which kind of provider made the copy, which helps when something goes wrong. The cleanup change means a stale worktree is left in place if its folder is still there.\n\n- Area: Agents\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}