Hello Cursor team,
I’m trying to understand how AI context scoping and retrieval works in Cursor, and I’ve observed behavior that I’d like clarification on.
Setup
I tested a simple local TypeScript project:
project/
utils.ts
subfolder/
index.ts
I opened only subfolder/ as a workspace (not the project root).
What I tested
1. With an import
In subfolder/index.ts, I imported a helper from the parent folder:
import { helper } from "../utils";
When I then asked:
“is there another helper function I can use?”
Cursor suggested additional helper functions from utils.ts.
2. Without any imports
I removed all imports to parent folders and tested two prompts:
-
First prompt:
“is there another helper function I can use?”
-> Cursor did not surface parent-folder utilities.
-
Second prompt:
“is there a helper function in a parent folder?”
-> Cursor then correctly surfaced functions from
../utils.ts.
My question
Could you clarify how retrieval scope and AI context selection works in these cases?
Specifically:
-
When only a subfolder is opened, is AI retrieval strictly limited to that folder, or can it still access files outside it?
-
How does query phrasing (e.g. mentioning “parent folder”) influence what the AI searches or retrieves?
I’m trying to understand how deterministic or scoped Cursor’s AI context is when working in subfolder-based workflows, and how much query wording affects what parts of the codebase are considered.
Thanks