meta — Claude Code rule: what it does, how to install
The meta rule guides edits to *.mdc files, preserving their formatting and steering agents toward existing rule files before creating new ones.
Apache-2.0 ★ 138 updated 2025-03-29
.cursor/rules/meta.mdcWhat meta does
meta sets editing conventions for *.mdc files. It tells the agent to retain the file’s line endings, trailing spaces, indentation style, and existing formatting patterns. Changes to a rule should stay aligned with its implementation. This matters in repositories where switching between CRLF and LF would alter files unintentionally.
Before adding a rule, the agent should check whether it belongs in an existing file. A new file is warranted when the user requests one, the content does not fit elsewhere, or a separate file would make the structure clearer; the reason belongs in README.md. Examples of file or syntax changes should show both a recommended and a discouraged form, with comments explaining each. The rule covers *.mdc; its Claude Code install path is .claude/rules/meta.md.
What it helps with
- preserve line endings when editing a rule
- retain trailing spaces and the existing indentation style
- find an appropriate file for new rule content
- keep
.mdcchanges aligned with their implementation - record why a new rule file was created in
README.md
Example prompts for the agent
- Edit the
*.mdcrule and preserve its line endings and indentation. - Add this instruction to an existing rule file if it fits; avoid creating a separate file without a reason.
- Show recommended and discouraged syntax examples, with comments explaining the difference.
How to install meta
Manually: put the files in place
.cursor/rules/meta.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/meta.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/meta.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/meta.mdManually: put the files in place
.clinerules/meta.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about meta
How do I install meta in Claude Code?
Place the file at .claude/rules/meta.md.
What does the meta rule do?
It sets editing conventions for *.mdc files, including formatting preservation and when to add a separate rule file.
When should I create a new rule file?
When the user asks for one, the content does not fit an existing rule, or a separate file would make the structure clearer. Record the reason in README.md.
Source text
meta.mdc · Apache-2.0
---
description: A meta-rule for using Cursor to update *.mdc file in this repository.
globs: *.mdc
---
# Cursor Rules
This document outlines the meta-rules for cursor operations in this repository.
## Line Ending & Formatting Rules
1. **Line Endings**
- Don't modify existing line endings
- Preserve CRLF/LF as found in the original file
2. **Whitespace**
- Preserve trailing whitespace where it exists
- Maintain existing indentation style (spaces vs tabs)
- Keep line length consistent with existing code
## File Handling
1. **MDC Files**
- Always commit changes to `*.mdc` files directly
- Ensure changes to `*.mdc` files are synchronized with their implementation
- Maintain consistent formatting within MDC files
- Prefer modifying existing files over creating new ones unless explicitly requested
- When adding new content, first check if it fits within an existing rule file
2. **File Creation**
- Only create new rule files when:
- Explicitly requested by the user
- The content doesn't logically fit in any existing rule file
- Creating a new file would significantly improve organization and clarity
- Document the rationale for creating new files in their README.md
## Code Style & Structure
1. **Formatting**
- Preserve existing code formatting patterns
- Maintain consistent naming conventions
- Keep indentation consistent with file style
2. **Organization**
- Keep file structure consistent
- Don't move files without updating all references
- Maintain existing import/include order
## Rule Content
1. **Examples**
- Always include "do" and "don't" examples when showing specific changes to files or syntax
- Include helpful comments that explain why an example is a "do" or a "don't"
## Documentation
1. **README.md**
- Each `*.mdc` file is lumped into a folder with a `README.md` file explaining what the rule does and when it's used.
© Aaronontheweb · Apache-2.0 · Aaronontheweb/dotnet-cursor-rules