Verified against Cursor · 2026-07-31
Scope Cursor's chat context with @-symbols instead of hoping the index finds the right files
A brief for composing a chat or Agent-mode request using explicit @Files/@Folders/@Docs/@Git references rather than relying on implicit semantic search, so the model reasons from exactly the sources you intend instead of whatever the embedding index ranks as closest.
The prompt
Ready to copy — highlighted parts are example details you can swap.
QUESTION OR TASK Why does the checkout flow sometimes charge tax twice, and where should the fix go? Use explicit @-references below rather than relying on automatic codebase search to find the relevant context. Name the exact sources so nothing important is missing and nothing irrelevant gets pulled in by a semantic-similarity guess. @Files / @Folders TO INCLUDE @lib/tax/calculateTax.ts, @app/checkout/CheckoutSummary.tsx, @app/api/checkout/route.ts @Docs TO INCLUDE, IF ANY @Docs Stripe Tax API — the tax_behavior field documentation specifically. @Git CONTEXT, IF RELEVANT @Git blame on calculateTax.ts for the last 3 commits touching the tax_behavior handling. WHY THESE SOURCES SPECIFICALLY Excluding the admin refund flow entirely — tax is calculated fresh on checkout, refunds only reference the stored amount, so they are not part of this bug. RULES - Answer or act using only the referenced sources above plus what you can directly read from files those sources point to (an import, a type definition one hop away). If the task genuinely can't be completed from these sources alone, say exactly what's missing rather than falling back to a broader unscoped search silently. - If two of the referenced sources disagree with each other — a doc describing behavior the code doesn't actually have — say so explicitly and ask which one is authoritative rather than picking one side without flagging the conflict. - Do not treat a semantically similar file that wasn't referenced as equally authoritative just because it turned up while reading the ones that were. Mention it as a note if it seems relevant, but don't reason from it as if it had been included on purpose.
Customize
Optional — swap in your own details for the highlighted parts above.
Why this works
Cursor's default behavior when no explicit @-reference is given is to run a semantic search over the codebase's embedding index and surface whatever ranks closest to the question's phrasing, which works well when the relevant code happens to use similar vocabulary to the question and works poorly when it doesn't — a tax bug described in terms a reviewer would use ("charged twice") may rank a logging or analytics file that happens to mention "charge" more literally above the actual tax-calculation file that never uses that word. Naming @Files and @Folders explicitly removes that dependency on vocabulary overlap entirely and replaces it with a guarantee: the model reasons from exactly what's referenced, not from whatever an embedding-similarity ranking decided was close enough. @Docs and @Git matter for a different reason — they're sources the default semantic search over the codebase's own files wouldn't surface at all, since indexed documentation and commit history live outside the file tree the standard search operates over, so a question that genuinely depends on "what does the third-party API's field actually mean" or "when did this behavior change and why" needs those referenced on purpose or the model will answer from its own general knowledge of the API instead of this specific integration's documented behavior. SOURCE_JUSTIFICATION stated explicitly matters because it makes exclusion a deliberate act the model can be held to — without it, there's no way to tell whether the refund flow was left out because it's genuinely irrelevant or because it just didn't come to mind, and the rule against treating an unreferenced-but-similar file as equally authoritative closes the gap where the model reads one hop beyond what was referenced, finds something plausible-looking, and quietly reasons from it as if it had been included on purpose.
Verified against
Cursor 2.2 · 2026-07-31
Changelog
- 2026-07-31 — Initial publish, verified against Cursor 2.2 @-symbol context references (@Files, @Folders, @Docs, @Git).
Need this built into your business?
If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.
EXPLORE CUSTOM SOFTWARE
