Show project/directory name as prefix in terminal tab title
Problem
When working with multiple Claude Code sessions across different projects, all terminal tabs look the same. Claude Code already sets the terminal title dynamically (with AI-generated context summaries), but there's no indication of which project a terminal belongs to.
For example, I might have Claude Code running in ~/code/support, ~/code/webapp, and ~/code/api simultaneously. All tabs show context like "Searching for emails" or "Editing CLAUDE.md" but I can't tell which project each tab is for without clicking into it.
Proposed Solution
Include the project/directory name as a prefix in the terminal title that Claude Code sets via OSC escape sequences.
Instead of:
Searching for emails
Show:
support - Searching for emails
The prefix could be derived from:
- The current working directory basename (simplest)
- A configurable
terminalTitlePrefixin.claude/settings.json(most flexible)
Configuration Example
// .claude/settings.json
{
"terminalTitlePrefix": "Parfinity Support"
}
If not configured, fall back to the directory basename.
Use Case
Anyone running Claude Code across multiple projects in parallel (common for developers managing several repos) would benefit from being able to visually distinguish terminals at a glance.
Related Issues
- #25789 (update title on
/rename) - complementary, focuses on session name - #25550 (conversation context in VS Code tab title) - related, VS Code specific
- #25307 (configurable state indicators) - related, focuses on state display
8 Comments
Additional context: There's already
CLAUDE_CODE_DISABLE_TERMINAL_TITLEas an env var to disable the title-setting behavior entirely. This means the infrastructure for managing terminal titles is already in place. Adding a configurable prefix (or defaulting to the directory basename) would be a natural extension of the existing mechanism.I'd add, general customization with place holders to allow users to choose as prefix or suffix, cwd, git repo, maybe a project metadata set and retrieved from the
$PROJDIR/.claude/settings.local.json?+1 — Same pain point here with git worktrees. Running
claude --worktree 577-order-change-synccreates isolated checkouts for parallel feature work, but all tabs look identical.The directory basename prefix would work perfectly for this. A worktree named
577-order-change-syncwould show as:The configurable
terminalTitlePrefixin settings is a nice escape hatch for when the directory name is too long or not descriptive enough.(Closed my duplicate #31894 in favor of this one.)
Hey, I built something that solves this today and I just stumbled on this issue.
ccpis a bash wrapper for the Claude Code CLI that sets each pane's title toproject (branch) | task | statususing hook events. If you're running worktrees in parallel, each pane gets its own independent title so577-order-change-syncandmainshow up separately without any config.The
tasklabel can also be AI-generated, which I've seen mentioned in some other issues. There's an opt-in flag that distills your prompt into a 3-5 word summary, so instead of just the directory name you get something like577-order-change-sync(feat/order-sync) | Fix order sync bug | Testing. Useful when the worktree name alone isn't descriptive enough.It uses
CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1under the hood (which someone mentioned above is already in place) and takes over from there. Might be useful for folks until native support lands: https://github.com/brianruggieri/claude-code-pulseRelated issues: #17951, #34223, #32600, #34889
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
Love this auto-closing bot.
And by love. I love massive information fragmentation and effectively impossible product support it causes.
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.