The Deska blog
Claude Code Across Multiple Folders: Workspace Patterns
Learn how to manage Claude Code across multiple folders using directory scope search and multi-repo workspace patterns for efficient AI development.
· 10 min read
Managing complex software projects often involves navigating several repositories or directory structures simultaneously. When using toolsets like Claude Code, the ability to operate across these boundaries becomes critical for maintaining context and ensuring architectural consistency. Integrating Claude Code across multiple folders requires a solid understanding of directory scope search and how certain environments allow these tools to interact with your local filesystem.
The Strategy for Multi-Folder Projects
Most AI coding agents are initialized within a specific root directory. This root typically defines the boundary for the agent's file system access and its understanding of the project structure. When your work spans a microservices architecture or a collection of shared libraries and frontend applications, you must decide how to present these files to the agent.
One approach is to launch the agent from a parent directory that contains all relevant subfolders. This provides the broadest perspective but can sometimes lead to context saturation if the total file count is too high. A more surgical approach involves maintaining separate agent sessions for each repository while having a way to bridge the information between them.
Directory Scope Search in AI Workflows
Directory scope search is the mechanism by which an agent searches for specific code patterns, definitions, or documentation within a defined path. When working with multiple folders, the effectiveness of these searches depends on how the working directory is managed.
- Narrow scoping involves targeting a specific subdirectory to reduce noise and speed up the agent's reasoning process.
- Broad scoping allows the agent to find references across different services, which is vital for refactoring cross-project dependencies.
- Exclusion patterns are equally important to prevent the agent from indexing large build artifacts or dependency folders like
node_modules.
Effective search patterns often start with broad questions to identify the location of relevant logic, followed by narrow, scoped commands to execute precise edits within a single folder.
Managing Local Context and Files
Since tools like Claude Code are often local-first, the way you organize your physical files directly impacts the agent's performance. Keeping logic centralized and using clear naming conventions helps the agent navigate through different folders without getting lost in deeply nested structures.
Security is a significant consideration when granting an agent access to multiple folders. By using a local-first approach, you ensure that the files remain on your machine. You can read more about how this works at local-first. This privacy model is crucial when legal or security constraints prevent the transmission of large codebases to third-party cloud environments for indexing.
Workspace Patterns for Side-by-Side Operation
A common challenge when working on multiple repositories is the constant context switching. Developers often need to see the logs of a backend service while their AI agent modifies the frontend code. This is where specialized environments come into play.
| Pattern | Benefit | Trade-off |
|---|---|---|
| Single Root | High visibility for the agent across all files. | Potential for too much context noise. |
| Multi-instance | Clean separation of concerns for different services. | High manual overhead to sync information. |
| Canvas Workspaces | Visual layout of multiple repositories. | Requires tools that support multiple panels. |
Deska offers a unique solution to these patterns through its infinite canvas. In Deska, you can arrange multiple terminals side by side. Each terminal can run a separate instance of Claude Code, each scoped to a different folder. You can learn more about managing these layouts at workspaces. This setup allows you to zoom out to see the entire system architecture or zoom in on a specific logic block.
Using Deska for Multi-Folder Coordination
Deska is a free desktop app for Mac, Windows, and Linux that provides an infinite canvas workspace. It is designed to run AI coding agents like Claude Code, Codex CLI, and OpenCode side by side as panels. This capability is particularly useful when you need to coordinate changes across several folders.
Instead of switching tabs in a traditional editor, you can place a terminal for your API folder next to a terminal for your React frontend folder. You can also place an editor and a browser panel nearby to test the changes in real-time. If you use your own API keys, you can leverage the lifetime tier for these agents.
For developers who need to step away from their desk, the mobile app allows you to monitor these multi-folder sessions through a secure relay. Because devices pair directly, no ports are exposed, maintaining the security of your multi-repo setup.
Orchestrating Agents with Ask Deska
When managing multiple agent instances, coordination is key. Deska includes a feature called Ask Deska, a voice and chat assistant that can drive the workspace. For example, you can use Ask Deska to open new panels, run commands across different terminals, or check the status of active sessions.
If you have several Claude Code sessions running in different folders, you can interact with the workspace via voice to reorganize your view or trigger scripts. This reduces the friction of manual window management, allowing you to focus on the architectural logic rather than the logistics of folder navigation. Detailed information on this assistant can be found at ask-deska.
FAQ
How to use Claude Code in multiple folders?
The most effective way is to run separate instances of the CLI in different terminal panels, each initialized in its respective project directory. This keeps the AI context clean and prevents the agent from being overwhelmed by unrelated files.
Does Claude Code support directory scope search?
Yes, you can direct the agent to focus its search and analysis on specific subdirectories by providing relative paths in your prompts. This is essential for large monorepos or multi-folder projects where you only need to modify certain modules.
Can I run multiple AI coding agents at once?
Using a workspace like Deska, you can run Claude Code, Codex CLI, and other agents side by side in individual panels. This allows you to compare their outputs or use different agents for different parts of a multi-folder repository.
Get Started with Multi-Folder Workspaces
Managing projects across multiple folders does not have to be a manual chore. By utilizing a workspace that supports side-by-side agents and providing a clear visual representation of your filesystem, you can significantly increase your development velocity.
Experience a local-first, flexible environment by visiting our download page to get the Deska desktop app for your operating system. Whether you are coordinating microservices or managing a complex frontend and backend split, the right workspace pattern makes all the difference.