[FEATURE] /clear creates a new session, causing clutter in claude --resume session list
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Every /clear invocation creates a new session instead of
resetting the context within the current one. Over time this
fills the claude --resume session list with empty, obsolete
entries that the user never intentionally ended, making it hard
to find real sessions worth resuming. There is currently no
way to clear conversation context without this side effect, and
no in-app mechanism to delete or archive sessions from the
resume list.
Proposed Solution
● Add an option to reset conversation context in-place without creating a new session. This could take one of two forms:
- A flag on the existing command (/clear --keep-session) that wipes history while preserving the current session ID.
- A change to the default behavior of /clear so it resets context in-place, with an explicit /clear --new-session flag
for those who want the current behavior.
Additionally, a /sessions management command would allow users to delete or archive individual sessions from within
Claude Code, removing the need to manipulate files under ~/.claude/ manually.
Alternative Solutions
- Exit and restart manually — the user exits Claude Code and relaunches without --resume, accepting that the old session
stays in the list and accumulates over time. Does not scale.
- Manual filesystem cleanup — delete obsolete session files directly from ~/.claude/ after each /clear. Works but
requires leaving Claude Code and knowing the internal storage layout, which is an implementation detail users should not
need to know.
- Session aliasing / pinning — let users assign a name or pin to a session so that --resume can filter or sort by it,
making clutter less disruptive without removing the underlying entries.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
A developer working on a long-running project uses claude --resume daily to continue where they left off. During a
session they hit /clear to start a fresh context — for example, after finishing one task and moving to a completely
unrelated one — without intending to abandon the session. After a few weeks of normal use, claude --resume shows dozens
of unnamed, empty sessions alongside the real ones, with no way to tell them apart. Finding the right session to resume
requires scrolling through the full list and guessing by timestamp.
Additional Context
_No response_