.clinerules/Cline Rules (.clinerules/): where it lives and how tools read it
Cline Rules are Markdown files in .clinerules/ that Cline combines with global rules and with AGENTS.md. Optional paths frontmatter limits a rule to matching files.
Where it lives
- Workspace: .clinerules/*.md or .cline/rules/*.md; both are searched.
- Global: Documents\Cline\Rules on Windows, ~/Documents/Cline/Rules on macOS and Linux, plus ~/.cline/rules and ~/Cline/Rules.
- Cross-tool files detected automatically: AGENTS.md, ~/.agents/AGENTS.md, .cursorrules and .windsurfrules.
Format
Markdown files, optionally numbered such as 01-coding.md, with optional YAML frontmatter. A paths array of globs activates the rule when any pattern matches a file in context. No frontmatter means always active, paths: [] means never, and invalid YAML fails open.
---
paths:
- "src/components/**"
- "src/hooks/**"
---
# Components and hooks
- Function components only.
- Hook names start with use and the files live in src/hooks/.
- Split any component that grows past 200 lines.
- Add a test next to each new hook.
Precedence and merging
Workspace and global rules are combined, and workspace rules win on conflict. Each rule can be toggled on or off individually.
Tips
- In context means mentioned paths, open or visible tabs, edited files and pending edits.
- Because invalid YAML fails open, a typo in paths makes the rule always active; check it after editing.
- Create rules from the Rules panel in VS Code or with the /newrule slash command.
Generate an AGENTS.md and matching rule files for five tools from one form. Open the AGENTS.md generator →
Other instruction files
AGENTS.mdCLAUDE.mdGEMINI.md.cursor/rules/*.mdc.github/copilot-instructions.md.devin/rules/*.md~/.openclaw/workspace/AGENTS.md