claude-code - 💡(How to fix) Fix [BUG] New Cowork sessions inherit working folder from prior in-memory session (affects both UI "+ New" and claude://cowork/new deeplinks) [2 comments, 3 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#53402Fetched 2026-04-26 05:16:44
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×2

Error Message

Error Messages/Logs

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 Claude Desktop is already running with an active Cowork session, creating a new Cowork session — whether via the in-app "+ New" button or a claude://cowork/new deeplink — results in the new session inheriting the working folder from the prior session. For deeplinks that pass a folder param, the new session ends up with both the inherited folder and the deeplink's folder attached, rather than only the deeplink's folder. The behavior does not occur on a fresh app launch

Why this is a bug

Documented contract for /new (and the user mental model for "+ New") is a fresh session. The deeplink's folder parameter is documented in the singular ("adopted as the working directory"), implying authoritative replacement, not additive merge. UX impact: Confusing for users clicking "+ New" who don't expect prior folders to carry over. Particularly problematic for "Open in Claude Cowork" buttons in third-party tools, where the caller has no visibility into prior session state and cannot reason about what will be attached. Safety impact: A folder the user intended to scope out of a session remains in scope, expanding the blast radius of any prompt run there. Especially relevant given Cowork's agentic nature and file-write capabilities.

Reference https://support.claude.com/en/articles/14729294-open-claude-desktop-with-a-link

What Should Happen?

When Claude Desktop is already running with an active Cowork session, creating a new Cowork session —

  1. via the in-app "+ New" button : Should create a new session without a working folder set
  2. claude://cowork/new deeplink: Should result in a new session with working folder only set to parameters passed in the deep link

Error Messages/Logs

Steps to Reproduce

Steps to reproduce — deeplink path

  1. Launch Claude Desktop.
  2. Fire claude://cowork/new?q=Draft the Q2 update&folder=/Users/me/docs → session opens with /Users/me/docs. ✅
  3. Without quitting the app, fire claude://cowork/new?q=Draft the Q2 update&folder=/Users/me/downloads.
  4. Actual: new session has both /Users/me/downloads and /Users/me/docs attached.
  5. Expected: new session has only /Users/me/downloads attached.

Steps to reproduce — UI path

  1. Launch Claude Desktop.
  2. Open a Cowork session with /Users/me/docs as the working folder.
  3. Click "+ New" to create a new Cowork session. Do not manually add any folder.
  4. Actual: new session has /Users/me/docs pre-attached.
  5. Expected: new session has an empty working directory.

Isolating tests run

Test A — fresh app launch: Fully quit, relaunch, fire deeplink as the first action → only the deeplink's folder is attached. ✅ Rules out persisted state and confirms the carryover lives in in-memory session state. Test B — UI "+ New": Creating a new session via the UI button reproduces the carryover → bug is at the session-creation layer, not deeplink-specific.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Claude 1.4758.0 (fb266c) 2026-04-24T20:22:30.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 ensuring that new Cowork sessions do not inherit the working folder from prior sessions, either by modifying the session creation logic or by clearing the working folder when a new session is created.

Guidance

  • Verify that the session creation logic is correctly implemented to start with an empty working directory when creating a new Cowork session via the in-app "+ New" button or a deeplink.
  • Check if there is any persisted state or in-memory session state that is causing the working folder to be carried over from the prior session.
  • Consider adding a step to clear the working folder when creating a new session, especially when a deeplink with a folder parameter is used.
  • Review the documentation for the /new endpoint and the claude://cowork/new deeplink to ensure that it accurately reflects the expected behavior.

Example

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

Notes

The issue seems to be related to the session creation logic and how it handles the working folder. The fact that the issue does not occur on a fresh app launch suggests that it may be related to persisted state or in-memory session state.

Recommendation

Apply a workaround to clear the working folder when creating a new session, as the root cause of the issue is not immediately clear and may require further investigation. This will ensure that new sessions start with an empty working directory, as expected.

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] New Cowork sessions inherit working folder from prior in-memory session (affects both UI "+ New" and claude://cowork/new deeplinks) [2 comments, 3 participants]