claude-code - 💡(How to fix) Fix Feature request: configurable terminalTitleTemplate with cwd / project placeholders

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Workarounds today

Code Example

{
  "terminalTitleTemplate": "{basename} · Claude"
}
RAW_BUFFERClick to expand / collapse

Problem

Claude Code sets the terminal title to "Claude Code" (or the session/agent/haiku name if available) on every instance, via OSC 0 escape sequences. When running multiple Claude Code instances in different repositories — say ~/repos/foo, ~/repos/bar, ~/repos/baz — every terminal tab, window-list entry, and dock preview reads "Claude Code". The user has to focus each one and read the status line to figure out which repo it's running in.

claude --name <name> works as a per-invocation override, but requires the user to remember to type it (or wire up their shell aliases, terminal profiles, etc.). It also doesn't update if the working directory changes during a session.

Request

A terminalTitleTemplate setting in ~/.claude/settings.json (or settings.local.json / project-level) that lets users define a title pattern with placeholders. Example:

{
  "terminalTitleTemplate": "{basename} · Claude"
}

Suggested placeholders:

  • {cwd} — full working directory path
  • {basename} — last path component (most useful for repos: axan, claude-code, etc.)
  • {project} — name of the enclosing git repo (if any) or project root
  • {sessionName} — the name passed via --name or /rename, if set
  • {agentName} — the active subagent name, if any

A default template (or even just a built-in mode like "basename-and-claude") would make multi-instance workflows usable out of the box.

Why this is a Claude Code concern, not a terminal-emulator concern

Many users hit this exact pain in vanilla terminal emulators (GNOME Terminal, iTerm, etc.) — anywhere tabs/windows are distinguished by title. The terminal emulator is showing what Claude Code emits via OSC, so the fix has to be on the emitting side. Terminal-side sticky-title overrides exist but require per-emulator implementation.

Workarounds today

  • claude --name X — works but is per-invocation; doesn't survive cwd changes; user has to remember
  • SessionStart hook to emit a custom OSC 0 sequence — works but fires after Claude Code's initial title write, so the user sees a flicker; also brittle to internal Claude Code title-update timing

A first-class config setting would supersede both.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING