[Feature Request] Display current working directory in CLI prompt

Status Fixed / completed
Reported on v2.1.181
Maintainer reply ✓ Yes — bcherny
Activity 3 comments · opened Jun 22, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
It's not clear what folder I'm operating in. I have multiple projects going at the same time. There are no visual clues to tell me where I am. I have to ask it to pwd, this costs tokens. The UI should show the working folder the way Copilot CLI does.

Environment Info

  • Platform: darwin
  • Terminal: Hyper
  • Version: 2.1.181
  • Feedback ID: c35ce624-e780-41a4-ab06-2630061c31dd

Copilot:

<img width="440" height="143" alt="Image" src="https://github.com/user-attachments/assets/14ac7fed-c85b-4d55-8a95-ec58a93de800" />
(Nice and clear)

Claude Code:

<img width="615" height="248" alt="Image" src="https://github.com/user-attachments/assets/7431d41e-42bd-4a3b-a1ac-d0081fb21726" />
(No idea what folder I'm working in.

View original on GitHub ↗

3 Comments

snowyukitty · 2 months ago

I built and tested an external prototype specifically to evaluate this workflow through Claude Code's existing custom statusLine.

The useful identity turned out to be the actual working directory, not only the Git root or directory leaf: repo-name/actual/relative/cwd, sourced from workspace.current_dir rather than the status command's process cwd. This distinguishes parallel sessions across repositories, monorepo subfolders, and linked worktrees. Outside Git it falls back to a home-relative path.

The prototype has automated coverage for Python and Windows PowerShell 5.1/7 across Git and non-Git directories, normal and detached HEADs, linked worktrees, spaces and non-ASCII paths, missing or slow Git, single-line safety, and terminal-cell width. At narrow widths it preserves the path and directory leaf while removing optional branch and machine segments first. It performs no network calls; Git work is bounded, and a timeout never removes workspace identity.

A native default could be smaller, faster, and more reliable because Claude Code already owns the workspace and Git state. My suggested minimum is an always-visible actual cwd, repository-relative inside Git, adaptively middle-shortened while retaining the leaf, with the existing custom status-line path able to disable or replace it. Branch and hostname can remain optional.

This is engineering prototype evidence, not a prevalence or real-use claim.

Prototype, tests, and measurements:
https://github.com/snowyukitty/agent-terminal-status

Visual field guide:
https://agent-terminal-status.gldtestuser.chatgpt.site/docs

Related: #73162 for default project identity, #74344 for monorepo subfolders, and #79794 for linked-worktree badge identity.

bcherny collaborator · 2 months ago

Thanks for the request! You can show the current working directory in Claude Code today with a custom status line. Run /statusline and ask for something like "show the current directory", or configure statusLine in your settings with a script that reads workspace.current_dir from the JSON input, for example:

#!/bin/bash
input=$(cat)
echo "📁 $(basename "$(echo "$input" | jq -r '.workspace.current_dir')")"

The line stays visible under the prompt and updates as the working directory changes. Docs: https://code.claude.com/docs/en/statusline

Closing since this is available now; feel free to reopen if that doesn't cover your case.

🤖 Generated with Claude Code

github-actions[bot] · 9 days 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.