Hermes Agent can't find .env, .venv, or dependencies after using --worktree, usually not because the worktree is broken, but because these files are ignored by git and not automatically copied to the new isolated worktree. The solution is to add .worktreeinclude to the repository root.
Why it happened
The purpose of a worktree is to allow multiple agents to modify code in parallel without interfering with each other. It creates a new worktree based on the Git repository, but the files ignored by .gitignore do not belong to the repository content, such as local keys, virtual environments, dependent caches, and private configurations.
Recommended writing
Create a .worktreeinclude in the project root directory and write the local files that must be copied line by line:
.env.venv/node_modules/apps/web/.env.local
Pay attention to the safety boundary
Not all keys should be copied to parallel agents. If a worktree is only responsible for front-end styling, it should not be given a production database key. You can prepare a stripped-down .env.local that only contains test environments or read-only permissions.
In addition, worktree is suitable for parallel code tasks and is not suitable for long-term identity isolation. Profile should be used for long-term role differences, and worktree should be used for code change isolation. After separating the two, Hermes multitasking collaboration will be much more stable.