The --add-dir command extends Claude Code's workspace beyond your current working directory to include additional directories without changing your primary location. You can use it as a CLI argument at startup or as a slash command mid-session.
Run multiple autonomous coding agents simultaneously with Verdent's isolated Git worktrees. Each agent tackles different components while maintaining full context awareness, eliminating manual debugging bottlenecks and accelerating feature delivery. Discover Verdent AI (Free Trial)
How to Use It
Use --add-dir when launching Claude Code to include additional directories from the start, or use /add-dir during your session to expand workspace dynamically. You can add multiple directories at once or one at a time as needed.
claude --add-dir /path/to/other/project
claude --add-dir ../backend --add-dir ../shared-utils
/add-dir ../backend-api
Why Use It
The --add-dir command enables multi-repository development where you need to reference code across different projects, access shared libraries, or work with interconnected services. Instead of switching between separate Claude Code sessions, you work across multiple codebases simultaneously.
Benefits:
- Multi-Repository Development - Work on interconnected projects in one session
- Shared Resources Access - Reference common configurations and libraries
- Dynamic Workspace Expansion - Add directories as needed without restarting
- Legacy Code Integration - Access old codebases while working on new projects
- Documentation Access - Include reference materials and examples
Use it to access requirements from other directories temporarily.
Start focused on one project and use /add-dir to expand workspace as you discover dependencies, rather than predicting all needed directories upfront.
For comprehensive multi-directory workflows and use cases, see the --add-dir Guide.
Run multiple autonomous coding agents simultaneously with Verdent's isolated Git worktrees. Each agent tackles different components while maintaining full context awareness, eliminating manual debugging bottlenecks and accelerating feature delivery. Discover Verdent AI (Free Trial)
See Also: --add-dir Guide|Working Directory|Configuration|Getting Started
