# Filter out stale worktree paths from branch listing · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/94420192359d68c03241f03f47cf8d670abafa15)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 94420192359d68c03241f03f47cf8d670abafa15

Requested commit: 94420192359d68c03241f03f47cf8d670abafa15

Commit: 94420192359d68c03241f03f47cf8d670abafa15

Tree: 92c5841054415f1d8a25830cab2d3ac21e30ff80

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
Filter out stale worktree paths from branch listing

Worktrees in /tmp or other ephemeral locations get cleaned by the OS
but remain in git's worktree list as "prunable". These stale entries
caused branches to show a worktree label pointing at a non-existent
directory, leading to broken state when selected.

Now validates each worktree path with existsSync before including it
in the branch→worktreePath map.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

```

## Parents

- [cf66f53a5559be6f0117118e07793acf35ea170b](https://git.cafe/pingdotgg/t3code/commit/cf66f53a5559be6f0117118e07793acf35ea170b?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/94420192359d68c03241f03f47cf8d670abafa15?format=markdown)
