claude-code - 💡(How to fix) Fix Feature request: --project-dir flag (or session profile) to load .claude/ from a specific path regardless of working directory

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…

Fix Action

Fix / Workaround

  • Symlink to ~/.claude/commands/ — works but pollutes global namespace; same-named commands across repos conflict
  • Multi-root VS Code workspace — partial workaround but doesn't cleanly scope the active .claude/ to one root
  • cd before starting — works for CLI only, not for the VS Code extension panel

Code Example

claude --project-dir /projects/my-repo

---

"claude.projectDir": "/projects/my-repo"
RAW_BUFFERClick to expand / collapse

Problem

When using the VS Code extension, the working directory is locked to the workspace root. Developers who keep a parent directory open (e.g. /projects/) to see all repos in the explorer have no way to load .claude/commands/ from a specific subdirectory repo without either:

  • Changing the workspace root (losing visibility of other projects), or
  • Symlinking commands into ~/.claude/commands/ (causes namespace collisions across repos with same-named commands)

The same problem applies to the CLI when a developer prefers not to cd per session.

Proposed solution

A --project-dir flag on the CLI:

claude --project-dir /projects/my-repo

And an equivalent VS Code setting (workspace or folder-level):

"claude.projectDir": "/projects/my-repo"

This would make Claude Code load .claude/commands/, .claude/settings.json, and CLAUDE.md from the specified path while keeping the working directory unchanged.

Alternatives considered

  • Symlink to ~/.claude/commands/ — works but pollutes global namespace; same-named commands across repos conflict
  • Multi-root VS Code workspace — partial workaround but doesn't cleanly scope the active .claude/ to one root
  • cd before starting — works for CLI only, not for the VS Code extension panel

Use case

Teams with a mono-repo-style parent workspace who want per-repo slash commands, settings, and CLAUDE.md context available from a fixed VS Code workspace without restructuring their editor layout.

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 request: --project-dir flag (or session profile) to load .claude/ from a specific path regardless of working directory