Skip to content

Main-guard doesn't recognize worktree session - blocks all edits #117

Description

@Jaggerxtrm

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

  1. User runs bd update <id> --claim
  2. Session-flow creates worktree at .worktrees/<id>
  3. User tries to edit a file
  4. Main-guard sees main branch and blocks: "start on a feature branch"
  5. User has NO way to work in the worktree (Pi doesn't support cd to worktree)

Expected Behavior

Main-guard should:

  1. Check for .xtrm-session-state.json at cwd
  2. If worktreePath exists, allow edits (or redirect to worktree)
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions