- Follow your team’s coding standards (naming conventions, file organization, error handling patterns)
- Understand project-specific context (tech stack, architecture decisions, dependencies)
- Apply consistent documentation or testing requirements
- Remember constraints like “don’t modify files in /legacy” or “always use TypeScript”
Supported Rule Types
Cline recognizes rules from multiple sources, so you can use existing rule files from other tools:| Rule Type | Location | Description |
|---|---|---|
| Cline Rules | .clinerules/ | Primary rule format |
| Cursor Rules | .cursorrules | Automatically detected |
| Windsurf Rules | .windsurfrules | Automatically detected |
| AGENTS.md | AGENTS.md | Standard format for cross-tool compatibility |
Where Rules Live
Rules can be stored in two locations: your project workspace or globally on your system. Workspace rules go in.clinerules/ at your project root. Use these for team standards, project-specific constraints, and anything you want to share with collaborators via version control.
Global rules go in your system’s Cline Rules directory. Use these for personal preferences that apply across all projects.
.md and .txt files inside .clinerules/, combining them into a unified set of rules. Numeric prefixes (like 01-coding.md) help organize files but are optional.
When both workspace and global rules exist, Cline combines them. Workspace rules take precedence when they conflict with global rules. See Storage Locations for more guidance.
Global Rules Directory
| Operating System | Default Location |
|---|---|
| Windows | Documents\Cline\Rules |
| macOS | ~/Documents/Cline/Rules |
| Linux/WSL | ~/Documents/Cline/Rules |
Linux/WSL users: If you don’t find global rules in
~/Documents/Cline/Rules, check ~/Cline/Rules.Creating Rules
1
Open the Rules menu
Click the scale icon at the bottom of the Cline panel, to the left of the model selector.
2
Create a new rule file
Click “New rule file…” and enter a filename (e.g.,
coding-standards). The file will be created with a .md extension.3
Write your rule
Add your instructions in markdown format. Keep each rule file focused on a single concern.
/newrule slash command to have Cline create a rule interactively.
Toggling Rules
Every rule has a toggle to enable or disable it. This gives you fine-grained control over which rules apply to your current task without deleting the rule file. For example, you might have a strict testing rule that you want to disable when prototyping, or a client-specific rule you only need when working on that client’s features.Writing Effective Rules
Structure
Rules work best when they’re scannable and specific. Use markdown structure to organize instructions:Best Practices
Be specific, not vague. “Use descriptive variable names” is too broad. “Use camelCase for variables, PascalCase for classes, UPPER_SNAKE for constants” gives Cline something concrete to follow. Include the why. When a rule might seem arbitrary, explain the reason. “Don’t modify files in /legacy (this code is scheduled for removal in Q2)” helps Cline make better decisions in edge cases. Point to examples. If your codebase already demonstrates the pattern you want, reference it. “Follow the error handling pattern in /src/utils/errors.ts” is more effective than describing the pattern from scratch. Keep rules current. Outdated rules confuse Cline and waste context. If a constraint no longer applies, remove it. If your tech stack changes, update the rules. One concern per file. Split rules by topic:coding.md for style, testing.md for test requirements, architecture.md for structural decisions. This makes it easy to toggle specific rules on or off.

