# NousResearch/hermes-agent · Preserve dirty worktrees on session exit

## Open now

- Nothing open on GitHub.

These items address a bug where exiting a worktree session incorrectly deletes worktrees containing uncommitted or untracked changes, contrary to documented behavior. The work involves fixing the cleanup logic to retain dirty worktrees.

## TL;DR

- 3 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #130595. Verify it addresses your case.
- **Recommended:** read PR #130595 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-130595`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.67`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #129482: worktree: true exit cleanup deletes worktrees with uncommitted/untracked changes (docs say dirty trees are kept)

## Prior & competing PRs

- **#130595: fix(cli): exiting a \`--worktree\` session keeps the worktree when it has uncommitted changes (#129482, salvage #129489)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `cli.py`, `hermes_cli/kanban_db_workspace.py`, `hermes_cli/worktree_ops.py`, `locales/af.yaml`, `locales/ar.yaml`, `locales/de.yaml`, `locales/en.yaml`, `locales/es.yaml`, `locales/fr.yaml`, `locales/ga.yaml`, `locales/hu.yaml`, `locales/it.yaml`, `locales/ja.yaml`, `locales/ko.yaml`, `locales/pt.yaml`, `locales/ru.yaml`, `locales/tr.yaml`, `locales/uk.yaml`, `locales/zh-hant.yaml`, `locales/zh.yaml` (+2 more)
- **#129489: fix(cli): preserve dirty session worktrees**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `a567c3ac0c`, `#130595`

## Fix status

- Merged to main in PR #130595 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-10-01`.
