claude-code - 💡(How to fix) Fix [FEATURE] Open Claude Desktop in a specific folder via CLI flag or deep link (new Code session, not Cowork home) [1 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#54614Fetched 2026-04-30 06:40:49
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

No supported way to launch Claude Desktop directly into a new Code session rooted at a specific folder. Launching the app via dock icon, open -a "Claude", or open -na "Claude" --args ... always lands on the Cowork home / project picker, regardless of any path argument or claude:// URL.

Root Cause

  • Finder Quick Action — right-click folder → "Open in Claude Code" becomes possible.
  • Raycast / Alfred / Shortcuts — power-user launchers can target Code sessions instead of being stuck at the picker.
  • IDE-style workflow — match what every other dev desktop app on macOS does (code ., subl ., idea .).
  • Scriptable from any tool — build hooks, post-commit triggers, CI dashboards can deep-link to a fresh Code session in the right folder.

The terminal CLI already does this trivially. Bringing the desktop app to parity unblocks a lot of automation.

Code Example

cd /path/to/project && claude

---

open -na "Claude" --args --cwd /path/to/project
# or
Claude.app/Contents/MacOS/Claude --cwd /path/to/project

---

claude://session/new?cwd=/path/to/project

---

open -a "Claude" /path/to/project
RAW_BUFFERClick to expand / collapse

Summary

No supported way to launch Claude Desktop directly into a new Code session rooted at a specific folder. Launching the app via dock icon, open -a "Claude", or open -na "Claude" --args ... always lands on the Cowork home / project picker, regardless of any path argument or claude:// URL.

Use case

I keep dozens of project folders. Today the only fast path to a Code session in /path/to/project is the terminal:

cd /path/to/project && claude

That works, but it's terminal-only. Inside Claude Desktop the workflow is:

  1. Click the dock icon → Cowork home
  2. Click "New session" → folder picker
  3. Navigate to the folder → confirm
  4. Wait for the session to spawn

Every time. No way to script it, no Finder right-click, no Raycast/Alfred integration, no .command shortcut.

What I tried

  • open -na "Claude Code" --args --add-dir /path — opens Cowork home, args dropped (Electron single-instance lock, second-instance flags stripped).
  • open -nb com.anthropic.claude-code --args /path — same.
  • cd /path && open -na "Claude" — cwd not inherited by the Electron renderer; lands on home screen.
  • claude:// scheme is registered (setAsDefaultProtocolClient("claude")), but no documented claude://session/new?cwd=... route. Disassembled app.asar — only cowork-artifact: / cowork-file: / claude-simulator: / operon-artifact: schemes are wired, none route to "new Code session in folder".
  • claude-cli://open?q=... (existing scheme on the URL Handler app) launches the terminal CLI, not the desktop Cowork host.
  • App ignores argv other than --startup (grep argv.includes in app.asar yields only "--startup").

Ask

Either of these closes the gap:

A. CLI flag

open -na "Claude" --args --cwd /path/to/project
# or
Claude.app/Contents/MacOS/Claude --cwd /path/to/project

Spawns a new Code session rooted at the given path, bypassing the Cowork picker. Equivalent to what the terminal CLI does today with cd && claude.

B. Deep link

claude://session/new?cwd=/path/to/project

Route the existing registered claude:// handler to the Code session router with a cwd query param. Symmetric with the deep-link request in #50345 (resume by UUID) — that one targets existing sessions, this one targets new sessions in a folder.

C. open <folder> association

Treat folder paths passed via open / Finder drag-onto-dock as "new Code session here":

open -a "Claude" /path/to/project

This is the standard macOS pattern (VS Code, Sublime, Xcode all do this). Today the path is silently dropped.

Why this matters

  • Finder Quick Action — right-click folder → "Open in Claude Code" becomes possible.
  • Raycast / Alfred / Shortcuts — power-user launchers can target Code sessions instead of being stuck at the picker.
  • IDE-style workflow — match what every other dev desktop app on macOS does (code ., subl ., idea .).
  • Scriptable from any tool — build hooks, post-commit triggers, CI dashboards can deep-link to a fresh Code session in the right folder.

The terminal CLI already does this trivially. Bringing the desktop app to parity unblocks a lot of automation.

Related

  • #50345 — open Desktop to specific session UUID (closed as dup, but the underlying capability — deep-link routing in Cowork — is the same)
  • #50067 — /resume in desktop app
  • #43943 — claude-desktop://resume?session=<id> for -p sessions

This request is the new-session, by-folder counterpart to those (which are all resume, by UUID).

Platform

macOS 15.x (Darwin 24.6.0). Claude Desktop 1.5354.0, claude-code 2.1.121.

extent analysis

TL;DR

The most likely fix is to implement a CLI flag or deep link to launch Claude Desktop directly into a new Code session rooted at a specific folder.

Guidance

  • Investigate implementing a --cwd flag for the Claude Desktop app, similar to the terminal CLI, to spawn a new Code session at a specified path.
  • Explore adding a claude://session/new?cwd=/path/to/project deep link route to the existing claude:// handler, allowing for direct linking to new Code sessions in a folder.
  • Consider treating folder paths passed via open / Finder drag-onto-dock as "new Code session here", following the standard macOS pattern.
  • Review related issues (#50345, #50067, #43943) for potential insights into deep-link routing in Cowork and implementing a similar solution for new sessions by folder.

Example

No code snippet is provided as the issue lacks specific implementation details, but an example of the desired functionality could be:

Claude.app/Contents/MacOS/Claude --cwd /path/to/project

or

open -a "Claude" --args claude://session/new?cwd=/path/to/project

Notes

The solution may require modifications to the Claude Desktop app's Electron implementation, specifically handling command-line arguments and deep links. The existing claude:// scheme and claude-cli:// scheme may need to be extended or modified to support the new functionality.

Recommendation

Apply a workaround by implementing a CLI flag, such as --cwd, to launch Claude Desktop directly into a new Code session rooted at a specific folder, as this seems to be the most straightforward solution based on the provided information.

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 [FEATURE] Open Claude Desktop in a specific folder via CLI flag or deep link (new Code session, not Cowork home) [1 participants]