If Codex Desktop stops creating remote worktrees after an SSH reconnect, fully quit and reopen the app. That restored worktree creation in my tests. If idle SSH drops are what trigger the problem for you, client-side keepalives may help you run into it less often.
Check whether you’re seeing the same bug
I reproduced this on macOS with Codex Desktop 26.1117.41037 and Codex CLI 0.171.0 on the SSH host.
- Open Codex Desktop and connect to an SSH host with a Git project.
- Ask Codex to use
create_threadto start a disposable chat in a managed worktree. On the initial SSH connection, both the chat and worktree appeared. - Disconnect and reconnect the SSH host while leaving Desktop open.
- Repeat the same request against the same project.
After reconnecting, Desktop accepted the request and returned a temporary clientThreadId, but no new chat or Git worktree appeared. The host still showed Connected, and I could still list its chat history. That’s the clue I found most useful: the connection looked healthy during ordinary reads, while worktree creation failed.
Get back to work
- Fully quit Codex Desktop. On macOS, press
⌘Q. - Reopen Desktop and wait for the SSH host to show Connected.
- Check the project sidebar for the earlier chat before retrying. A temporary ID means setup was requested, so check whether it finished before submitting another request.
- Retry the worktree creation and confirm the new chat is running in the expected checkout. If you want to verify from the chat, ask it to run
hostnameandgit rev-parse --show-toplevel.
In my tests, restarting Desktop restored worktree creation. Disconnecting and reconnecting from Settings → Connections while the app stayed open reproduced the failure.
Reduce idle SSH drops with keepalives
On the Mac running Codex Desktop, first check the settings SSH already uses for your host. Replace my-devbox with the SSH alias you use in Desktop.
ssh -G my-devbox | grep -E '^serveralive(interval|countmax) ' This prints the effective settings without opening a connection. If serveraliveinterval is 0, SSH protocol keepalives are off. To enable them, open ~/.ssh/config on your Mac and add these two lines inside the existing Host my-devbox block:
ServerAliveInterval 30 ServerAliveCountMax 6 Rerun the check. You should see these values, in either order:
serveralivecountmax 6 serveraliveinterval 30 SSH will send a check after 30 seconds without hearing from the server. If the server stays unresponsive, SSH will disconnect after about three minutes. This can help when a router or firewall drops idle connections. OpenSSH keepalive settings
Fully quit and reopen Desktop so the next SSH connection uses the new settings. I verified that SSH picked up both values and Desktop opened a fresh connection. Whether the keepalives reduce disconnects during normal use is still unverified. If worktree creation fails after a future reconnect, fully restart Desktop again.