Technique catalog

1 / 6+33
Specify
Scope
+45%CTX
−6ACC

Specify a line range

A 30-line function instead of a 1,200-line file.

Specify a line range

Select the relevant range instead of attaching the entire file: make a selection in Cursor and press Cmd+L, or use @file.ts#L120-160. Every line the model reads counts toward your input; if the bug is in a 30-line function, the other 1,170 lines are pure waste.

context −45%accuracy −6
Reference
Scope
+20%CTX
+2ACC

Reference it—don't paste it

Attach code with @file instead of pasting it into chat.

Reference it—don't paste it

When you paste terminal output or code into chat, it becomes part of the conversation and is resent on every later turn. An @file reference lets the agent read it only when needed and leaves just a small trace in the history afterward.

context −20%accuracy +2
Search
Scope
+40%CTX
+4ACC

Search first, then read

Find the symbol, then open its file—don't scan the directory.

Search first, then read

Instead of asking the agent to wander through directories to find a function, have it locate the target with grep or glob. Search results cost a few hundred tokens; exploring a folder can cost thousands. If you already know the location, provide the exact path.

context −40%accuracy +4
Cut
Scope
+22%CTX
+3ACC

Cut noise with .cursorignore

Files outside the index stay out of context.

Cut noise with .cursorignore

Add directories such as dist, coverage, .next, fixtures, and generated client code to .cursorignore or .cursorindexingignore. Otherwise, semantic search may surface them as candidates and fill the context with irrelevant snippets.

context −22%accuracy +3
Exclude
Scope
+30%CTX

Exclude lockfiles and build output

package-lock.json rarely tells the model anything useful.

Exclude lockfiles and build output

Lockfiles, minified bundles, snapshots, and generated migrations consume many tokens while carrying little useful information. Leave them out entirely; when necessary, show only the relevant package entry.

context −30%
Use
Scope
+28%CTX
+2ACC

Use the exact path

If you know the path, skip semantic search.

Use the exact path

Semantic search can return several file fragments on every call. If you know where the file is, say src/lib/auth/session.ts directly. It is both cheaper and more precise.

context −28%accuracy +2
Filter
Scope
+50%CTX
−4ACC

Filter the log first

A 30-line stack trace instead of 40,000 lines of logs.

Filter the log first

Use head, tail, grep, or jq to isolate the error block, then provide only that section. Dropping a 5 MB file into chat with “inspect this log” can burn tens of thousands of tokens in a single turn.

context −50%accuracy −4
Use
Scope
+35%CTX
+2ACC

Use text for errors

Images are expensive; stack traces are nearly free.

Use text for errors

A screenshot of an error can cost several times more tokens than the same information as text, and it is harder for the model to read reliably. Reserve images for visual or layout issues; copy the text for errors.

context −35%accuracy +2