Skip to content

#721 tracked-handoff guard is bypassed when Claude starts from a repo subdirectory #754

Closed

Description

@fdaviddpt

Found by the v0.34.0 release audit (round 2, finding N1). The release shipped with it by maintainer override: it is a gap in a guard v0.33.0 did not have at all, not a regression.

scripts/session-start-hook.sh (~:1831, _remember_handoff_is_tracked) decides "is this a git checkout" by testing for .git directly in the project/memory-project directory. When Claude Code is started from a subdirectory of a repository (e.g. repo/pkg/), .remember/ resolves to repo/pkg/.remember/. There is no .git there, so the guard returns "not tracked", and a repository-committed pkg/.remember/remember.md is injected as === LAST HANDOFF ===.

Fix direction: ask git about the file itself (e.g. git -C "$(dirname "$file")" ls-files --error-unmatch -- "$(basename "$file")") instead of testing for .git in one fixed directory. That also covers worktrees and submodules without special cases. Test-first: a tracked handoff under a subdirectory project must not be injected. Positive control: an untracked one is still delivered.

Related: #747 (same guard, worktree case). The same audit also reported the guard only matches the handoff file by name, and that identity.md is still anchored on the worktree path; those are filed separately.

[AI-generated]

Activity

  1. added
    filed-by-loop
    cohort-13
    on Sep 25, 2026
  2. added a commit that references this issue on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cohort-13filed-by-loop

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions