CU

cursor-codebase-indexing

Configures and manages Cursor's semantic indexing for enhanced codebase-wide AI context.

Install

mkdir -p .claude/skills/cursor-codebase-indexing && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1795" && unzip -o skill.zip -d .claude/skills/cursor-codebase-indexing && rm skill.zip

Installs to .claude/skills/cursor-codebase-indexing

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Set up and optimize Cursor codebase indexing for semantic code search
69 charsno explicit “when” trigger
Beginner

Key capabilities

  • Set up Cursor codebase indexing for semantic search
  • Exclude files from indexing using `.cursorignore` and `.cursorindexingignore`
  • Verify indexing status and progress
  • Perform semantic queries using `@Codebase`
  • Resync the index or clear local cache for troubleshooting
  • Optimize indexing for large projects and monorepos

How it works

The system splits code files into chunks, generates vector embeddings, and stores them for nearest-neighbor search. A Merkle tree detects changes to re-index only modified files.

Inputs & outputs

You give it
Code files within an open Cursor project or a semantic question
You get back
Code embeddings, relevant code chunks for queries, or indexing status

When to use cursor-codebase-indexing

  • Initialize Cursor codebase indexing
  • Check indexing status
  • Troubleshoot @Codebase search relevance
  • Optimize indexing for large projects

About this skill

Cursor Codebase Indexing

Set up and optimize Cursor's codebase indexing system. Indexing creates embeddings of your code, enabling @Codebase semantic search and improving AI context awareness across Chat, Composer, and Agent mode.

How Indexing Works

Your Code Files
      │
      ▼
  Syntax Chunking ─── splits files into meaningful code blocks
      │
      ▼
  Embedding Generation ─── converts chunks to vector representations
      │
      ▼
  Vector Storage (Turbopuffer) ─── cloud-hosted nearest-neighbor search
      │
      ▼
  @Codebase Query ─── your question → embedding → similarity search → relevant chunks

Key Architecture Details

  • Merkle tree for change detection: only modified files are re-indexed (every 10 minutes)
  • No plaintext storage: code is not stored server-side; only embeddings and obfuscated metadata
  • Privacy Mode compatible: with Privacy Mode on, embeddings are computed without retaining source code
  • Indexing runs in the background; small projects complete in seconds, large projects (50K+ files) may take hours initially

Initial Setup

  1. Open your project in Cursor
  2. Indexing starts automatically on first open
  3. Check status: look at the bottom status bar for "Indexing..." indicator
  4. View indexed files: Cursor Settings > Features > Codebase Indexing > View included files

Verify Indexing Status

The status bar shows:

  • "Indexing..." with progress indicator -- initial indexing in progress
  • "Indexed" -- indexing complete, @Codebase queries are available
  • No indicator -- indexing may be disabled or not started

Configuration

.cursorignore

Exclude files from indexing and AI features. Place in project root. Uses .gitignore syntax:

# .cursorignore

# Build artifacts (large, not useful for AI context)
dist/
build/
out/
.next/
target/

# Dependencies
node_modules/
vendor/
venv/
.venv/

# Generated files
*.min.js
*.min.css
*.bundle.js
*.map
*.lock

# Large data files
*.csv
*.sql
*.sqlite
*.parquet
fixtures/
seed-data/

# Secrets (defense in depth -- also use .gitignore)
.env*
**/secrets/
**/credentials/

.cursorindexingignore

Exclude files from indexing only but keep them accessible to AI features when explicitly referenced:

# .cursorindexingignore

# Large test fixtures -- don't index, but allow @Files reference
tests/fixtures/
e2e/recordings/

# Documentation build output
docs/.vitepress/dist/

Difference: .cursorignore hides files from both indexing and AI features. .cursorindexingignore only excludes from the index; files can still be referenced via @Files.

Default Exclusions

Cursor automatically excludes everything in .gitignore. You only need .cursorignore for files tracked by git that you want to exclude from AI.

Using the Index

@Codebase Queries

Ask semantic questions about your entire codebase:

@Codebase where is user authentication handled?

@Codebase show me all API endpoints that accept file uploads

@Codebase how does the payment processing flow work?

@Codebase find all places where we connect to Redis

@Codebase performs a nearest-neighbor search using your question's embedding. It returns the most semantically similar code chunks, even if they do not contain the exact keywords you used.

@Codebase vs @Files vs Text Search

MethodWhen to UseContext Cost
@CodebaseDiscovery -- you don't know which filesHigh (many chunks)
@FilesYou know exactly which fileLow (one file)
@FoldersYou know the directoryMedium-High
Ctrl+Shift+FExact text/regex matchN/A (editor search)

Use @Codebase for discovery, then switch to @Files once you know where the code lives.

Optimization for Large Projects

Monorepo Strategy

For monorepos with many packages, open the specific package directory instead of the root:

# Instead of opening the entire monorepo:
cursor /path/to/monorepo           # Indexes everything -- slow

# Open the specific package:
cursor /path/to/monorepo/packages/api   # Indexes only this package -- fast

Or use .cursorignore at the root to exclude packages you are not actively working on:

# .cursorignore -- monorepo, focus on api and shared
packages/web/
packages/mobile/
packages/admin/
# packages/api/    ← not listed, so it IS indexed
# packages/shared/ ← not listed, so it IS indexed

Re-Indexing

If search results are stale or indexing appears stuck:

  1. Cmd+Shift+P > Cursor: Resync Index
  2. Wait for status bar to show indexing progress
  3. If that fails, delete the local cache:
    • macOS: ~/Library/Application Support/Cursor/Cache/
    • Linux: ~/.config/Cursor/Cache/
    • Windows: %APPDATA%\Cursor\Cache\
  4. Restart Cursor and allow full re-index

File Watcher Limits (Linux)

On Linux, large projects may hit the file watcher limit:

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

# Increase (temporary)
sudo sysctl fs.inotify.max_user_watches=524288

# Increase (permanent)
echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Enterprise Considerations

  • Data residency: Embeddings are stored in Turbopuffer (cloud). Obfuscated filenames and no plaintext code, but metadata exists
  • Privacy Mode: With Privacy Mode on, embeddings are computed with zero data retention at the provider
  • Air-gapped environments: Indexing requires network access to Cursor's embedding API. Not available offline
  • Indexing scope: Only files in the currently open workspace are indexed. Closing a project removes its index from active queries

Troubleshooting

SymptomCauseFix
@Codebase returns no resultsIndex not builtWait for "Indexed" in status bar
Search misses known filesFile in .gitignore or .cursorignoreCheck ignore files
Indexing stuck at N%Large project or network issueResync index via Command Palette
Stale results after refactorIndex not yet updatedWait 10 min or manual resync
High CPU during indexingInitial embedding computationNormal for first run; subsides

Resources

When not to use it

  • When network access to Cursor's embedding API is unavailable
  • When working in air-gapped environments
  • When only exact text or regex matching is needed

Limitations

  • Indexing requires network access to Cursor's embedding API
  • Only files in the currently open workspace are indexed
  • Large projects on Linux may hit file watcher limits

How it compares

This skill enables semantic search across an entire codebase using embeddings, allowing queries based on meaning rather than exact keywords, unlike traditional text search.

Compared to similar skills

cursor-codebase-indexing side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
cursor-codebase-indexing (this skill)826dReviewBeginner
godot1,0445moReviewIntermediate
software-architecture3336moNo flagsIntermediate
drizzle2382moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

generating-trading-signals

jeremylongshore

Generate trading signals using technical indicators (RSI, MACD, Bollinger Bands, etc.). Combines multiple indicators into composite signals with confidence scores. Use when analyzing assets for trading opportunities or checking technical indicators. Trigger with phrases like "get trading signals", "check indicators", "analyze for entry", "scan for opportunities", "generate buy/sell signals", or "technical analysis".

725

You might also like

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,0441,947

software-architecture

davila7

Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.

333868

drizzle

lobehub

Drizzle ORM schema and database guide. Use when working with database schemas (src/database/schemas/*), defining tables, creating migrations, or database model code. Triggers on Drizzle schema definition, database migrations, or ORM usage questions.

238873

screenshot-to-code

OneWave-AI

Convert UI screenshots into working HTML/CSS/React/Vue code. Detects design patterns, components, and generates responsive layouts. Use this when users provide screenshots of websites, apps, or UI designs and want code implementation.

204389

zustand

lobehub

Zustand state management guide. Use when working with store code (src/store/**), implementing actions, managing state, or creating slices. Triggers on Zustand store development, state management questions, or action implementation.

113434

codex

Lucklyric

Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.

32238

Search skills

Search the agent skills registry