Skip to content

fix: stop a background refresh undoing delete/prune/rename - #26

Merged
brtkwr merged 1 commit into
mainfrom
fix/refresh-review-fixes
Sep 23, 2026
Merged

brtkwr merged 1 commit into
mainfrom
fix/refresh-review-fixes

Conversation

@brtkwr

@brtkwr brtkwr commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Fixes from an adversarial review of the auto-refresh change:

  • Deletes, prunes and renames stay put. A background refresh that started before you deleted, pruned or renamed a conversation used to land afterwards and put the old state back for up to a minute. A deleted row could reappear and fail to resume. That refresh is now thrown away, and the next one picks up the real state.
  • A failed refresh keeps the list. Before, if ~/.claude/projects went missing or couldn't be read, the refresh emptied the list. It now counts as a failure and the current list stays.
  • Cheaper refreshes. Conversations whose file hasn't changed keep their search text instead of having it rebuilt. The reviewer measured that rebuild at about 64MB and 173ms every minute, and it no longer runs for unchanged files.
  • Live sessions: prune is refused while the session is open in claude, because anything claude writes during the rewrite would be lost. Delete still works but the confirmation says the session is open.
  • Deleted files are also removed from the parse cache.

Not changed:

  • A hung scan stopping refreshes: a separate timer can't recover from that either, because the stuck scan never finishes.
  • Using the session file's recorded start time to rule out a reused pid: left for later.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JUmkVYwbkobda1AnHuwFDE

From an adversarial review of auto-refresh:
- A scan that started before a delete, prune or rename is dropped when it
  lands, instead of bringing the deleted row, old size or old name back.
- A failed scan (including a vanished ~/.claude/projects) keeps the list
  rather than emptying it; reload now returns an explicit error.
- Unchanged conversations reuse their list item, so a refresh no longer
  rebuilds every conversation's search text (~64MB/173ms per minute).
- Prune is refused on a session open in claude (its writes during the
  rewrite would be lost); delete warns. Deleted files leave the parse cache.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JUmkVYwbkobda1AnHuwFDE
@brtkwr
brtkwr merged commit 0db0c3e into main Sep 23, 2026
1 check 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