Empty sessions after /clear appear in --resume picker as "(session)"
Resolved 💬 4 comments Opened Mar 1, 2026 by richard-scott Closed Apr 6, 2026
Bug Description
After using /clear in a session and then exiting, the empty post-clear session appears in the --resume / claude -r picker with the label (session). These accumulate over time and clutter the resume list, making it harder to find real sessions.
Steps to Reproduce
- Start a Claude Code session
- Have a conversation (so there's a real session)
- Run
/clear - Exit Claude (e.g.,
/exitor Ctrl+C) - Run
claude -rto open the resume picker
Expected Behavior
The empty session created after /clear should not appear in the resume picker. Sessions with no user messages have nothing to resume.
Actual Behavior
A new entry labelled (session) appears in the resume picker. Each /clear + exit cycle adds another one, expanding the list with useless entries.
Suggested Fix
Either:
- Don't persist sessions that contain no user messages
- Filter out empty sessions from the
--resumepicker - Don't create a new session on
/clearuntil the user actually sends a message
Environment
- Claude Code CLI (latest)
- Linux (also likely affects macOS/Windows)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗