Cursor Rules: Write .mdc Files the Agent Actually Follows
The four Cursor rule types, .cursor/rules/*.mdc vs legacy .cursorrules vs AGENTS.md, and how to scope rules so the model obeys them. Current to June 2026.
Articles tagged with #Cursor
The four Cursor rule types, .cursor/rules/*.mdc vs legacy .cursorrules vs AGENTS.md, and how to scope rules so the model obeys them. Current to June 2026.
Cursor's Auto router sends a complex refactor to a small model and you get shallow edits. Diagnose the routing signals and force the right model for hard tasks.
Cursor reopens with an empty chat list, only the latest thread, or stuck on 'Loading Chat'. Usually a workspace-hash change, a botched update migration, or a corrupted state.vscdb. How to recover and prevent it.
Cmd-K (Ctrl+K) spins forever or shows "Taking longer than expected…" with no diff. The fast fix: Reload Window or update Cursor. Walk the six verified causes.
Cursor's Extensions panel shows a network error, empty list, or a stuck spinner. Cursor uses Open VSX, not Microsoft's marketplace. Pick the right cause and fix it fast.
Added an MCP server in Cursor but it stays disconnected, or no tools appear in chat. 90% of the time it's a bad PATH, a JSON typo, or a stdout leak. Diagnose and fix in five minutes.
Cursor uses system Python instead of your project venv, breaking imports, linting, and agent edits. Fix the interpreter picker, venv discovery, shell PATH, and the new Python Environments panel.
Cursor has no native Settings Sync. When a Gist-sync extension, dotfiles symlink, or cloud folder pushes stale config to a second machine, your rules, keybindings, or MCP servers get clobbered. Diagnose which sync layer did it and recover the good version.
Cursor's SSH Remote session disconnects while you edit, losing agent context and unsaved buffers. Fix it with the right keepalive values, and check for the v1.0.51 reconnect bug.
After a rebase or branch switch Cursor cites files and line numbers that no longer exist. The indexer fell behind your git state. Force a re-index and harden the workflow.
Cursor Agent runs terminal commands with no confirmation even after you turned auto-run off. As of June 2026 it's almost always Run Mode, a wide allowlist, or a workspace permissions.json. Fix it in a minute.
Cursor agent shows a spinner forever on a tool call. Nine times out of ten it is a shell command waiting on input — most often your own .zshrc. Here is the fast fix and the full diagnosis.
Composer started strong then forgot which file it was editing — context window blew up; chunk the refactor and recheckpoint.
Composer ignores your .cursorrules or .cursor/rules. Usually a frontmatter syntax error, wrong path, deprecated format, or a glob that never matches the open file.
Your $20 Pro credits vanish mid-month and Cursor says you've hit your limit. Here's how Cursor's usage-based billing actually works (it killed fast/slow requests in 2025) and how to stretch your quota.
Cursor's site advertises a model but your local Settings → Models picker doesn't show it. Old client, stale cache, or staged rollout — here's how to tell which and fix it.
Cursor ignores your rules: legacy .cursorrules is skipped in Agent mode, a broken .mdc frontmatter is silently dropped, wrong location/extension, BOM, or a stale cache. Diagnose and fix.
Cursor's real learning curve isn't install — it's knowing when to use Tab, Inline edit (Cmd-K), Composer (Cmd-I), Chat (Cmd-L), or Agent mode. Five surfaces, four real edits, with June 2026 pricing and models.
How Cursor's codebase index actually works, the .cursorignore vs .cursorindexingignore split, and the tuning loop that stops wrong-file references — verified June 2026.
You hit Apply, Cursor says it's done, but the file never changed — usually a stale snapshot, an outside edit, or a locked file.
Cursor shows a diff but Apply does nothing, fails silently, or says the apply model made no changes. Fastest fix: save all files, close other editor windows, then Reapply.
Composer is sharp in a small repo and loses the thread in a 50k-file monorepo. Force focus with @Files, MDC rules, and scoped tasks — not heroic re-indexing.
Composer rewrote 10+ files and broke working code. Revert fast with a Cursor checkpoint or git, then bound the prompt and mode so it stays surgical.
Open a team repo and Cursor's formatting or AI behavior changes? The repo's .vscode/settings.json is overriding your user settings. Here's how to find which layer won.
The Cursor context panel skips the file you know is relevant. Fix it in 5 seconds with @, then stop it recurring: check .cursorignore, resync the index, and rename generic files.
Composer dropped a 30-file, 2000-line diff and you can't review it honestly. Reject (or restore the checkpoint), then make Composer split it into reviewable PRs.
Composer says done and the touched files lint clean, but the build fails. The fast fix: turn on Auto-run so the agent runs typecheck + build itself before declaring success.
Cursor wrote a new formatDate but src/utils already has one. The existing helper never reached retrieval — here is how to make Cursor grep first and reuse it.
Editor shows old code after an AI edit, save says "file modified externally", or AI changes silently revert — the watcher / AI-write race, and how to fix it without losing work.
Cursor's index spinner runs for hours with no progress. Usually it's a bloated repo, a missing .cursorignore, a corporate HTTP/2 proxy, symlink loops, or permissions. Here's how to find which one.
Cursor only edits files it can see. Fix indexing scope, open the right workspace root, and pin files with @ references.
You @ one file and Cursor answers about a different same-named file. Fix the @-picker, stale index, and symlink causes with full-path references and a resync.
Cursor pulls old, vendored, or generated files into context and produces wrong patches. Fix the index, .cursorignore, and prompt pinning.
Tab and Composer use different naming / formatting / patterns than your repo — training prior beats retrieval; anchor explicitly.
Grey inline completions vanished in Cursor? Re-enable Tab, check sign-in/quota, kill Copilot's keybinding, switch to HTTP/1.1, or clear the cache. Step-by-step, verified June 2026.
Cursor's agent runs a shell command and gets it wrong — wrong working dir, wrong package manager, env not loaded, output truncated, or .zshrc hangs the run. Concrete fixes.
Claude Code is a terminal agent; Cursor is an in-editor copilot. Compare pricing, models, rollback, and task fit with current 2026 numbers and a decision sheet.
Install Cursor and ship your first useful edit in 30 minutes: Inline (Cmd+K), Composer Agent/Ask/Plan, codebase indexing, @ context, Apply, and rollback. Updated June 2026.
Cursor stuck on Indexing or re-indexing in a loop? It's usually a build/cache directory your file watcher keeps touching. Here's the .cursorignore template, the watcherExclude fix, and how to confirm the index is healthy.