From cursor-pack
Sets up and optimizes Cursor codebase indexing for @Codebase semantic search. Configures .cursorignore files, verifies status, and details embedding workflow.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin cursor-packThis skill is limited to using the following tools:
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.
Diagnoses and fixes Cursor codebase indexing issues: stuck indexing, empty @codebase results, stale indexes, crashes, and performance optimization.
Performs semantic code search across the codebase using ccc CLI, manages initialization, indexing freshness, path/language filtering, and pagination.
Guides onboarding to new or unfamiliar codebases by checking CocoSearch index, exploring architecture, key modules, and code patterns via semantic search.
Share bugs, ideas, or general feedback.
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.
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
Cursor Settings > Features > Codebase Indexing > View included filesThe status bar shows:
@Codebase queries are availableExclude 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/
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.
Cursor automatically excludes everything in .gitignore. You only need .cursorignore for files tracked by git that you want to exclude from AI.
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.
| Method | When to Use | Context Cost |
|---|---|---|
@Codebase | Discovery -- you don't know which files | High (many chunks) |
@Files | You know exactly which file | Low (one file) |
@Folders | You know the directory | Medium-High |
Ctrl+Shift+F | Exact text/regex match | N/A (editor search) |
Use @Codebase for discovery, then switch to @Files once you know where the code lives.
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
If search results are stale or indexing appears stuck:
Cmd+Shift+P > Cursor: Resync Index~/Library/Application Support/Cursor/Cache/~/.config/Cursor/Cache/%APPDATA%\Cursor\Cache\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
| Symptom | Cause | Fix |
|---|---|---|
| @Codebase returns no results | Index not built | Wait for "Indexed" in status bar |
| Search misses known files | File in .gitignore or .cursorignore | Check ignore files |
| Indexing stuck at N% | Large project or network issue | Resync index via Command Palette |
| Stale results after refactor | Index not yet updated | Wait 10 min or manual resync |
| High CPU during indexing | Initial embedding computation | Normal for first run; subsides |