Understanding Multi-Root Workspaces
Before diving in, it helps to understand the two common patterns for organizing related projects.Why Use Multi-Root Workspaces?
Cline can complete tasks that span multiple projects or repositories:- Refactoring: Update an API contract and fix all consumers across repos
- Feature development: Implement a feature that touches frontend, backend, and shared code
- Dependency updates: Coordinate version bumps across related projects
- Documentation: Generate docs that reference code from multiple repositories
Setting Up a Multi-Root Workspace
Monorepos vs Multiple Repositories
Monorepo: One Git repository containing multiple projects or packages. All code shares the same version history..git directory and Cline tracks them independently.
Adding Folders to Your Workspace
You can add folders to your workspace in several ways:- File menu: Use
File > Add Folder to Workspacein VSCode - Drag and drop: Drag folders directly into VSCode’s file explorer
- Workspace file: Create a
.code-workspacefile (recommended for teams) - Command palette: Run
Workspaces: Add Folder to Workspace
Working with Multiple Repositories
When you open separate Git repositories in one workspace, Cline treats each as an independent project with its own version control.What Cline Tracks Per Repository
For each workspace folder, Cline detects:| Property | Description |
|---|---|
| Path | Absolute path to the folder |
| Name | Derived from folder name or workspace file |
| VCS Type | Git, Mercurial, or None |
| Commit Hash | Current HEAD commit (for Git/Mercurial repos) |
While Cline detects VCS information for all workspace folders, certain features only use the primary workspace (the first folder): Cline rules, workflows, and Git-related features like
@git mentions.Referencing Files Across Workspaces
Natural Language References
Cline understands natural references to your workspaces:Workspace Hints Syntax
For explicit references, use the@workspace:path syntax:
| Syntax | Description |
|---|---|
@frontend:src/App.tsx | File in the “frontend” workspace |
@backend:server.ts | File in the “backend” workspace |
@contracts:types/ | Folder in the “contracts” workspace |
- Multiple workspaces have files with the same name
- You want to be explicit about which project you mean
- Cline needs to resolve ambiguity
How Workspace Names Work
Workspace names are derived from:- The
namefield in your.code-workspacefile (if specified) - The folder name (default)
Common Configurations
Monorepo Development
Microservices with Separate Repos
Full-Stack with Shared Contracts
Hybrid Setup
Current Limitations
Two features have limitations in multi-root workspace mode:Cline Rules
Cline rules (.clinerules/ directory) only work in the primary workspace (the first folder in your workspace). Rules in other workspace folders are ignored.
Workaround: Place shared rules in the primary workspace, or use global rules (~/Documents/Cline/Rules/) which apply everywhere.
Checkpoints
Checkpoints are disabled in multi-root workspace mode. Cline displays a warning when this happens. Why: Checkpoints use a shadow Git repository to track changes. With multiple repositories, coordinating checkpoints across independent Git histories adds complexity that isn’t yet supported. Workaround: Use your normal Git workflow. Commit frequently, or create branches for experimental work. Both limitations are restored when you return to a single-folder workspace.Best Practices
Organizing Your Workspaces
- Group related projects that often need coordinated changes
- Use a workspace file for reproducible setups across your team
- Name folders clearly so workspace hints are intuitive
- Consider the primary workspace for Cline rules placement
Effective Prompting
- Be specific when it matters: “Update the user model in the backend workspace”
- Reference relationships: “The frontend uses types from the contracts workspace”
- Describe cross-workspace changes: “This needs to update both web and mobile”
- Scope searches for large codebases: “Search for ‘TODO’ only in the frontend workspace”
Working with Large Workspaces
- Break large tasks into workspace-specific operations when possible
- Use Plan mode to let Cline understand structure first
- Add a
.clineignorefile to reduce noise, speed up scanning, and keep Cline focused on source code:

