Skip to main content
rule CX Codex

cursor-rules-location — Claude Code rule: what it does

cursor-rules-location keeps repository rule files organized by rejecting any .mdc files created outside the .cursor/rules directory.

no license ★ 1,054 updated 2025-07-17

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/cursor-rules-location.mdc
Open on GitHub

What cursor-rules-location does

This rule monitors the creation of .mdc files and content containing <rule> blocks. When an assistant attempts to write instructions into the project root or arbitrary directories, the rule immediately rejects the operation.

It enforces placing all Cursor instructions strictly inside .cursor/rules/, assigning kebab-case filenames, and using the .mdc extension. Any rule written to unauthorized paths will fail to save.

What it helps with

  • prevent .mdc rule files from cluttering the repository root
  • enforce storing all Cursor instructions inside .cursor/rules
  • enforce kebab-case naming for rule files

Example prompts for the agent

  • Create a new rule for linting standards in .cursor/rules/linting.mdc
  • Set up a project guideline file for testing conventions

How to install cursor-rules-location

Manually: put the files in place

.cursor/rules/cursor-rules-location.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about cursor-rules-location

How to install cursor-rules-location in Claude Code?

Save the rule file to .claude/rules/cursor-rules-location.md. For Cline, place it in .clinerules/cursor-rules-location.md.

What does cursor-rules-location do?

It rejects the creation of .mdc files anywhere outside the .cursor/rules folder.

What naming convention does this rule enforce?

It requires all rule files to use the kebab-case format and keep the .mdc extension.

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set11

The whole set →
directory-structure directory-structure defines a standard top-level repository layout for your AI coding assistant, mapping source files, tests, and configuration. CX Codex +1 ★ 1,054repo stars architecture-understanding The architecture-understanding rule has the agent read docs/architecture.md and check code changes against its architecture. Use it when a project documents its design in a Mermaid diagram. CX Codex +1 ★ 1,054repo stars debug The debug rule sets the order for troubleshooting: gather evidence and context, explain the cause, then edit code. It applies when an error persists or a fix is incomplete. CX Codex +1 ★ 1,054repo stars develop-mcp-server The develop-mcp-server rule structures MCP server work from planning to validation, with setup guidance for Node.js and Python projects. CX Codex +1 ★ 1,054repo stars plan Makes the agent read your docs, task notes and source before planning, ask clarifying questions, and only then propose a solution. CX Codex +1 ★ 1,054repo stars implement implement enforces a strict coding protocol with dependency checks, step-by-step edits, simulation passes, and automated test coverage before finalizing changes. CX Codex +1 ★ 1,054repo stars memory This rule organizes project memory across docs/, tasks/, and .cursor/rules/. It helps an agent retain plans, context, errors, and project decisions between tasks. CX Codex +1 ★ 1,054repo stars memory Keeps project memory in a fixed set of files the agent reads before work: requirements, architecture, stack, task plan, current state. CX Codex +1 ★ 1,054repo stars

Project sponsors

Companies that keep this analytics open