claude-code - 💡(How to fix) Fix [BUG] Client ignores folder selection in file browser — session always starts at workspace root [2 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#52499Fetched 2026-04-24 06:05:32
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

When a user selects a project subfolder in Claude Code Client's file browser and starts a new session, the session initializes at the workspace root instead of the selected folder. The CLI works correctly and preserves folder context, but the Client does not.

Error Message

Error Messages/Logs

Root Cause

  • CLI behavior (correct): When user cds to projects/PROJECT NAME and runs claude, the session starts with that folder as cwd
  • Client behavior (broken): User selects projects/PROJECT NAME in the UI file browser, sees it reflected in tabs/breadcrumbs (visual feedback exists), but this selection is NOT passed to session initialization
  • The folder selection exists in the UI layer but is not communicated to the session layer
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Summary

When a user selects a project subfolder in Claude Code Client's file browser and starts a new session, the session initializes at the workspace root instead of the selected folder. The CLI works correctly and preserves folder context, but the Client does not.

Steps to Reproduce

  1. Open Claude Code Client on a project with subfolders (e.g., workspace/projects/PROJECT NAME)
  2. Click on a subfolder in the file browser (e.g., projects/PROJECT NAME)
  3. Start a new session (⌘ + Enter or equivalent)
  4. Run pwd in the shell or check the session working directory
  5. Expected: C:\Users\...\workspace\projects\PROJECT NAME
  6. Actual: C:\Users\...\workspace (workspace root)

Root Cause

  • CLI behavior (correct): When user cds to projects/PROJECT NAME and runs claude, the session starts with that folder as cwd
  • Client behavior (broken): User selects projects/PROJECT NAME in the UI file browser, sees it reflected in tabs/breadcrumbs (visual feedback exists), but this selection is NOT passed to session initialization
  • The folder selection exists in the UI layer but is not communicated to the session layer

Impact

  • Working directory context is lost
  • Directory-scoped CLAUDE.md files don't auto-load from selected projects
  • Users must manually cd to their project after every session start
  • Especially problematic for multi-project workspaces where folder context matters

Environment

  • Client version: 2.1.111
  • Platform: Windows 11, Git Bash
  • Reproduction confidence: 100% (tested multiple times, consistent behavior)

Expected Behavior

When a user selects a folder in Claude Code Client's file browser and starts a session, that folder should be passed as the session's initial cwd, matching the CLI behavior.

<img width="2050" height="242" alt="Image" src="https://github.com/user-attachments/assets/f73cd8f1-6a44-4656-a1b8-5dc37c787197" /> <img width="852" height="62" alt="Image" src="https://github.com/user-attachments/assets/44b694d6-2c56-4dfd-9434-aa0edde73249" />

What Should Happen?

See above

Error Messages/Logs

Steps to Reproduce

See above

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.111

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

No response

extent analysis

TL;DR

The issue can likely be fixed by modifying the Claude Code Client to pass the selected folder path to the session initialization, matching the existing CLI behavior.

Guidance

  • Verify that the selected folder path is correctly retrieved from the UI layer and passed to the session initialization code.
  • Check the code responsible for starting a new session in the Client and ensure it uses the selected folder path as the initial working directory.
  • Compare the session initialization code between the CLI and Client to identify any differences that might cause the issue.
  • Test the fix by selecting a subfolder in the file browser, starting a new session, and checking the working directory using pwd or other means.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The issue seems to be related to the communication between the UI layer and the session layer in the Client. The fix might involve modifying the Client's code to pass the selected folder path to the session initialization.

Recommendation

Apply a workaround by manually setting the working directory after starting a new session until the issue is fixed in the Client code.

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