Manage Repos & Large Codebases in Cursor

Written by [object Object]

By Kevin Kern

March 23, 2025
3 min read

Workspace Setup for Multiple Repositories

Cursor finally supports multi-root workspaces.

This lets you open and work across multiple repositories or project folders in a single workspace.

All folders are indexed for AI context, making it easier to navigate and edit codebases with shared libraries, microservices, or mono-repo structures.

Just open a .code-workspace file with all paths listed, and Cursor will treat them as one integrated workspace.

For best results, point the first path to your main repo, and maintain consistent folder names to avoid path issues during edits.From the official Cursor ChangelogFrom the official Cursor Changelog

Project-Specific Context and Cursor Rules

Cursor’s Project Rules (.cursor/rules files) provide AI guidance for your codebase. In a multi-repo setup, nested rules directories are now supported, so each repo can have its own .cursor/rules file. The AI applies rules based on context, using glob/path and descriptions to determine relevance. Maintain global rules in the root .cursor folder and project-specific ones in sub-repos. The UI now shows active rules for clarity.

See my blog post Everything you need to know about Cursor Rules

Using Git Worktrees and External Tools

Git worktrees allow multiple working directories from one repo, useful for running parallel Cursor instances on different branches. They don’t merge contexts across repos but help with multitasking within a repo. Community tools like Repoprompt and Repomix let you inject entire directories or repositories into an LLM prompt, bypassing Cursor’s context limits. Cursor Tools, a CLI plugin, automates this, giving the AI a comprehensive codebase view, though API costs apply for large codebases.

Community Workflows and Best Practices

Open all repos in one Cursor workspace and include an architecture overview in .cursor/rules or READMEs to help the AI understand relationships. Be explicit when prompting the AI about which repo you’re working on, and use the @ syntax to reference files across subdirectories. Verify AI-proposed changes across repos to ensure consistency.

NEW: Inline Edit

Inline Edit now supports full file changes. This helps when you need to change the structure of a file without using the Agent.

You can also send blocks to the Agent for multi-file edits.

Pro tip: Use CMD/CTRL + SHIFT + P, select "Add Context for CMD K," and save a selection to use later. This is helpful if you're reusing part of a large file elsewhere.

See Cursor 0.50: What's New? for all the Cursor 0.50 updates.

Other interesting posts:

Have a look at the rest of my Cursor guides:

Join Instructa Pro today

Learn to build software with AI, ship fast and see real results.

Faster Project Launches

Boost your income - AI is high demand

Join a Supportive Community

Get Simple, Step-by-Step Guidance