docs/features/multiroot-workspace.mdx
Cline works with VSCode's multi-root workspaces, letting you manage multiple project folders or repositories in a single window. Whether you're working with a monorepo or separate Git repositories, Cline can read files, write code, and run commands across all of them.
<Frame> <video src="https://storage.googleapis.com/cline_public_images/multiworkspace.mp4" autoPlay muted loop playsInline controls /> </Frame> <Warning> Multi-root workspaces have two limitations: - **Cline rules** only work in the primary workspace folder - **[Checkpoints](/core-workflows/checkpoints)** are disabled (restored when you return to a single folder)See Current Limitations for details. </Warning>
Before diving in, it helps to understand the two common patterns for organizing related projects.
Cline can complete tasks that span multiple projects or repositories:
Example prompt:
Update the User type in the contracts repo, then update both the frontend
and backend to use the new fields. Make sure the API validates the new
required field.
Monorepo: One Git repository containing multiple projects or packages. All code shares the same version history.
<Files> <Folder name="my-company" defaultOpen> <Folder name=".git" /> <Folder name="packages" defaultOpen> <Folder name="web" icon="react"> <File name="..." /> </Folder> <Folder name="api" icon="node-js"> <File name="..." /> </Folder> <Folder name="shared"> <File name="..." /> </Folder> </Folder> <File name="package.json" /> </Folder> </Files>Multiple Repositories: Separate Git repositories, each with their own history, opened together in one VSCode workspace.
~/projects/
├── fullstack.code-workspace # Workspace config file
├── frontend/ # [email protected]:acme/frontend.git
│ └── .git/
├── backend/ # [email protected]:acme/backend.git
│ └── .git/
└── contracts/ # [email protected]:acme/api-contracts.git
└── .git/
Cline supports both patterns, as well as hybrid setups where some folders are Git repositories and others are not. The key difference: with multiple repositories, each folder has its own .git directory and Cline tracks them independently.
You can add folders to your workspace in several ways:
File > Add Folder to Workspace in VSCode.code-workspace file (recommended for teams)Workspaces: Add Folder to WorkspaceFor detailed instructions, see Microsoft's multi-root workspace guide.
When you open separate Git repositories in one workspace, Cline treats each as an independent project with its own version control.
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) |
This means Cline understands that your frontend and backend might be at different commits, on different branches, or even use different version control systems.
<Note> While Cline detects VCS information for all workspace folders, certain features only use the **primary workspace** (the first folder): [Cline rules](/customization/cline-rules), [workflows](/customization/workflows), and [Git-related features](/core-workflows/working-with-files) like `@git` mentions. </Note>Cline understands natural references to your workspaces:
"Read the package.json in the frontend folder"
"Compare the user model in backend with the TypeScript types in contracts"
"Search for TODO comments across all workspaces"
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 |
This syntax is especially useful when:
Workspace names are derived from:
name field in your .code-workspace file (if specified)If two folders have the same name, append numbers or use the workspace file to give them unique names.
~/projects/my-app/
├── my-app.code-workspace # Workspace config file
├── web/ (React frontend)
├── api/ (Node.js backend)
├── mobile/ (React Native)
└── shared/ (Common utilities)
All folders share one Git history. Changes across packages are atomic.
Example prompt: "Update the API endpoint in both web and mobile apps to match the new backend route"
~/projects/services/
├── services.code-workspace # Workspace config file
├── user-service/ (git: github.com/acme/user-service)
├── payment-service/ (git: github.com/acme/payment-service)
├── gateway/ (git: github.com/acme/api-gateway)
└── proto/ (git: github.com/acme/service-protos)
Each service has its own repository. Cline can update the proto definitions and regenerate clients across all services.
Example prompt: "Add a new field to the UserProfile message in proto, then update user-service and gateway to handle it"
~/projects/fullstack/
├── fullstack.code-workspace # Workspace config file
├── client/ (git: github.com/acme/web-client)
├── server/ (git: github.com/acme/api-server)
└── types/ (git: github.com/acme/shared-types)
The types repository defines interfaces used by both client and server. When you update a type, Cline can fix both consumers.
~/projects/project/
├── project.code-workspace # Workspace config file
├── main-app/ (git: github.com/acme/main-app)
├── vendor/ (no VCS - vendored dependencies)
└── scripts/ (no VCS - local automation)
Mix of repositories and plain folders. Cline adapts to each folder's configuration.
Two features have limitations in multi-root workspace mode:
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 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.
.clineignore file to reduce noise, speed up scanning, and keep Cline focused on source code:# Dependencies
**/node_modules/
# Build outputs
**/dist/
**/build/
# VCS metadata
**/.git/
For more patterns and gotchas, see the .clineignore File Guide.