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

  1. Start a fellowship with 2+ quests (e.g., quest-editor and quest-databases)
  2. Both agents are spawned in parallel via the Agent tool with run_in_background: true
  3. Each agent creates its own worktree via EnterWorktree
  4. quest-editor ends up with CWD in .claude/worktrees/quest-databases instead of .claude/worktrees/quest-editor

Impact

  • Fellowship hooks resolve .fellowship/quest-state.json relative 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 Agent tool with run_in_background: true

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗