However, 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
Agent spawned with cwd: /path/to/aether
Agent tries: cd ../aether-pr-49 or Read /path/to/aether-pr-49/file.go
Result: "Permission denied (prompts unavailable)"
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:
The Task tool should accept an optional cwd parameter to set the agent's working directory
The spawn-issues skill should pass the worktree path as cwd when spawning workers/fixers/reviewers
Workaround
For now, worktrees could be created inside the repo (.worktrees/pr-49), but this loses the clean isolation of sibling directories.
Affected Skills
spawn-issues
issue-worker
pr-fixer
code-reviewer
## Problem
When using `/spawn-issues` to implement multiple issues in parallel, the orchestrator creates git worktrees as sibling directories:
- Main repo: `/path/to/repo`
- Worktrees: `/path/to/repo-issue-X`, `/path/to/repo-pr-Y`
However, 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
```
Agent spawned with cwd: /path/to/aether
Agent tries: cd ../aether-pr-49 or Read /path/to/aether-pr-49/file.go
Result: "Permission denied (prompts unavailable)"
```
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:
```
Agent spawned with cwd: /path/to/aether-pr-49
Agent tries: Read file.go
Result: Success
```
## Proposed Solution
1. The Task tool should accept an optional `cwd` parameter to set the agent's working directory
2. The spawn-issues skill should pass the worktree path as cwd when spawning workers/fixers/reviewers
## Workaround
For now, worktrees could be created inside the repo (`.worktrees/pr-49`), but this loses the clean isolation of sibling directories.
## Affected Skills
- spawn-issues
- issue-worker
- pr-fixer
- code-reviewer
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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?