Spawn agents with cwd set to their worktree #86
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When using
/spawn-issuesto implement multiple issues in parallel, the orchestrator creates git worktrees as sibling directories:/path/to/repo/path/to/repo-issue-X,/path/to/repo-pr-YHowever, spawned agents (issue-worker, pr-fixer, code-reviewer) have their cwd locked to the main repo directory. When they try to access files in their worktree, they get permission denied because the worktree path is outside their sandbox.
Current Behavior
The agents get stuck in infinite retry loops.
Expected Behavior
Agents should be spawned with their cwd set to the worktree they'll be working in:
Proposed Solution
cwdparameter to set the agent's working directoryWorkaround
For now, worktrees could be created inside the repo (
.worktrees/pr-49), but this loses the clean isolation of sibling directories.Affected Skills
is it maybe smarter to have the coordinator part in spawn-issues be the one to set up the worktrees for the background agents and clean them up after?