What are Rules?
Rules are simple markdown files stored in a.clinerules/ directory that contain your team’s conventions, preferences, and guidelines. They help Cline understand your:
- Coding style and conventions
- Preferred libraries and frameworks
- Architectural patterns
- Testing strategies
- Documentation standards
- Communication preferences
Quick Example
Here’s a simple rule file that guides TypeScript development:Creating Rules
- Using /newrule Command
- Manual Creation
The easiest way to create a rule is with the
/newrule command:- During a conversation with Cline, type
/newrule - Cline will analyze your conversation and preferences
- It creates an appropriately named
.mdfile in.clinerules/
Global vs Workspace Rules
Workspace Rules
Location:
.clinerules/ in your repositoryScope: Specific to that projectUse for: Project-specific conventions and patternsGlobal Rules
Location:
Documents/Cline/ directoryScope: All your projectsUse for: Personal preferences that apply everywhereManaging Rules
Toggling Rules
You can enable or disable individual rule files:- Click the rules icon in Cline’s interface
- Toggle rules on/off as needed
- Changes apply immediately to new tasks
Disabling a rule removes it from Cline’s context, but keeps the file intact. You can re-enable it anytime.
Enterprise Remote Rules
Enterprise deployments can configure remote global rules that apply to all team members. These are managed through your infrastructure configuration and cannot be toggled off by individual developers.See Self-Hosted Configuration for details on remote rules.
Compatible Formats
Cline also respects rules from other AI coding tools:| File/Directory | Tool | Location |
|---|---|---|
.cursorrules | Cursor | Workspace root (single file) |
.cursor/rules/ | Cursor | Workspace directory (.mdc files) |
.windsurfrules | Windsurf | Workspace root (single file) |
AGENTS.md | Various | Workspace root + recursive search |
AGENTS.md behavior: Cline only searches for nested
AGENTS.md files recursively if a top-level AGENTS.md exists in your workspace root. If found, all AGENTS.md files are combined with their relative paths as headers..clinerules/ files and can be toggled on/off independently.
Best Practices
Keep Rules Focused
Keep Rules Focused
Each rule file should focus on one topic:
- ✅
typescript-conventions.md - ✅
react-component-structure.md - ❌
everything-about-our-codebase.md
Be Specific, Not Generic
Be Specific, Not Generic
Base rules on actual team preferences, not assumptions:
- ✅ “We use React Query for server state management”
- ❌ “Use best practices for state management”
Update Rules as Projects Evolve
Update Rules as Projects Evolve
Review and update rules periodically:
- When adopting new technologies
- After major architectural changes
- When team conventions evolve
Don't Overdo It
Don't Overdo It
Too many rules can overwhelm Cline’s context:
- Start with 3-5 essential rules
- Add more only when truly needed
- Remove outdated rules promptly
Example Rule Files
API Design Standards
API Design Standards
Testing Requirements
Testing Requirements

