Skip to content

write-handoff.sh's git-root fallback (#743) conflicts with subdirectory-project support (#754), sending handoffs to the wrong store #776

Closed

Description

@fdaviddpt

What

scripts/write-handoff.sh:74-85 (2e7ee05, #743) resolves the handoff target via a git-root fallback, but never maps a SessionStart running from a subdirectory to the project's own store the way scripts/lib-memory-dir.sh:87-136 / :260-263 do — subdirectory projects are a supported shape per tests/test_injection_guard_754_755_756.py:230-283.

Impact

When Claude is started in repo/pkg, SessionStart reads repo/pkg/.remember, but /remember now writes to repo/.remember/ (or the repo root's {slug} store in external mode):

  • It reads the repo root's tmp/handoff-path hint, so it can overwrite the repo-root project's own pending, undelivered handoff.
  • mkdir -p at :194 creates repo/.remember with no protective .gitignore (bootstrap does not run on this path), so the note sits untracked in the parent repo.
  • The same misroute happens for any non-git project nested under a $HOME that is itself a git work tree — the handoff goes to ~/.remember.

The script does print "Wrote handoff to: ", so this is visible rather than silent.

Fix

Route write-handoff.sh's target resolution through the same subdirectory-aware logic lib-memory-dir.sh already uses.

How to verify

Run write-handoff.sh from repo/pkg with CLAUDE_PROJECT_DIR unset and check which remember.md changed. tests/test_write_handoff_pwd_root_743.py only covers a cwd at the project root and does not cover this case.

Found by the release-auditor during the round-1 audit of v0.34.0..HEAD. Ranked fails-to-preserve, non-blocking.

[AI-generated]

Activity

  1. added
    priority:medium
    filed-by-loop
    lane-capture
    on Sep 25, 2026
  2. self-assigned this
    on Sep 26, 2026
  3. added a commit that references this issue on Sep 26, 2026
  4. removed their assignment
    on Sep 26, 2026
  5. added 2 commits that reference this issue on Sep 28, 2026
  6. added 3 commits that reference this issue on Oct 31, 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

    filed-by-looplane-capturepriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions