[FEATURE] Reset terminal title to default on /clear command
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
When using /clear to start a fresh session, Claude Code retains the previous session's terminal title (e.g., * Previous Task Name). This creates confusion because:
- The terminal title no longer reflects the current session's purpose
- When managing multiple terminal tabs, stale titles make it difficult to identify which tab contains which work
- The
/clearcommand resets conversation context but leaves visual artifacts from the previous session
This is part of a broader pattern where /clear doesn't fully reset session state (see related issues below).
Proposed Solution
When /clear is executed, Claude Code should reset the terminal title to a sensible default state. Options include:
- Reset to generic default (e.g.,
claudeorClaude Code) - Reset to working directory (e.g.,
claude - projectname) - Clear title entirely (let the terminal's default title behavior take over)
The simplest implementation would emit the appropriate OSC escape sequence to reset/clear the title when /clear runs.
Alternative Solutions
Workaround: SessionEnd hook
Add this to ~/.claude/settings.json to reset the terminal title on /clear or exit.
macOS / Linux:
{
"hooks": {
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "printf '\\033]0;\\007' > /dev/tty"
}
]
}
]
}
}
Windows (Command Prompt) - untested:
{
"hooks": {
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c title Command Prompt"
}
]
}
]
}
}
Workaround: Manual reset
Run this command to reset the title during a session:
printf '\033]0;\007'
Or set a custom title:
printf '\033]0;My Title\007'
Workaround: Disable title changes entirely
Prevent Claude Code from ever modifying the terminal title:
{
"env": {
"CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
}
}
While these workarounds exist, built-in support would provide a more consistent and discoverable experience.
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
After /clear, terminal tabs retain stale titles from previous tasks, making multi-tab navigation unreliable.
Additional Context
This is part of a broader pattern where /clear doesn't fully reset session state:
- #16217 - Status line shows 102% after /clear command
- #16189 - /clear does not reset context_window.total_input_tokens in statusline JSON
- #14913 - Status line doesn't refresh context tokens after /clear
Related terminal title issues:
- #7229 - Terminal window title settings (general title customization)
- #11554 - Terminal title not updated on resume/foreground
- #3396 - Disable terminal name changing (introduced
CLAUDE_CODE_DISABLE_TERMINAL_TITLE)
Ideally, /clear would provide a complete reset of all session-specific visual state, including both the status line metrics and the terminal title.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗