Skip to content

A seeded .claude/settings.json keeps its $CLAUDE_PROJECT_DIR hook, so worktree runs receive zero hook events #352

Description

@Pawel-N-pl

install.py:567 registers the claude hook as:

{interp} "$CLAUDE_PROJECT_DIR"/.bmad-loop/bmad_loop_hook.py <event>

When provision_worktree seeds .claude/settings.json — which is itself the hook config_path
the file arrives in the worktree already carrying the main repo's command. In the worktree
that variable resolves to a nonexistent <worktree>/.bmad-loop/bmad_loop_hook.py.

merge_hooks is a no-op when a marked hook already exists, so the broken relative command
survives re-registration. The session then emits no hook events at all, and the run stalls until
the session clock runs out — with no error, because from the orchestrator's side the session is
simply idle.

Claude dialect only: codex and gemini expose no $CLAUDE_PROJECT_DIR equivalent to hook commands
(noted at install.py:568) and are unaffected.

Expected

A worktree's hook config points at the main-repo relay.

Actual

It points at a path that does not exist; zero hook events reach the orchestrator.

Environment

bmad-loop 0.9.0, claude adapter, Linux (WSL2), worktree isolation on.

I have a fix with tests and will open a PR against this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions