Skip to content

Build1 publisher3 min readPublished

Three tools, three spellings of the same glob: agent rules do not port

Claude Code scopes rules with paths, Cursor with globs, Copilot with a comma-delimited applyTo. Copilot reads Claude's rules directory, but not the file references inside it.

The Engineer · Build desk

Drafted by a language model from the sources cited here and checked against its claim ledger before publication. How we use AISend a correction

What happened

  • Claude Code supports .claude/rules/, arbitrary markdown files with instructions that are loaded only when files in the current context match the glob patterns listed under a paths property in the file's front matter.
  • The post's example, .claude/rules/api.md, uses front matter paths: ['src/api/**/*.ts'] and contains API development rules such as requiring input validation on all endpoints.
  • The author says path-scoped rules let you trim guidance out of CLAUDE.md that is not globally applicable, saving money on input tokens and improving the overall performance of the agent.
  • The author prefers a single central rules directory over nested CLAUDE.md files because it keeps rules in one location and easier for humans to find and parse.
  • Cursor has an equivalent feature, Cursor rules, but its rule format requires a globs property in the front matter instead of paths.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

A developer writing on dev.to has laid out a portability defect that anyone running two coding agents against one repository will recognise: the same idea, load these instructions only when the model is touching these files, is spelled three different ways by three vendors [1][5][6]. The cost is not aesthetic. It is duplicated guidance that has to be kept in sync by hand, in a directory nobody reviews.

Claude Code's version lives in .claude/rules/, where each markdown file carries a paths list in its front matter and is loaded only when files in the current context match one of those globs [1]. The post's example scopes API rules to src/api/**/*.ts [2]. The argument for it is budget, not taste: guidance that is not globally applicable comes out of CLAUDE.md, which the author says cuts input tokens and improves the agent's performance [3]. They also prefer one central rules directory to nested CLAUDE.md files, on the grounds that humans have to find these files too [4].

Cursor has the same mechanism under a different key, globs instead of paths [5]. Copilot calls the files instructions, requires them at .github/instructions/*.instructions.md, and scopes them with applyTo [6]. applyTo is where it degrades: paths is an array of strings, while applyTo is a single string holding a comma-delimited pattern list, which the author calls borderline unreadable once you need more than two patterns [7]. Three tools, three front-matter keys, one concept [15].

There is partial mercy. Copilot also picks up .claude/rules by default, according to Microsoft's VS Code custom instructions documentation as cited in the post [8]. That should settle things for a shop standardised on Copilot that prefers Claude's format, and it does not, because the compatibility is at the directory level rather than the feature level. Claude Code supports @path/to/file to inline a referenced file into context at launch [9]. Copilot does not: VS Code's docs suggest Markdown links for referencing files or URLs, but the author reports the links are never fetched, the instructions load, the reference is visible, and no tool call is made to read the file [10]. The portable subset is therefore .claude/rules minus @-references [16].

The constraint that makes this bite is procurement, not preference. One of the author's clients operates in a restricted security environment where Claude Code is not available and only GitHub Copilot is approved, through the CLI, VS Code or IntelliJ plugins [11]. That repository also carries a large body of pre-AI documentation at a separate path, wired into Backstage for wiki generation, so the integration workflows expect specific on-disk locations [12]. The docs cannot move, and they cannot be pulled in by reference, which leaves copying or drifting. The post is titled as a pet peeve plus a solution; the text available to us stops before the solution is described.

The stated wish is a vendor-neutral .agent/rules that every harness reads, hoped for within a year, with the author explicitly not holding their breath [13]. They also concede that most teams probably converge on a single AI tool for consistency precisely because no standard exists [14], which is the honest reading: today the portability problem is solved by removing choice.

Worth watching: whether Copilot starts resolving those Markdown link references into actual file reads [10], and whether any vendor accepts a rival's front-matter key rather than a new directory. If you are running two agents now, treat @-references as unsupported and keep pattern lists short enough that applyTo stays legible [7].

Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories