Allow customizing the terminal tab title

Resolved 💬 3 comments Opened Mar 16, 2026 by guplem Closed Mar 16, 2026

Feature Request

Claude Code dynamically sets the terminal tab title to "Claude Code". It would be useful to allow users to customize this persistently, similar to how the status line is configurable.

Current Behavior

The --name / -n flag was recently added, which sets the tab title before the first interaction. However, once a message is sent, Claude Code overwrites the title back to its default. The flag is only useful as an initial label, not as a persistent title.

Use Case

When working across multiple terminal tabs on different branches or repos, the tab title "Claude Code" provides no context about which session is which. A persistent, customizable title would help developers quickly identify tabs.

Proposed Behavior

  • The --name flag (or a new setting) should persist the custom title throughout the session, not just before the first message
  • Ideally, support dynamic titles: show the current git branch name (e.g., releases/4.16), and when on the default branch (main/master), show the repository name instead (e.g., monorepo)
  • Update dynamically as the branch changes (e.g., after git checkout)

Possible Implementation

Expose a terminalTitle setting (similar to statusLine) that accepts either a static string or a command:

{
  "terminalTitle": {
    "type": "command",
    "command": "git symbolic-ref --short HEAD 2>/dev/null || basename \"$PWD\""
  }
}

Or provide a built-in template syntax:

{
  "terminalTitle": "${branchName == defaultBranch ? repoName : branchName}"
}

Current Workarounds

  • --name / -n flag: only works until the first message is sent
  • Setting the title via PROMPT_COMMAND in .bashrc: works partially, but Claude Code re-sets the title during operations, causing flickering

View original on GitHub ↗

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