t3code
t3code copied to clipboard
CLI: read-only way to list which worktree paths threads are bound to (all projects, JSON)
Use case. We run a host-side cleanup tool that removes merged, idle git worktrees. It must never remove a worktree that a T3 thread still uses as its checkout. That includes finished-but-unsettled threads, which have no live process to detect.
Today:
t3 thread list --jsonlists one project's threads at a time.- Its objects include no
worktreePathfield, even though T3 tracks each thread's worktree internally. - There is no
t3 project list.
So the only way to check a path is to read T3's private state database. We'd rather not treat that as a contract.
Ask. A supported, read-only CLI query. Either of these would work:
t3 thread list --all-projects --json, withworktreePath,archived,settledandstatusper thread;- or
t3 worktree bindings --json, returning[{path, threadId, projectId, archived, settled, status}].
It should work against a running server, and ideally offline from the state directory too, without starting a server or creating directories.
Nice to have: document whether archiving a thread is the supported way to release its worktree binding.
Context: Consiliency/dotfiles#201.