Composer gives an answer, you expand the “context” panel up top, and utils/parseInvoice.ts — the file you know is relevant — isn’t on the list. Cursor’s context panel is the actual file set handed to the model; not in it means not seen. Usually this isn’t a bug but one of a few classic retrieval failures: low score, excluded by .cursorignore, edited too recently to be reindexed, or context window crowded by noise.
You can fix it instantly (manual @File) or systematically (improve the signal).
Common causes
1. Embedding retrieval scored too low
Cursor embeds file contents for similarity search. A 500-line utils.ts of mixed helpers dilutes the “parse invoice” similarity; the same code in a file named parseInvoice.ts lights up the filename signal and jumps to the top.
How to judge: try git mv utils.ts parseInvoiceHelpers.ts, reindex, recheck the panel.
2. Excluded by .cursorignore or .gitignore
Cursor honors .gitignore and adds .cursorignore on top. Common over-reach: dist/, build/, generated/ — which often hold schemas/types the model should reference.
How to judge:
cat .cursorignore
git check-ignore -v path/to/missing-file.ts
The second command names the rule that excluded it.
3. File was just renamed or just created
Indexing is incremental but renames can linger 5-30 seconds on the old name; new files need a save event to register. During that window retrieval uses the stale index.
How to judge: Settings → Features → Codebase Indexing — compare “Files indexed” to git ls-files | wc -l.
4. Context window full; key file got bumped
The model’s context window is finite. Composer’s auto-included “recent edits,” “open tabs,” and “imported files” can fill it, evicting the target.
How to judge: a dozen unrelated tabs or recent files on the panel is the giveaway.
5. Generic filename splits similarity
index.ts, helpers.ts, types.ts, utils.ts — dozens of these in a monorepo, retrieval picks the wrong sibling.
How to judge: panel shows same-named files but wrong paths.
6. Binary / very large / unsupported extension
.parquet, .bin, .gz, or any text file over ~1MB is skipped by default.
How to judge: ls -lh path/to/file. >1MB even with a regular extension can be skipped.
Before you start
- Identify which entry point misbehaved: Composer / Cmd+K / chat. Cmd+K doesn’t use repo retrieval at all.
- Commit before changing renames / ignore rules so you don’t trash team config.
- Note Cursor version and active model; retrieval ranking shifts between versions.
Info to collect
- Cursor version, OS, total file count in the repo.
- Full
.cursorignore; relevant.gitignoreentries. - Screenshot of Settings → Features → Codebase Indexing (“Last indexed” + “Files indexed”).
- Screenshot of the Composer context panel (the actual list of loaded files).
- Path, size, and extension of the missing file.
Shortest fix path
Ordered “instant rescue → systemic improvement.”
Step 1: Manual @File
Fastest. In Composer input type @parseInvoice, let autocomplete pull it in, then send the prompt. Always works, 5 seconds.
Step 2: Audit .cursorignore
cat .cursorignore
git check-ignore -v src/utils/parseInvoice.ts
If matched:
- Quick: comment the rule, reload Cursor, retry.
- Long-term: use a tighter glob like
dist/**/*.jsinstead ofdist/to keep types around.
Step 3: Force-rebuild the index
Cmd+Shift+P → “Cursor: Rebuild Codebase Index.” Wait 5-30 minutes. Mandatory after big renames or bulk additions.
Step 4: Give important files semantic names
Split utils.ts into parseInvoice.ts / formatCurrency.ts / validateEmail.ts. Retrieval score = filename signal + content signal; better names jump straight to the top.
Step 5: Pin canonical files via .cursorrules
# .cursorrules
When working on invoice logic, always read:
- src/utils/parseInvoice.ts
- src/types/invoice.ts
- src/api/invoices.ts
These define the canonical model and parser.
Cursor feeds rules straight to the model, effectively a hand-built index.
Step 6: Evict noise from the panel
Each file in Composer’s context panel has a × button — remove unrelated tabs and history items to free window for the target. Or Composer Settings → turn off “Auto-include open tabs.”
How to verify the fix
- Restart Cursor and rerun the same prompt; confirm the target file shows in the panel.
- After the response, ask Composer “List every file you read” to verify it actually used the target file.
- Sync the repo on another machine and reproduce — confirms it isn’t only your local index that’s fixed.
If it still fails
- Reduce prompt to one keyword + explicit @File.
- Roll back the most recent
.cursorignorechange or Cursor upgrade. - Search forum.cursor.com for “context panel missing”; include version + repo structure + missing file path.
- Grab View → Output → Cursor indexing logs and post to Bug Reports.
Prevention
- Use semantic filenames for important files; avoid
utils.ts/helpers.ts. - Keep
.cursorignoreto actual build artifacts only; preserve types / schemas / configs. - Pin canonical files for core workflows in
.cursorrulesor aCONTEXT.md. - After bulk renames / additions, immediately Cmd+Shift+P → Rebuild Codebase Index — don’t wait.
- For high-stakes prompts, always manually @File the key references. Don’t bet on auto-retrieval.