Support for a .worktreeinclude file

Feature request for product/service

– Other –

Describe the request

Hi, guys!

Any thoughts on adding support for a .worktreeinclude file? The idea: when work happens in a multi-agent repo and the team uses different harnesses, a shared mechanism is really convenient.

Example .worktreeinclude that copies over everything that is not under Git control:

.cursor
.claude
.codex
.agents

.env
.env.test

The equivalent in .cursor/worktrees.json looks like this:

{
  "setup-worktree-unix": [
    "if [ -d $ROOT_WORKTREE_PATH/.cursor ]; then cp -R $ROOT_WORKTREE_PATH/.cursor .; fi",
    "if [ -d $ROOT_WORKTREE_PATH/.codex ]; then cp -R $ROOT_WORKTREE_PATH/.codex .; fi",
    "if [ -d $ROOT_WORKTREE_PATH/.claude ]; then cp -R $ROOT_WORKTREE_PATH/.claude .; fi",
    "if [ -d $ROOT_WORKTREE_PATH/.agents ]; then cp -R $ROOT_WORKTREE_PATH/.agents .; fi",

    "if [ -f $ROOT_WORKTREE_PATH/.env ]; then cp $ROOT_WORKTREE_PATH/.env .env; fi",
    "if [ -f $ROOT_WORKTREE_PATH/.env.test ]; then cp $ROOT_WORKTREE_PATH/.env.test .env.test; fi",
  ]
}

Pretty verbose, in my opinion :slight_smile:
What do you think?

References for other harnesses:

P. S. If .cursor is in .gitignore, then worktrees.json is not copied and the setup script does not run.

Operating System (if it applies)

MacOS