[Bug] /clear resets session name set by /rename and auto-generated terminal tab title
Resolved 💬 3 comments Opened Mar 19, 2026 by TakahiroIKEGAWA Closed Mar 22, 2026
Bug Description
Running /clear resets both:
- Session name set via
/rename: The custom session name displayed in the text input area (top-right corner) disappears after/clear, requiring the user to run/renameagain. - Auto-generated terminal tab title: The terminal tab title that Claude Code auto-generates based on conversation context is also lost and does not regenerate for the new conversation.
Since /clear is meant to clear the conversation context (not end the session), the session name set by /rename should persist across clears. Having to re-rename the session every time after /clear is tedious, especially when managing multiple concurrent Claude Code sessions.
Steps to Reproduce
- Start a Claude Code session
- Run
/renameto set a custom session name (e.g., "auth-refactor") - Confirm the name appears in the input area
- Run
/clear - Observe: The session name set by
/renameis gone — the input area no longer shows the custom name - Start a new conversation on a different topic
- Observe: The terminal tab title also does not update to reflect the new conversation context
Expected Behavior
/renamesession name: Should persist after/clear. The session continues, only the conversation context is cleared.- Terminal tab title: Should reset to default on
/clear, then auto-update based on new conversation context.
Actual Behavior
/renamesession name: Lost after/clear. User must run/renameagain.- Terminal tab title: Lost after
/clearand does not regenerate for new conversations.
Related Issues
- #16353 (closed) — Reset terminal title to default on /clear command
- #27329 (open) —
/renamesession name persists after/clear(Windows) — opposite behavior reported - #31402 (closed) — Terminal title bar not updated when context is cleared and new task starts
- #17073 (closed, duplicate) — /clear should reset terminal title
- #26082 (closed) — Session name persists in status bar after /clear command
Note: #27329 reports the opposite behavior (rename persisting when it shouldn't on Windows). This may indicate platform-inconsistent behavior between macOS and Windows.
Environment
- Claude Code v2.1.79
- Platform: macOS (darwin)
- Terminal: macOS Terminal / iTerm2
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗