[FEATURE] `/new` command to end current session and start a new named session

Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Mar 19, 2026 · closed Aug 17, 2026

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

## Summary

Add a /new slash command that ends the current session and immediately
starts a new named session, without requiring the user to exit and
relaunch Claude Code manually.

## Motivation

When working on multiple unrelated tasks, it's useful to keep each task
in its own named session for easy retrieval via /resume.

Currently, starting a new named session requires:

  1. Typing exit to leave the current session
  2. Running claude -n "session name" in the terminal

This interrupts the flow, especially when switching tasks frequently.

## Related

  • /resume for session management
  • /clear for resetting context within a session

Proposed Solution

## Proposed behavior

/new "session name"

  • Saves and closes the current session
  • Immediately starts a new session with the given name
  • If no name is provided, starts an unnamed new session (equivalent

to current /clear behavior, but as a fresh session)

Alternative Solutions

## Current workaround

  • exit + claude -n "name" from the terminal
  • Shell alias: alias cn='claude -n'

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/31926
  2. https://github.com/anthropics/claude-code/issues/34318
  3. https://github.com/anthropics/claude-code/issues/31220

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

hampsterx · 5 months ago

/clear is destructive to session history

/clear truncates the conversation from the active context, which means those messages are lost from the session transcript entirely. Tools that query session history won't find anything from before the clear.

This makes /new more than a convenience feature. Right now the only way to preserve a conversation AND start fresh is exit + claude -n "name". /new would let you do that without breaking flow, and without silently destroying history the way /clear does.

hampsterx · 5 months ago

Session history trail

This has been requested repeatedly under different framings since Dec 2025. The core issue is that /clear is internally aliased as ["reset", "new"] and creates a fresh session UUID (#37451), but its name implies "wipe context, keep session." That mismatch cascades:

  • /resume can't find the pre-clear conversation (#18311, #24729)
  • /rename names vanish because /clear creates a new session (#33029)
  • Typed input lost during the hidden session transition (#32871)

/new isn't just a convenience shortcut. It's the explicit version of what /clear already does implicitly, but with proper session preservation and naming. Splitting the two would fix the semantic confusion and all the downstream bugs in one go.

Showing cached comments. Read the full discussion on GitHub ↗