Problem
When working on cross-project tasks (e.g., a fullstack feature spanning frontend and backend repos), --add-dir is the right tool — it brings multiple directories into a single Claude Code session. However, the configuration is ephemeral:
# Every time I start a new session, I have to re-specify all directories
claude --add-dir ~/frontend --add-dir ~/backend --add-dir ~/shared-lib
There is no built-in way to save and reload a multi-directory workspace. Users resort to shell aliases or wrapper scripts, which are fragile and not shareable with teammates.
Proposed Solution
Introduce a .claude-workspace file (or similar) that persists the multi-directory configuration:
Usage
# Load workspace from file
claude --workspace ./my-project.claude-workspace
# Or auto-detect if .claude-workspace exists in current directory
claude
Key behaviors
- Relative paths — so the file is portable and can be checked into a repo or shared
- Auto-detection — if a
.claude-workspace file exists in the current directory, load it automatically
- Per-directory CLAUDE.md — each added directory's CLAUDE.md should be respected (this is already a gap with
--add-dir today)
Current Workarounds
- Shell alias:
alias claude-myproject="claude --add-dir ~/a --add-dir ~/b" — not shareable, not portable
/add-dir in session: manually type /add-dir after every session start — tedious
claude --resume: restores previous session including added dirs, but only works for continuing the same conversation
Why This Matters
Modern development often involves multiple repositories (microservices, monorepo packages, frontend + backend, shared libraries). The --add-dir feature already solves the "how" — this proposal just adds the "remember" part, similar to how VS Code's .code-workspace files persist multi-root workspace configurations.
Environment
- Claude Code 2.1.92+
- macOS / Linux / Windows
- CLI and IDE extensions
Related
Problem
When working on cross-project tasks (e.g., a fullstack feature spanning frontend and backend repos),
--add-diris the right tool — it brings multiple directories into a single Claude Code session. However, the configuration is ephemeral:There is no built-in way to save and reload a multi-directory workspace. Users resort to shell aliases or wrapper scripts, which are fragile and not shareable with teammates.
Proposed Solution
Introduce a
.claude-workspacefile (or similar) that persists the multi-directory configuration:Usage
Key behaviors
.claude-workspacefile exists in the current directory, load it automatically--add-dirtoday)Current Workarounds
alias claude-myproject="claude --add-dir ~/a --add-dir ~/b"— not shareable, not portable/add-dirin session: manually type/add-dirafter every session start — tediousclaude --resume: restores previous session including added dirs, but only works for continuing the same conversationWhy This Matters
Modern development often involves multiple repositories (microservices, monorepo packages, frontend + backend, shared libraries). The
--add-dirfeature already solves the "how" — this proposal just adds the "remember" part, similar to how VS Code's.code-workspacefiles persist multi-root workspace configurations.Environment
Related
/add-dirin IDE extensions/add-diroutside the agent loop