[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:

  1. 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 /rename again.
  2. 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

  1. Start a Claude Code session
  2. Run /rename to set a custom session name (e.g., "auth-refactor")
  3. Confirm the name appears in the input area
  4. Run /clear
  5. Observe: The session name set by /rename is gone — the input area no longer shows the custom name
  6. Start a new conversation on a different topic
  7. Observe: The terminal tab title also does not update to reflect the new conversation context

Expected Behavior

  • /rename session 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

  • /rename session name: Lost after /clear. User must run /rename again.
  • Terminal tab title: Lost after /clear and does not regenerate for new conversations.

Related Issues

  • #16353 (closed) — Reset terminal title to default on /clear command
  • #27329 (open) — /rename session 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗