Skip to content

Performance Optimization for Cursor

You are working on a monorepo with 400,000 lines across 12 packages. Cursor takes 30 seconds to start suggesting completions. Agent mode pauses for 10 seconds before it starts exploring files. The indexing indicator has been spinning for the past hour. You start to wonder if Cursor just does not work for large projects.

It does. But large projects require tuning. Out of the box, Cursor indexes everything, loads every extension, and uses default memory limits designed for small projects. A few targeted changes make the difference between a sluggish experience and instant responses.

  • A .cursorignore configuration that eliminates indexing noise
  • Memory and performance settings tuned for large codebases
  • Extension audit techniques to identify and disable resource-heavy extensions
  • Strategies for reducing context overhead without losing AI quality

Indexing is usually the primary performance bottleneck. Cursor’s semantic search indexes every file it can see. In a project with 50,000 files (including node_modules, build outputs, and generated code), most of the index is noise.

Create a .cursorignore file at the root of your project. This works like .gitignore but specifically controls what Cursor indexes and searches:

For Python projects, also exclude:

.venv/
venv/
__pycache__/
*.pyc
.mypy_cache/
.pytest_cache/
htmlcov/
*.egg-info/

Open Cursor Settings > Indexing & Docs and look at the Codebase Indexing status. If it shows a large number of files indexed, your .cursorignore is not aggressive enough. After updating the ignore file, force a fresh pass with the Resync Index button there (or the command palette if your version exposes a reindex command).

Extensions are the second-largest performance drain. Every VS Code extension you have installed runs inside Cursor and competes for memory and CPU.

  1. Open the Extensions panel (Cmd/Ctrl+Shift+X)
  2. Sort by “Installed”
  3. For each extension, ask: “Do I use this weekly?”
  4. Disable extensions you do not actively use
  5. Pay special attention to extensions that run language servers (Python, Java, C++)

These categories of extensions commonly consume significant resources:

  • Language servers for languages you are not using — If you are in a TypeScript project, disable Java, Python, and C++ extensions
  • Linting extensions that duplicate Cursor’s built-in capabilities
  • Git visualization extensions with real-time file watching
  • Code formatting extensions that run on every save

Use Cursor’s workspace settings to enable extensions only where needed:

{
"extensions.autoUpdate": false,
"extensions.ignoreRecommendations": true
}

You can also disable specific extensions per workspace using the Extensions panel’s workspace toggle.

For large projects, Cursor may need more memory than the default allocation. Add these to your settings.json:

{
"files.maxMemoryForLargeFilesMB": 4096,
"search.maxResults": 20000,
"editor.maxTokenizationLineLength": 20000
}

In large projects, file system watchers consume significant resources:

{
"files.watcherExclude": {
"**/node_modules/**": true,
"**/dist/**": true,
"**/build/**": true,
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/coverage/**": true
}
}

Exclude the same directories from VS Code’s built-in search:

{
"search.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/build": true,
"**/coverage": true,
"**/*.min.js": true,
"**/*.map": true
}
}

If Tab completion feels slow, these settings help:

{
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
},
"editor.suggestOnTriggerCharacters": true,
"editor.acceptSuggestionOnCommitCharacter": false
}

If you use Parallel Agents with worktrees, optimize the initialization. This config lives in its own file — .cursor/worktrees.json — not in settings.json. A reader who pastes it into settings.json will have it silently ignored.

Edit .cursor/worktrees.json:

{
"setup-worktree": [
"pnpm install --frozen-lockfile",
"cp $ROOT_WORKTREE_PATH/.env .env"
]
}

The array-of-commands form runs each command sequentially in the new worktree, and $ROOT_WORKTREE_PATH points back at your primary working tree (handy for copying untracked files like .env). Use pnpm, bun, or uv instead of npm install — they are significantly faster for worktree initialization because they reuse the global package cache. Cursor advises against symlinking dependencies into worktrees, as that can corrupt the main worktree.

The cleanup keys, by contrast, are settings.json keys (and require Cursor 2.1 or newer). Each workspace allows up to 20 worktrees; setting a lower ceiling reclaims disk sooner:

{
// 2.1 and above only
"cursor.worktreeCleanupIntervalHours": 6,
"cursor.worktreeMaxCount": 10
}

Indexing still slow after .cursorignore changes. Reindex explicitly via the command palette. The ignore file changes may not take effect until the next full reindex.

Tab completion disappears entirely. Check that you have not disabled the TypeScript language server. Also verify that your project has a valid tsconfig.json — Tab completion relies on the TypeScript language service.

Agent responses are slow but indexing is fine. The bottleneck may be network latency to the AI model, not local performance. Try a different model (Claude Sonnet 4.6 is faster than Claude Opus 4.8) or check your internet connection.

Worktrees eat disk space. Reduce cursor.worktreeMaxCount and cursor.worktreeCleanupIntervalHours in settings. Run git worktree list to see all active worktrees and git worktree prune to clean up stale ones.