t3code icon indicating copy to clipboard operation
t3code copied to clipboard

CLI: read-only way to list which worktree paths threads are bound to (all projects, JSON)

Open ViperJuice opened this issue 1 month ago • 0 comments

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 --json lists one project's threads at a time.
  • Its objects include no worktreePath field, 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, with worktreePath, archived, settled and status per 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.

ViperJuice avatar Nov 01 '26 20:11 ViperJuice