anthropics / anthropics/claude-code
[FEATURE] Allow showing current working directory alongside the "Claude Code" terminal title
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### Preflight Checklist
- [x] I have searched [existing requests](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20label%3Aenhancement) and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
### Problem Statement
Claude Code sets the terminal tab title (with its logo/label) while a session is active, which is very useful. However, there's currently no way to also include the current working directory in that title.
This matters when working with multiple terminal tabs/sessions across different projects: without the directory name, it's hard to tell at a glance which tab corresponds to which project just by looking at the tab bar.
The only documented workaround is to set CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 and manage the title entirely yourself via PROMPT_COMMAND, but this means losing whatever status/progress information Claude Code itself shows in the title during a session.
### Proposed Solution
A way to customize or extend the terminal title format so it includes the current working directory (or project name) in addition to the existing "Claude Code" indicator, for example:
A new settings.json key, e.g. terminalTitleFormat, accepting a template string with placeholders like {cwd}, {dirname}, {sessionName}, etc.
Or simply appending the directory name automatically to the existing title, e.g. "🤖 Claude Code — my-project"
Alternatively, since hooks already allow returning a raw terminalSequence (OSC 0/1/2) to fully control the window title, it would help if the hook input also exposed the text/content Claude Code would have set as the native title at that point (e.g. a native_title or default_title field). This would let a hook enrich or extend the native title (for example, appending the current directory) instead of having to fully replace it and lose whatever dynamic status information Claude Code was already conveying.
### Alternative Solutions
Using CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 with a custom PROMPT_COMMAND and a shell wrapper function around claude. This works for showing the directory, but loses any live status Claude Code itself writes to the title during a session.
Using terminalTitleFromRename with /rename to manually name each session, which works but requires manual naming per session/project rather than being automatic.
Wrapping the claude command in a shell function that automatically passes --name "$(basename "$PWD")" (as suggested in another issue), so the session name matches the current directory without manual renaming:
```bash
claude() {
command claude --name "$(basename "$PWD")" "$@"
}
```
This is simpler than the PROMPT_COMMAND approach and doesn't require disabling Claude Code's title management. However, it still replaces the dynamically generated title with a static name for the whole session, so any live status information Claude Code would otherwise show in the title is lost for that session's duration.
Using a SessionStart hook returning hookSpecificOutput.sessionTitle set to the folder or git branch name. This has the same effect as /rename (per the docs), so it automates the previous alternative but has the same limitation: it replaces the dynamic title rather than combining with it.
Using a SessionStart hook (or hooks on other events) returning hookSpecificOutput.terminalSequence with a raw OSC 0/1/2 escape sequence, to set the window title to any arbitrary string, e.g. combining a "Claude Code" label with the current directory in one custom string. This gives full control over the title text, but since the exact format/content of Claude Code's own dynamically-updated title isn't documented, there's no way to reliably reproduce or preserve that native behavior alongside the custom text — only approximate it by re-emitting a custom title on every relevant hook event.
### Priority
Medium - Would be very helpful
### Feature Category
Interactive mode (TUI)
### Use Case Example
I regularly work on several projects in parallel, each opened in its own terminal tab, and I run Claude Code in most of them.
I open a terminal tab in ~/projects/api-backend and start claude. The tab title shows "Claude Code".
I open a second terminal tab in ~/projects/frontend-app and also start claude. This tab also shows "Claude Code".
I switch to a third tab in ~/projects/internal-tools, same thing.
At this point I have three (or more) terminal tabs all titled identically "Claude Code", with no way to tell them apart from the tab bar alone. I have to click into each tab to check which project it's running in, which becomes tedious as the number of concurrent sessions grows.
If the title included the working directory or project name, e.g. "Claude Code — api-backend", "Claude Code — frontend-app", "Claude Code — internal-tools", I could immediately identify the right tab without having to switch into each one first — the same way I already can with a plain shell prompt showing the current directory, but without losing the useful "Claude Code" indicator (and any status it conveys) once a session is active.
### Additional Context
This would be especially useful for people who run multiple Claude Code sessions in parallel across different projects/terminal tabs.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the existing terminal-title behavior, the CLAUDE_CODE_DISABLE_TERMINAL_TITLE workaround, and hook outputs such as terminalSequence and sessionTitle. Compare the proposed settings.json terminalTitleFormat and native_title approaches against the current dynamic title behavior. Done means users can identify the working directory while retaining the useful Claude Code status information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100