[BUG] Agent view: Ctrl+X delete on Completed sessions doesn't persist — rows reappear at bottom of Completed; sessions double-rendered (2.1.204)

Status Fixed / completed
Reported on v2.1.204
Maintainer reply ✓ Yes — bogini
Activity 5 comments · opened Jul 8, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bogini, collaborator) responded on this thread — see the highlighted reply below.

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

In agent view (claude agents), pressing Ctrl+X twice on a stopped/completed session removes the row momentarily, but it reappears at the bottom of the Completed group on the next render. There is no way to shrink the Completed list from the TUI. This worked correctly on a prior version and regressed after an auto-update.
Additionally, the same session is rendered more than once in a single frame (e.g. clearpath robotiq gripper addition, drp_deploy to tianji jetson, and new clearpath datagen pipelines each appear twice), and the row count in the view substantially exceeds the number of jobs on disk. This points to agent view enumerating sessions from multiple stores without de-duplication, and the delete only clearing one representation while another store re-derives the row.
The trigger appears to be a daemon restart from a mid-session auto-update: claude daemon status reported one background worker "from a different CLI version" immediately before all historical sessions flooded into the view.

What Should Happen?

Ctrl+X twice on a session removes it from agent view and it stays removed (transcript retained on disk for claude --resume, per the documented behavior). Each session renders exactly once.

Error Messages/Logs

Steps to Reproduce

Run claude agents in the linux terminal and try to delete an existing session using ctrl+x (twice)

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.204

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

4 Comments

Rorke76753 · 1 month ago

Suffer the same issue.

  • My Completed group showed ~50 rows, but claude agents --json --all returned only the 9

daemon-managed background sessions. The other ~40 were plain interactive sessions that were
never backgrounded — which per the agent-view docs shouldn't be listed at all.

  • The re-deriving store is the transcript directory: moving 105 stale .jsonl files out of

~/.claude/projects/<project-slug>/ removed exactly those rows from the view (daemon-managed
sessions and memory/ untouched, rows stayed gone).

  • One difference from OP: on these interactive-history rows Ctrl+X is a complete no-op for me —

not even a momentary removal — suggesting the delete action isn't wired to the transcript-derived
rows at all. On real daemon-managed rows it works.

  • Since they're absent from --json, there's no id for claude rm either; with the default

cleanupPeriodDays (30) the list regrows to a full month of session history with no way to
clear it from the TUI.

Rorke76753 · 1 month ago

only the session with error can remove with ctrl + x

peter-tu-zynkr · 1 month ago

Hitting this too on v2.1.204, macOS (Darwin 25.5). Adding a data point that points at the persistence/render layer rather than on-disk state.

Symptom: My claude agents "Completed" section shows ~50 rows, many of them old one-off sessions ("chat", "new chat", "sales-pitch", "kb header layout comparison", etc.) going back ~5 days. Pressing Ctrl+X twice on any of them does nothing — the row stays put.

What I found digging into it:

  • claude agents --json --all returns only 13 session records — i.e. the authoritative list is 13, but the TUI renders ~50. The extra ~37 rows have no backing record, which is why Ctrl+X can't remove them (nothing to delete).
  • On disk, ~/.claude/jobs/ contained several orphaned job folders holding only an empty tmp/ and no state.json — the leftover shells of sessions whose state.json had already been stripped (consistent with #75623's description of the incomplete Ctrl+X teardown). These dirs were dated up to a month old.
  • I manually rm -rf'd those 7 orphan job folders — and the phantom rows still remained in the claude agents view.

That last point is the key one: since removing the on-disk remnants did not clear the rows, the stale entries are being held in the agent-view/daemon in-memory list, not read fresh from disk on each render. So a reliable fix probably needs the view (or daemon) to rebuild its Completed list from the authoritative session records rather than accumulating rows that never get evicted.

Happy to provide more detail (roster.json, jobs dir listing) if useful.

bogini collaborator · 1 month ago

Thanks for the clear report — both parts are real.

For the long list of old entries in the Completed group: quit claude and start it again — no update needed. If it's still there on the first try, one more restart clears it.

Ctrl+X not sticking and rows rendering twice is fixed and will be in an upcoming release.

Consolidating #75557 here.

Showing cached comments. Read the full discussion on GitHub ↗