Cursor Commands vs Rules Files
A command in Cursor (.cursor/commands/*.md) is a prompt you type with / and run on demand. A rules file (.cursor/rules/*.mdc) is context the model reads automatically, either always or when a glob matches, without you asking. Commands are something you do; rules are something the model already knows. Last updated 2026-10-26 by Rakshit Yadav.
Verdict
They don't compete for the same job. A rules file sets standing context the model reads on every matching turn, with no action from you. A command is a one-off job you kick off by typing its name. The question isn't "command or rule" so much as "should this run automatically, or only when I ask."
Commands vs rules at a glance
| Command | Rules file | |
|---|---|---|
| Trigger | You type /name | Always, or when a glob matches the file being touched |
| Folder | .cursor/commands/*.md | .cursor/rules/*.mdc |
| Contains | A sequence of steps for a job | Standing facts and bans the model should never forget |
| Runs how often | Once, when invoked | On every turn it applies to, forever, until you edit it |
| Example | /ship: run checks, then commit | "Never commit directly to main" or "use the tenant from the session, not from params" |
Why this pairing shows up in search
“Commands in Cursor” is a broad query that also pulls in people comparing commands against the other three config primitives: rules, skills, and MCP servers. We already cover commands vs skills and commands vs hooks; rules was the missing edge of that matrix, so if you searched “cursor command vs rule” and landed here, this is the piece those other pages didn't spell out directly.
Use a command when
- The job has steps you'd otherwise retype every time: audit, review, deploy checklist.
- You want to choose the moment it runs, not have it fire on every matching file.
- The output is an artifact for that session (a PR, a report, a commit), not a standing rule for future sessions.
Use a rules file when
- Breaking the rule would be bad even once, so it can't wait for you to remember to ask.
- It's short: a ban, a convention, a fact about the codebase (which ORM, which test runner, which env var holds the tenant).
- It should scope to a path, like a rule for
app/api/**that never fires on marketing pages.
The failure mode in both directions
Put a long playbook in a rules file and it loads on every turn whether or not the task needs it, burning context and diluting the parts that matter. Put a hard ban in a command instead of a rule and it only applies on the turns you remember to type /the-command — which is exactly when a careless edit slips through on an ordinary turn. If the standard is long, it probably belongs in a skill the agent loads on demand rather than either of these; see Rules vs Skills vs Commands for that split.
Related pages
Frequently asked questions
What is the difference between a Cursor command and a rules file?
A command is a markdown prompt in .cursor/commands that runs only when you type /name. A rules file in .cursor/rules loads automatically, either always or when a glob matches, with no action from you.Can a command read a rules file?
Rules load independently of commands. A command's prompt can reference the same conventions a rule states, but the rule itself fires on its own schedule (always, or by glob) regardless of which command you run.Should I turn my long command into a rule so I don't forget to run it?
Only if it's truly a standing constraint. If it's a multi-step job (run tests, then lint, then commit), keep it a command — rules aren't built to execute steps, only to supply context.Where do commands and rules live in a Cursor project?
Commands in .cursor/commands/*.md, rules in .cursor/rules/*.mdc.
Browse commands and grade your rules
47 ready-made commands, plus a grader that scores your rules file for bloat before you add more.