Skip to content

Include session name in terminal tab title after /rename #23998

Description

@superfluidic

Summary

When a session is renamed via /rename, the terminal tab title should include the custom name (e.g. Ohm — Claude Code instead of ⠐ Claude Code).

Current Behavior

Claude Code continuously sets the terminal tab's custom title property to ⠐ Claude Code (with rotating spinner). This overwrites any externally set title on every tick.

Attempted Workarounds (all failed)

Approach Result
SessionStart hook with ANSI \033]0;title\007 to stdout Captured by Claude Code, never reaches terminal
Same escape sequence to /dev/tty Immediately overwritten by Claude Code's title loop
osascript setting Terminal.app custom title + title displays custom title Overwritten — Claude Code resets custom title on every spinner tick

Investigation

  • /rename Ohm stores a custom-title event in the transcript JSONL: {"type": "custom-title", "customTitle": "Ohm", "sessionId": "..."}
  • The SessionStart hook payload includes transcript_path but not the session name
  • Terminal.app confirms Claude Code owns the title: custom_title=⠐ Claude Code | displays_custom=true

Proposed Solution

When customTitle is set, include it in the terminal title string that Claude Code manages:

⠐ Ohm — Claude Code

Or at minimum, expose customTitle in the SessionStart hook payload so users can set it themselves (though this still requires Claude Code to not overwrite it).

Environment

  • Claude Code 2.1.36
  • macOS (Terminal.app, _GreenCRT profile)
  • Hook type: SessionStart command hook

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions