Allow configuring terminal tab/window title

Resolved 💬 4 comments Opened Mar 9, 2026 by dzins Closed Apr 10, 2026

Problem

When Claude Code starts, it sets the terminal tab/window title to "Claude Code", overriding any user-configured title. This is problematic for users who:

  • Use multiple terminal tabs for different projects and rely on the tab title to distinguish them
  • Have shell hooks (e.g., zsh precmd) that set the tab title to the git repo name or current directory
  • Set DISABLE_AUTO_TITLE="true" in their shell config — Claude Code ignores this

The title override persists throughout the session. Since Claude Code sandboxes Bash commands (no /dev/tty access), there's no workaround via hooks or escape sequences.

Attempted workarounds (none work)

  1. DISABLE_AUTO_TITLE="true" in .zshrc — Claude Code bypasses this since it sets the title via its own escape sequences, not through the shell
  2. iTerm2 "Applications in terminal may change the title" unchecked — This also blocks the user's own precmd title hook, and Claude Code's title still shows (as "node" instead)
  3. Claude Code PostToolUse hook with escape sequence — Bash commands are sandboxed and cannot write to /dev/tty
  4. zsh precmd function — Only runs when zsh draws a prompt, which doesn't happen while Claude Code's TUI is active

Proposed solution

Add a tabTitle setting in settings.json (or similar) that lets users configure what the terminal title should be set to. For example:

{
  "tabTitle": "${projectName}"
}

Supported variables could include:

  • ${projectName} — basename of the working directory or git repo root
  • ${branchName} — current git branch
  • none — don't set the title at all (respect the user's shell/terminal config)

Alternatively, a simpler fix: just default to setting the title to the project folder name (e.g., "cms") instead of the static string "Claude Code". This would make multi-project workflows much easier to navigate.

Environment

  • Terminal: iTerm2 on macOS
  • Shell: zsh with Oh My Zsh
  • Claude Code: latest version

View original on GitHub ↗

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