Symptom
Running backpass scan in a repo whose working tree has a .git file pointing at an external git dir (created with git init --separate-git-dir ~/repo.git, or by tools that keep the git dir outside a synced folder — my case is an Obsidian vault in iCloud) associates zero transcripts. Every Claude Code session for that repo lands in .backpass/scan-cache.json with tier: null, even though each transcript's cwd is exactly the repo root.
Cause
listWorktrees() in src/repo.js builds the candidate list purely from git worktree list --porcelain. For a main worktree with an external git dir, git reports the git dir path as the worktree line, not the working tree:
$ cd ~/vault && git worktree list --porcelain
worktree /Users/me/.vault.git
HEAD ...
branch refs/heads/main
So listWorktrees(root) returns ['/Users/me/.vault.git'], tier-1 association (realpath(cwd) ∈ repo.worktrees) never matches, and tier 3 only kicks in for paths that no longer exist. Setting core.worktree doesn't change git's output either.
Repro with backpass's own code:
import { listWorktrees } from "backpass/src/repo.js";
import { associate } from "backpass/src/discovery/association.js";
const root = "/Users/me/vault"; // has a .git *file*
listWorktrees(root); // → ['/Users/me/.vault.git']
associate({ cwd: root }, { worktrees: listWorktrees(root) }); // → null
Fix
Seed the worktree list with realpathOrSelf(root) so the working tree is always a candidate (the Set dedups the normal case). PR incoming with a regression test using git init --separate-git-dir.
Tested on backpass 0.1.22, git 2.x, macOS.
Symptom
Running
backpass scanin a repo whose working tree has a.gitfile pointing at an external git dir (created withgit init --separate-git-dir ~/repo.git, or by tools that keep the git dir outside a synced folder — my case is an Obsidian vault in iCloud) associates zero transcripts. Every Claude Code session for that repo lands in.backpass/scan-cache.jsonwithtier: null, even though each transcript'scwdis exactly the repo root.Cause
listWorktrees()insrc/repo.jsbuilds the candidate list purely fromgit worktree list --porcelain. For a main worktree with an external git dir, git reports the git dir path as theworktreeline, not the working tree:So
listWorktrees(root)returns['/Users/me/.vault.git'], tier-1 association (realpath(cwd) ∈ repo.worktrees) never matches, and tier 3 only kicks in for paths that no longer exist. Settingcore.worktreedoesn't change git's output either.Repro with backpass's own code:
Fix
Seed the worktree list with
realpathOrSelf(root)so the working tree is always a candidate (theSetdedups the normal case). PR incoming with a regression test usinggit init --separate-git-dir.Tested on backpass 0.1.22, git 2.x, macOS.