Black Friday week: local AI hardware on sale. See the list.
← All guides

Cursor Ignores Your Rule Because It Is .md, Not .mdc

The rule is in the right folder. Cursor can open it. The agent still ignores it. Check the suffix: a plain .md file under .cursor/rules is documentation, not a Cursor project rule.

Jump to 7 sections
  1. Bottom line
  2. The symptom
  3. The cause
  4. The fix
  5. Verify it in Cursor
  6. When to use AGENTS.md instead
  7. Related agent-rule guides

Bottom line

  • Cursor project rules use .mdc, not .md.
  • A file named .cursor/rules/api-guidelines.md is ignored.
  • Rename it to .mdc, then set its activation mode in frontmatter.
  • Use AGENTS.md when you want plain Markdown without Cursor-specific metadata.

The official Cursor Rules documentation says project rules live in .cursor/rules as .mdc files. It also states that a plain .md file in that folder is ignored. The page was checked on August 20, 2026.

The symptom

Your repository contains this file:

.cursor/
└── rules/
    └── api-guidelines.md

The file contains clear instructions. You restart Cursor, open an API file, and ask the agent to make a change. The agent does not follow the rule.

The content is not the first problem. Cursor never registered the file as a project rule.

The cause

Cursor’s project-rule format is MDC. The .mdc suffix tells Cursor to parse the frontmatter that controls when the rule applies.

A Markdown file can sit in the same directory and remain visible in the file tree. That does not make it active context.

This creates a silent failure. Nothing is malformed from the editor’s point of view, so you get no syntax error.

The fix

Rename the file:

mv .cursor/rules/api-guidelines.md .cursor/rules/api-guidelines.mdc

Then give it an explicit activation rule.

For a rule that must apply to every Agent chat:

---
description: API rules for this repository
globs:
alwaysApply: true
---

- Validate every request body before database access.
- Run the API test suite after changing a route.

For a rule that applies only when TypeScript API files enter context:

---
description: API rules for TypeScript routes
globs: src/api/**/*.ts
alwaysApply: false
---

- Validate every request body before database access.
- Run the API test suite after changing a route.

Do not set a narrow glob if you expect the rule to apply to unrelated files. An auto-attached rule only loads when a matching file is referenced.

Verify it in Cursor

Open Cursor Settings, then Rules. Confirm that the project rule appears and shows the intended type.

Start a new Agent chat with a matching file in context. Ask:

List the active project rules for this request before you edit anything.

The rule should appear by name. If it does not, check the glob and activation type next.

When to use AGENTS.md instead

Use AGENTS.md for simple repository instructions that should remain readable across tools. Cursor supports root and nested AGENTS.md files.

Use .mdc when you need Cursor-specific activation, such as globs or an always-apply flag.

Do not maintain the same rule in both places. Duplicate copies drift and can conflict.

The rule is active and the agent still ignores it?

Book an agent rescue session. We inspect the loaded context and find the conflicting instruction.

Was this guide useful?

Read next

Your Agent Is Ignoring CLAUDE.md. Here's Where It's Reading Instead
Claude Code follows rules you never wrote and ignores the ones you did. Usually a nested CLAUDE.md in a subfolder is silently overriding your root file.
Codex AGENTS.md Checklist: 9 Checks When Codex Ignores Your Instructions
Codex not following AGENTS.md? Run 9 yes/no checks: file location, override files, empty files, the 32 KiB limit, fallback names, CODEX_HOME and a test prompt.
Your Prompt Cache Isn't Working and You're Paying Full Price
Cache hits stay at zero and every request bills full input cost. Usually the cached prefix is under ~1024 tokens, or you have more than 4 breakpoints.
llama.cpp KV Cache Quantization (2026): Start With q8_0
llama.cpp KV cache quantization: q8_0 uses 53% of the f16 memory, q4_0 uses 28%. The -ctk and -ctv flags, OLLAMA_KV_CACHE_TYPE, the flash attention rule, and when f16 is faster.