[BUG] Terminal Title Overwrite Prevents Custom Title Setting

Resolved 💬 17 comments Opened Jul 30, 2025 by nigels-code Closed Apr 25, 2026
💡 Likely answer: A maintainer (claude[bot], contributor) responded on this thread — see the highlighted reply below.

Environment

Claude Code running in terminal

  • Claude CLI version: 1.0.62
  • Operating System: MacOS 15.5
  • Terminal: ghostty 1.1.3

Bug Description

In ~/.claude/settings.json I have the following:

{
  "env": {
    "CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1",
    "CLAUDE_DISABLE_TITLE_UPDATES": "1"
  }
}

In .zshrc I have the following:

# Show pwd as window title for ghostty
DISABLE_AUTO_TITLE="true"
precmd() { print -Pn "\e]0;%~\a" }

I would like to display the pwd in the title bar of my terminal (ghostty) when running Claude Code.

Steps to Reproduce

  1. Start terminal app (ghostty). The pwd appears in the title bar
  2. Start Claude at the terminal (using claude)
  3. The pwd in the title bar is replaced with claude

Expected Behavior

The title bar keeps displaying the pwd

Actual Behavior

The title bar displays claude

Additional Context

I assumed the CLAUDE_CODE_DISABLE_TERMINAL_TITLE and CLAUDE_DISABLE_TITLE_UPDATES properties would prevent Claude Code from updating the title bar. Are these properties working properly?

View original on GitHub ↗

17 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/3396
  2. https://github.com/anthropics/claude-code/issues/2862
  3. https://github.com/anthropics/claude-code/issues/5444

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

nigels-code · 11 months ago

The CLAUDE_CODE_DISABLE_TERMINAL_TITLE property still doesn't work for me. My settings.json file looks like this:

{
  "env": {
    "CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
  }
}

The title of my terminal is always changed to cc, the alias I use to start Claude Code.

gabrielxz · 10 months ago

Same for me. The property doesn't work for me. Claude Code says this is a bug.

BenNewman100 · 8 months ago

this bug is still present in version 2.0.30

@nigels-code (may I suggest updating the issue title to be more descriptive it just says "[BUG]"

Maybe "[BUG] Terminal Title Overwrite Prevents Custom Title Setting"

Claude code sets the title to "claude" on launch even if this is set to disable it
"CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1",

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

RoukSonix · 6 months ago

Bug still present in v2.0.76

Environment:

  • Claude Code: 2.0.76
  • macOS (Darwin 25.2.0)
  • Terminal: various

Setting CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 in both ~/.claude/settings.json (env section) and shell profile (~/.zshrc) does not prevent terminal title changes. Claude Code still overwrites the terminal title on startup.

  {
    "env": {
      "CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
    }
  }

export CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1

Both methods confirmed the variable is set, but the behavior persists.

Marcopohlo · 6 months ago

I managed to make this work (at least in Ghostty):

First tried on v2.1.6 but works through all versions including newest (currently v2.1.23)

Ghosty config:

shell-integration-features = no-title

Claude:

"env": {
   "CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
},

And in my .zshrc I have this:

autoload -Uz add-zsh-hook
set_terminal_title() {
    ...
}
add-zsh-hook precmd set_terminal_title
add-zsh-hook chpwd set_terminal_title
bunfield · 5 months ago

+1 on this. The ability to disable terminal title updates is especially critical on Termux (Android), where title changes trigger a notification overlay that covers the input area at the bottom of the screen, making the terminal difficult to use.

Related issue with Termux-specific context: #21677

LWHengen · 5 months ago

Adding my voice to this issue. I'm experiencing the same problem on Windows.

Environment:

  • Windows with Command Prompt/DOS box
  • Claude Code settings.json configured with: "env": { "CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1" }

Issue:
The environment variable is completely ignored. Claude Code continues to change my terminal window title to "claude" regardless of the setting.

Impact:
I need custom window titles to distinguish between multiple terminal sessions. Setting the title before launching Claude Code doesn't work either - Claude immediately overwrites it.

Please prioritize fixing this on Windows. The environment variable exists but has no effect.

ludekvodicka · 4 months ago

Still not working in 2.1.59 on windows 11 command line

byoungs · 4 months ago

Still broken as of the latest version. I tried several workarounds:

  1. export CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 in ~/.zshrc — no effect
  2. Setting it in ~/.claude/settings.json under "env" — no effect
  3. Using a SessionStart hook to reset the title via printf '\e]0;...\a' — the hook fires successfully but Claude Code overrides the title again afterward
  4. Adding a sleep 2 delay in the hook before setting the title — still overridden

Claude Code appears to set the terminal title on an ongoing basis, not just once at startup, so even delayed hooks can't win the race. My zsh precmd hook (which sets the title to the current directory name) also gets overridden.

Would love to see CLAUDE_CODE_DISABLE_TERMINAL_TITLE actually respected. macOS, iTerm2.

san-tekart · 4 months ago

This is still reproducible in Claude Code version 2.1.76 (Windows).

Version Check:
claude --version
2.1.76 (Claude Code)

Command Attempted:
[Environment]::SetEnvironmentVariable('CLAUDE_CODE_DISABLE_TERMINAL_TITLE', '1', 'User')

jeremy0dell · 3 months ago

Please fix this

rssrn · 3 months ago

I'd previously experienced this issue. This is now fixed/working for me using claude-code 2.1.88 on linux. In the changelog for 2.1.79 I can see a claimed fix:

## 2.1.79
...

  • Fixed CLAUDE_CODE_DISABLE_TERMINAL_TITLE not preventing terminal title from being set on startup

In my ~/.claude/settings.json I have added:

"env": {
"CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
}

And it is successfully preventing auto setting of the terminal title by claude code, both on session startup and during the session.

With the above config in place, I am now able to set custom terminal titles via claude hooks, and my custom titles are no longer being overridden by claude's builtin terminal title functionality.

codercg2 · 3 months ago

For iterm2, iTerm2 → Preferences -> Profiles -> General -> Title
Disable option "Applications in terminal may change the title", this works for me.

claude[bot] contributor · 2 months ago

This issue was fixed as of version 2.1.79.

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.