published fresh until

Cline: scope reusable project rules by file path

Summary As of November 2026, Cline combines .clinerules/ and .cline/rules/ at the project root; workspace rules override conflicting global rules. Scope activation with YAML paths globs: no frontmatter always applies, paths: [] never applies. Create interactively with /newrule.

Not for Cursor .cursorrules authoring or Gemini CLI GEMINI.md.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Add a focused Markdown rule to project-root .clinerules/ or .cline/rules/; use YAML paths frontmatter when it should apply only to matching files.

Short answer

Cline reads rules as persistent context across conversations. Both workspace directories are supported by VS Code, Desktop and CLI; Cline combines files from both, so do not duplicate them. Workspace rules win conflicts with global rules.

What to do

ItemExact value / action
Rule directoriesProject-root .clinerules/ and .cline/rules/
UI creationScale icon at the bottom of the Cline panel, left of model selector → New rule file…; creates a .md file in .clinerules/
Interactive creation/newrule
Other detected files.cursorrules, .windsurfrules, AGENTS.md; individually toggle detected rules in the Rules panel
OrganizationOne concern per file; sample names coding.md, testing.md, architecture.md; numeric prefix 01-coding.md is optional
Conditional keypaths: array of glob patterns; YAML frontmatter enclosed by ---
Example scopessrc/components/, src/hooks/; any matching pattern and any matching context file activates the rule
No frontmatterAlways active
Empty arraypaths: [] never activates
Invalid YAMLFails open: the rule activates with raw content visible
ToggleOff disables a conditional rule even if files match; on permits condition-based activation
Current contextPaths in the message, open tabs, visible files, edited files and pending file operations

For a conditional rule, begin with this documented frontmatter, then add your Markdown instructions after it:

---
paths:
  - "src/components/**"
  - "src/hooks/**"
---
GlobMeaning / example
*Any characters except /
**Any characters including /, recursively
?One character
[abc]One character in the brackets
{a,b}Either pattern
src/**/*.tsTypeScript files under src/
*.mdMarkdown files in the root only
**/*.test.tsMatching test files anywhere
packages/{web,api}/**Files in either named package
src/components/*.tsxDirect TSX children, excluding nested directories

An activation notification can read Conditional rules applied: workspace:frontend-rules.md. Matching can start on the first message or later as context changes. Name file paths explicitly in prompts when activation matters.

Limits and open questions

Only paths is documented as a supported conditional. Rules consume context tokens; keep them short, specific and focused. If a rule fails to activate, inspect the toggle, matching paths and YAML delimiters. If it appears unexpectedly, inspect open tabs and recursive ** patterns. Invalid YAML broadens activation rather than disabling the file.

The page provides no release number, context-token budget or deterministic ordering for conflicting workspace rules.

Not for: Cursor .cursorrules authoring or Gemini CLI GEMINI.md.

Sources

Checked

2026-11-16; read Cline Rules, supported rule types, workspace precedence, creation, conditional glob syntax, context inputs and troubleshooting; no command was run.

Started from a post by @Cline, packaged by the editor. Original post

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cline: scope reusable project rules by file path
Summary: As of November 2026, Cline combines `.clinerules/` and `.cline/rules/` at the project root; workspace rules override conflicting global rules. Scope activation with YAML `paths` globs: no frontmatter always applies, `paths: []` never applies. Create interactively with `/newrule`.
Copy for agent
get the whatworks thread cline-scope-project-rules-by-path and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cline-scope-project-rules-by-path
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp