Skip to content

Know Codex's and Cursor's worktrees; open the README on the install - #2

Merged
lperrin merged 1 commit into
mainfrom
coding-agents-and-readme
Nov 2, 2026
Merged

lperrin merged 1 commit into
mainfrom
coding-agents-and-readme

Conversation

@lperrin

@lperrin lperrin commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Why

Three things from review: the README should open with how to install, it shouldn't read as one person's setup (zsh, macOS), and wt should know Codex's worktrees the way it knows Claude Code's. Other agents should be one line to add.

What

Coding agents. wt knew Claude Code's worktrees only by the lock it takes while running in one. It now knows which agent made each worktree and which agent is running in it, for Claude Code, Codex and Cursor:

  • Claude Code's worktrees live in the repo under .claude/worktrees/. Codex's live in $CODEX_HOME/worktrees/<4-hex bucket>/<repo> (or the root desktop.git-worktree-root sets in its config.toml), with detached HEADs, and Codex marks each with codex-thread.json in its git directory; both signals are used. Cursor's live in ~/.cursor/worktrees (as users report; Cursor doesn't document it). All of this is one AGENTS table.
  • Codex names every worktree after the repo, so wt shows them as codex/<bucket>, which is also what you type to reach them.
  • After the first render, the agents' processes tell which worktree each is running in: /proc on Linux, ps then lsof on macOS (lsof names Claude's process after its versioned binary, so ps resolves names and lsof only the directories). About 75ms, in the background like the statuses. Claude Code's lock still works without it.
  • In the list: ◆ codex (magenta) when an agent runs in the worktree, ◇ codex (dim) when it made it and left. Delete is blocked while any agent runs in it; the confirmation notes a worktree an agent made.

README. Opens on the install command, then requirements and what the installer does. The shell and system wording covers bash and zsh, macOS and Linux evenly; the sample picker is a generic repo. A "Coding agents" section explains the markers.

Verified: the live check found the three Claude Code sessions running in front's worktrees; a simulated Codex layout (bucket, detached worktree, marker) lists and jumps as codex/ab12. 27 tests, including the new ones on the agent functions.

🤖 Generated with Claude Code

wt knew Claude Code's worktrees by the lock it takes while running in one.
It now knows which agent made each worktree and which agent runs in it:

- Claude Code's live in the repo, under .claude/worktrees/; Codex's in
  $CODEX_HOME/worktrees/<bucket>/<repo> (or desktop.git-worktree-root from
  its config.toml), detached and marked with codex-thread.json in their git
  directory; Cursor's in ~/.cursor/worktrees. Codex names every worktree
  after the repo, so wt names them codex/<bucket>.
- After the first render, the agents' processes say which worktree each is
  running in: /proc on Linux, ps and lsof on macOS. ◆ marks a worktree an
  agent runs in (it can't be deleted from wt), ◇ one an agent made and left.
- AGENTS is the table to add one to.

The README opens on the install, and reads the same whatever the shell or
system. Version 0.2.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@lperrin
lperrin merged commit 973606a into main Nov 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant