Problem
When a user claims an issue and a worktree is created, the main-guard extension still blocks all file edits because it checks the branch at ctx.cwd (which is main) instead of recognizing the worktree session.
Current Behavior
- User runs
bd update <id> --claim
- Session-flow creates worktree at
.worktrees/<id>
- User tries to edit a file
- Main-guard sees
main branch and blocks: "start on a feature branch"
- User has NO way to work in the worktree (Pi doesn't support cd to worktree)
Expected Behavior
Main-guard should:
- Check for
.xtrm-session-state.json at cwd
- If worktreePath exists, allow edits (or redirect to worktree)
- Or session-flow should change ctx.cwd to worktree path
Workaround
None currently - users are blocked entirely
Related
- Discovered in: jaggers-agent-tools-hehp (Pi parity test)
- Affects: Pi runtime (Claude users can manually cd to worktree)
Problem
When a user claims an issue and a worktree is created, the main-guard extension still blocks all file edits because it checks the branch at
ctx.cwd(which ismain) instead of recognizing the worktree session.Current Behavior
bd update <id> --claim.worktrees/<id>mainbranch and blocks: "start on a feature branch"Expected Behavior
Main-guard should:
.xtrm-session-state.jsonat cwdWorkaround
None currently - users are blocked entirely
Related