AI Usage

Below is a production-ready .cursorignore setup for Frontend, Python, Java, and .NET, plus where and how to apply it across teams

1. Where to Addย .cursorignore [edit]

๐Ÿ“ Location

Place one .cursorignore file at the repository root:

/repo-root
ย โ”œโ”€โ”€ .cursorignore ย  โœ…
ย โ”œโ”€โ”€ src/
ย โ”œโ”€โ”€ app/
ย โ”œโ”€โ”€ services/
ย โ””โ”€โ”€ ...

Cursor automatically detects it.

๐Ÿ“ Monorepo (recommended)

If you have multiple stacks in one repo:

  • Use one root .cursorignore

  • Optionally add stack-specific .cursorignore inside subfolders

/repo-root
ย โ”œโ”€โ”€ .cursorignore
ย โ”œโ”€โ”€ frontend/.cursorignore
ย โ”œโ”€โ”€ backend/.cursorignore

Cursor merges rules (root + local).

2. Universalย .cursorignore(ALL PROJECTS) [edit]

Always start with this โ€” it alone can reduce 30โ€“40% tokens.

# ===== Dependency folders =====

node_modules/

vendor/

packages/

third_party/

# ===== Build outputs =====

dist/

build/

out/

bin/

obj/

target/

coverage/

.tmp/

temp/

# ===== Cache & tooling =====

.cache/

.cursor/

.vscode/

.idea/

.settings/

# ===== Logs & runtime =====

logs/

*.log

*.tmp

# ===== Environment & secrets =====

.env

.env.*

*.key

*.pem

# ===== Generated & auto files =====

generated/

gen/

*.generated.*

*.g.cs

*.designer.cs

*.min.js

*.map

*.lock

# ===== OS files =====

.DS_Store

Thumbs.db

3. Frontend (React / Next.js / Vue / Angular) [edit]

# ===== Frontend dependencies =====
node_modules/

# ===== Framework build outputs =====
.next/
.nuxt/
dist/
build/
out/

# ===== Static exports =====
public/assets/
public/build/

# ===== Test & coverage =====
coverage/
cypress/videos/
cypress/screenshots/
playwright-report/

# ===== Tooling =====
.eslintcache
.stylelintcache
.vite/
.parcel-cache/

# ===== Generated types =====
*.d.ts

๐Ÿ“Œ Why

  • .next, dist, coverage can be huge

  • *.d.ts inflates context without value for reasoning

4. Python (FastAPI / Django / ML / AI) [edit]

# ===== Virtual environments =====
venv/
.venv/
env/

# ===== Python cache =====
__pycache__/
*.pyc
*.pyo
*.pyd

# ===== Build artifacts =====
build/
dist/
.eggs/
*.egg-info/

# ===== ML / AI =====
data/
datasets/
models/
checkpoints/
runs/
mlruns/

# ===== Notebooks =====
.ipynb_checkpoints/

# ===== Test =====
.coverage
pytest_cache/

# ===== Tooling =====
.mypy_cache/
.ruff_cache/
.tox/

๐Ÿ“Œ AI projects tip

  • Never let Cursor read datasets/ or models/

  • Point it only to training code, not artifacts

6. .NET (.NET Core / ASP.NET / MAUI) [edit]

# ===== Build output =====
bin/
obj/

# ===== User-specific =====
*.user
*.suo
*.userprefs

# ===== Logs =====
logs/

# ===== Packages =====
packages/

# ===== Generated =====
*.g.cs
*.designer.cs
*.AssemblyInfo.cs

# ===== Test =====
TestResults/

# ===== Tooling =====
.vs/

๐Ÿ“Œ Critical

  • bin/obj must ALWAYS be ignored

  • .g.cs breaks AI reasoning badly

Tags: