claude-code - 💡(How to fix) Fix [BUG] Cowork: New project with name matching selected context folder silently creates empty nested subfolder and mounts it instead of the context folder [1 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#48819Fetched 2026-04-16 06:50:04
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

  • When the selected context folder's basename matches the project name, either warn the user or use the context folder directly as the project save directory.

Error Messages/Logs

Fix Action

Fix / Workaround

Workaround:

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?

Cowork: New project with name matching selected context folder silently creates empty nested subfolder and mounts it instead of the context folder

Reproduction:

Have an existing folder /Users/me/Projects/MyVault containing real content (e.g. an Obsidian vault with .obsidian/, claude.md, populated subdirectories). Create a new Cowork project. Name it "MyVault" (matching the folder name). When prompted for a folder, select /Users/me/Projects/MyVault. Start a new session.

Expected:

  • Session mounts /Users/me/Projects/MyVault and Claude sees the real vault contents.

Actual:

  • Cowork creates (or uses) an empty subfolder /Users/me/Projects/MyVault/MyVault/ and mounts that. Claude reports the folder is empty.

Workaround:

  • In-session, call request_cowork_directory with the real vault path — works for that session only. Deleting the nested subfolder does not stick; it's recreated on next session launch.

Impact:

  • Silent data-placement bug. Users who don't notice the empty mount may write files into the nested subfolder, effectively "losing" work inside their own vault.

Hypothesis:

  • Cowork treats project name + context folder independently, and when the project save directory defaults to {context_folder}/{project_name}/ while the project name matches the context folder's basename, a nested duplicate is created.

Suggested fix:

  • When the selected context folder's basename matches the project name, either warn the user or use the context folder directly as the project save directory.

What Should Happen?

Expected:

  • Session mounts /Users/me/Projects/MyVault and Claude sees the real vault contents.

Error Messages/Logs

Steps to Reproduce

Reproduction:

  • Have an existing folder /Users/me/Projects/MyVault containing real content (e.g. an Obsidian vault with .obsidian/, claude.md, populated subdirectories).
  • Create a new Cowork project. Name it "MyVault" (matching the folder name).
  • When prompted for a folder, select /Users/me/Projects/MyVault.
  • Start a new session.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

Claude 1.2773.0 (884b37) 2026-04-15T14:32:09.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue can be fixed by modifying Cowork to handle cases where the project name matches the context folder's basename, either by warning the user or using the context folder directly as the project save directory.

Guidance

  • Verify that the issue is indeed caused by the project name matching the context folder's basename by testing with a different project name.
  • Consider adding a warning or prompt to inform the user when the project name matches the context folder's basename to prevent silent data placement bugs.
  • To mitigate the issue, users can use the request_cowork_directory function with the real vault path as a temporary workaround.
  • Investigate the code that handles project save directory creation to determine why it defaults to {context_folder}/{project_name}/ and how to modify it to handle matching basenames correctly.

Example

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

Notes

The issue is reported as a regression, indicating that it worked in a previous version, but the last working version is not specified. This information may be helpful in identifying the cause of the issue.

Recommendation

Apply workaround: Modify Cowork to handle cases where the project name matches the context folder's basename to prevent silent data placement bugs. This is recommended because it directly addresses the root cause of the issue and can be implemented without waiting for a new version release.

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

claude-code - 💡(How to fix) Fix [BUG] Cowork: New project with name matching selected context folder silently creates empty nested subfolder and mounts it instead of the context folder [1 comments, 2 participants]