AI Navigate

Five things Cursor does wrong by default (and how to fix them)

Dev.to / 3/18/2026

💬 OpinionTools & Practical Usage

Key Points

  • Cursor sometimes edits files you didn't ask it to touch, causing unintended changes; fix: apply a minimal footprint and only modify files directly required for the stated task.
  • It uses deprecated Next.js patterns by default in App Router projects, such as getServerSideProps or next/router imports; fix: ensure the project uses App Router and check app/ structure before creating new files.
  • It claims work is done without running tests, so you only find failures later; fix: do not declare completion until tests pass and show the test output.
  • It uses string concatenation (or f-strings) for SQL, risking SQL injection; fix: all database queries must be parameterized and never concatenate user input.
  • It adds console.log statements and sometimes leaves them in final diffs; fix: remove debugging output before finalizing.

Cursor ships with sensible defaults that don't match every project. These five behaviors cost me time until I added explicit rules to correct them.

1. It edits files you didn't ask it to touch

Ask Cursor to fix a function and it sometimes "improves" the calling code, adds types to adjacent variables, or reorganizes imports. Technically correct, not what you wanted.

Fix: Minimal footprint. Only modify files directly required for the stated task.

2. It uses deprecated Next.js patterns

Cursor trained on years of Next.js Pages Router code. For App Router projects, it sometimes defaults to getServerSideProps, useRouter from next/router, or pages in the wrong directory.

Fix: This project uses Next.js App Router. Do not use Pages Router patterns. Check the existing app/ directory structure before creating new files.

3. It claims done when it isn't

Cursor says "I've implemented X" without running tests. If tests don't pass, you find out when you run them yourself.

Fix: Do not say work is complete until you have run the tests and confirmed they pass. Show the test output.

4. It uses string concatenation for SQL

For projects without an ORM, Cursor occasionally uses f-strings or string formatting in database queries instead of parameterized queries.

Fix: All database queries must use parameterized queries. Never concatenate user input into SQL strings.

5. It adds console.log statements and forgets to remove them

Debug logging is added mid-implementation and sometimes stays in the final diff.

Fix: Remove all console.log, print(), and debug statements before finalizing. Do not leave debugging output in committed code.

Where to put these rules

In your .cursorrules file at the project root. The file is plain text — one rule per line or short paragraphs. Cursor loads it into context at the start of every conversation.

You can generate a starter .cursorrules file for your stack at builtbyzac.com/tools/cursorrules-generator.html — free, runs in browser.