# fix\(server\): deleting a thread now cleans the worktree its subagents shared · pingdotgg/t3code

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

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

Visibility: public

Requested revision: cb5e876ea53b92e6474fb73b30f75e9952d26684

Requested commit: cb5e876ea53b92e6474fb73b30f75e9952d26684

Commit: cb5e876ea53b92e6474fb73b30f75e9952d26684

Tree: 9327ccd784e2a90165fc90744c34ebf7461e97dd

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): deleting a thread now cleans the worktree its subagents shared

A deleted thread's remaining native subagent threads counted as other
users of its worktree, so worktreeOnDelete kept it. The deleted thread
now owns its subagent chain's worktree like a live parent does, so
existing orphans are released too, while running subagents, forks and
unrelated threads still keep it.

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

```

## Parents

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

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