Skip to content
cursor-indexing-issues logo

Cursor Indexing Issues

cursor-indexing-issues

Troubleshoot Cursor codebase indexing: stuck indexing, empty search,

SKILL.md

Full skill instructions

Cursor Indexing Issues

Diagnose and fix codebase indexing problems. Covers stuck indexing, empty search results, stale results, and performance optimization for large codebases.

Quick Diagnosis

SymptomLikely CauseQuick Fix
Status bar stuck on "Indexing..."Large codebase or network issueAdd .cursorignore, resync
@Codebase returns nothingIndex not built or file excludedWait for index, check ignore files
@Codebase finds wrong codeStale indexResync index
Indexing crashes / restartsMemory or file watcher limitsIncrease limits, reduce scope
"Unable to index" errorNetwork blocked or auth expiredCheck proxy/​firewall, re-auth

Fix: Stuck Indexing

Step 1: Reduce Scope

Create or update .cursorignore in project root:

# .cursorignore -- exclude non-essential directories

# Build output
dist/
build/
.next/
out/
target/

# Dependencies (always exclude)
node_modules/
vendor/
.venv/
venv/

# Generated / large files
*.min.js
*.min.css
*.bundle.js
*.map
*.lock
package-lock.json
yarn.lock
pnpm-lock.yaml

# Data files
*.csv
*.sql
*.sqlite
*.parquet
*.json.gz
fixtures/

# Media
*.png
*.jpg
*.gif
*.svg
*.mp4
*.woff2

Step 2: Resync Index

Cmd+Shift+P > Cursor: Resync Index

Step 3: Clear Cache (if resync fails)

# macOS
rm -rf ~/​Library/​Application\ Support/​Cursor/​Cache/
rm -rf ~/​Library/​Application\ Support/​Cursor/​CachedData/

# Linux
rm -rf ~/​.config/​Cursor/​Cache/
rm -rf ~/​.config/​Cursor/​CachedData/

# Windows (PowerShell)
Remove-Item -Recurse "$env:APPDATA\Cursor\Cache"
Remove-Item -Recurse "$env:APPDATA\Cursor\CachedData"

Restart Cursor after clearing cache. Full re-index begins automatically.

Fix: @Codebase Returns No Results

Check 1: Is Indexing Complete?

Look at the bottom status bar. If it says "Indexing...", wait for it to finish. For projects with 10K+ files, initial indexing can take 10-30 minutes.

Check 2: Is the File Excluded?

A file might be excluded by:

  1. .gitignore (Cursor respects this by default)
  2. .cursorignore (explicit exclusion)
  3. .cursorindexingignore (excluded from index but not from AI features)

Verify: Cursor Settings > Features > Codebase Indexing > View included files

This opens a text file listing all indexed paths. Search for the file you expect to find.

Check 3: Network Connectivity

Indexing requires network access to Cursor's embedding API. Test:

  • Can you access api.cursor.com?
  • Is a corporate proxy blocking outbound HTTPS?
  • Is a VPN interfering?

Check 4: Semantic vs Keyword Search

@Codebase uses semantic search (embeddings), not keyword matching. The query "authentication middleware" will find files about auth even if they never use the word "middleware." But it may miss files if the semantic meaning is very different from the query.

For exact keyword matching, use Cmd+Shift+F (workspace search) instead.

Fix: Stale / Outdated Results

Cursor re-checks for file changes every 10 minutes using a Merkle tree. If you need fresher results:

  1. Save all open files
  2. Cmd+Shift+P > Cursor: Resync Index
  3. Wait for "Indexed" status to reappear
  4. Retry your @Codebase query

Performance Optimization for Large Projects

Indexing Time Benchmarks

Project SizeFiles IndexedInitial Index Time
Small (< 1K files)~500< 30 seconds
Medium (1K-10K files)~5,0001-5 minutes
Large (10K-50K files)~20,0005-30 minutes
Very large (50K+)~50,000+30 min - 2 hours

Monorepo Strategy

Do not open the entire monorepo root. Instead:

# Open just the package you're working on:
cursor packages/​api/

# Or use .cursorignore to exclude other packages:
# .cursorignore
packages/​web/
packages/​mobile/
packages/​admin/
packages/​deprecated-*

Linux File Watcher Limits

If indexing crashes on Linux with large projects:

# Check current limit
cat /​proc/​sys/​fs/​inotify/​max_user_watches

# Increase to 524288 (persists across reboots)
echo "fs.inotify.max_user_watches=524288" | sudo tee -a /​etc/​sysctl.conf
sudo sysctl -p

Memory Pressure

If Cursor runs out of memory during indexing:

// settings.json
{
  "files.maxMemoryForLargeFilesMB": 4096,
  "files.watcherExclude": {
    "**/​node_modules/​**": true,
    "**/​.git/​**": true,
    "**/​dist/​**": true,
    "**/​build/​**": true
  }
}

.cursorignore vs .cursorindexingignore

FileIndexed?Available to AI?Use Case
Listed in .cursorignoreNoNo (best effort)Secrets, large binaries, build output
Listed in .cursorindexingignoreNoYes (via @Files)Test fixtures, docs, large but useful files
Not in any ignore fileYesYesYour source code

Use .cursorindexingignore for files you want to reference explicitly but not have polluting search results:

# .cursorindexingignore
tests/​fixtures/​large-sample.json
docs/​api-spec.yaml
e2e/​recordings/

Enterprise Considerations

  • Data residency: Embeddings stored in Turbopuffer cloud. No plaintext code stored, but metadata (obfuscated filenames) exists server-side
  • Air-gapped environments: Indexing requires outbound HTTPS. Not available in fully air-gapped setups
  • Index freshness SLA: 10-minute polling interval is not configurable. Manual resync is the only way to force immediate re-index
  • Audit: No logging of which files are indexed. Use .cursorignore proactively for regulated data

Resources

More skills from jeremylongshore

openrouter-compliance-review logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-compliance-review

Review OpenRouter integration for regulatory compliance (SOC2, GDPR,

2.8K 0
View
maintainx-data-handling logo
jeremylongshore/claude-code-plugins-plus-skills

maintainx-data-handling

Data synchronization, ETL patterns, and data management for MaintainX.

2.8K 0
View
groq-core-workflow-a logo
jeremylongshore/claude-code-plugins-plus-skills

groq-core-workflow-a

Execute Groq primary workflow: chat completions with tool use and JSON

2.8K 0
View
validating-csrf-protection logo
jeremylongshore/claude-code-plugins-plus-skills

validating-csrf-protection

Validate CSRF protection implementations for security gaps. Use when

2.8K 0
View
api-contract logo
jeremylongshore/claude-code-plugins-plus-skills

api-contract

Configure this skill should be used when the user asks about "API contract",

2.8K 0
View
ideogram-incident-runbook logo
jeremylongshore/claude-code-plugins-plus-skills

ideogram-incident-runbook

Execute Ideogram incident response with triage, mitigation, and postmortem.

2.8K 0
View
gamma-sdk-patterns logo
jeremylongshore/claude-code-plugins-plus-skills

gamma-sdk-patterns

Reusable patterns for the Gamma REST API (no SDK exists).

2.8K 0
View
deepgram-sdk-patterns logo
jeremylongshore/claude-code-plugins-plus-skills

deepgram-sdk-patterns

Apply production-ready Deepgram SDK patterns for TypeScript and Python.

2.8K 0
View
openrouter-upgrade-migration logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-upgrade-migration

Migrate to OpenRouter from direct provider APIs or upgrade between SDK/model

2.8K 0
View
openrouter-common-errors logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-common-errors

Diagnose and fix common OpenRouter API errors. Use when encountering

2.8K 0
View
linear-cost-tuning logo
jeremylongshore/claude-code-plugins-plus-skills

linear-cost-tuning

Optimize Linear API usage, reduce unnecessary calls, and maximize

2.8K 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View