Fellowship: quest runner CWD can land in wrong worktree when spawned in parallel
Resolved 💬 1 comment Opened Mar 10, 2026 by justinjdev Closed Mar 10, 2026
Bug
When spawning multiple quest runners in parallel via /fellowship, a quest runner's CWD can end up in another quest's worktree instead of its own. This causes fellowship hooks to read the wrong .fellowship/quest-state.json, breaking gate enforcement for that agent.
Repro
- Start a fellowship with 2+ quests (e.g.,
quest-editorandquest-databases) - Both agents are spawned in parallel via the
Agenttool withrun_in_background: true - Each agent creates its own worktree via
EnterWorktree quest-editorends up with CWD in.claude/worktrees/quest-databasesinstead of.claude/worktrees/quest-editor
Impact
- Fellowship hooks resolve
.fellowship/quest-state.jsonrelative to CWD - The affected agent's gate messages are blocked because hooks see the other quest's state file
- Agent must work around it by using absolute paths and skipping gate enforcement entirely
Expected
Each quest runner's CWD should be its own worktree, regardless of spawn order or parallelism.
Workaround
- Manually advance the affected agent's state file
- Tell the agent to skip
[GATE]prefixed messages and proceed without hook enforcement - Agent uses absolute paths to its own worktree for all file operations
Environment
- macOS (Darwin 25.3.0)
- Claude Code with fellowship plugin
- Two quests spawned in parallel via
Agenttool withrun_in_background: true
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗