Support project-scoped worktrees in monorepos

Resolved 💬 3 comments Opened Feb 25, 2026 by yehudam-wix Closed Mar 1, 2026

Problem

In a monorepo, EnterWorktree always creates a worktree at the git repo root level. This means the entire monorepo gets a worktree, even when working on a single project subdirectory.

Additionally, WorktreeCreate / WorktreeRemove hooks are only invoked outside of git repositories. When inside a git repo, the built-in behavior takes over and the hooks are ignored. This means there's no way to customize worktree creation for monorepo use cases.

Expected Behavior

One or both of:

  1. WorktreeCreate/WorktreeRemove hooks should be invoked even inside git repos, allowing users to override the default worktree location. This would let monorepo users create worktrees scoped to their project subdirectory.
  1. EnterWorktree should support a project-scoped mode, where the worktree is created relative to the current working directory (the project) rather than the repo root.

Use Case

Working in a monorepo structured like:

repo-root/
  serverless/
    project-a/    ← working here
    project-b/
    project-c/

When running EnterWorktree from project-a, the worktree is created at repo-root/.claude/worktrees/<name> containing the full monorepo. Ideally it would be scoped to project-a/.claude/worktrees/<name> or at least allow hooks to control this.

Workaround Attempted

Configured WorktreeCreate hook in .claude/settings.local.json to create the worktree under the project directory — but the hook is never called because the tool detects a git repo and uses its built-in behavior.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗