Pathrule for Cursor

Shared rules and team context for Cursor

Pathrule is the path-scoped layer above your .cursorrules. Team memories, rules and skills live in a knowledge graph and route into Cursor at hook time, so every teammate sees the same rules, scoped to the path they are actually working in.

The .cursorrules problem at team scale

Pathrule for Cursor is a concrete implementation of the AI coding context layer pattern. .cursorrules works for a solo developer. Two engineers in, the file grows. Five engineers in, half of it is stale and the other half contradicts itself. The pattern is not a Cursor problem; it is a one-flat-file problem. The work is path-scoped; the rule file is not.

Pathrule fixes the shape, not the file. Team knowledge lives in a path-indexed graph. Cursor still reads .cursorrules for repo-wide constants; Pathrule carries the scoped rules and routes them in on every turn.

What Pathrule adds to Cursor

Hook-time injection

Before the first tool call

Pathrule runs at the hook layer Cursor exposes, before the model picks a tool. The scoped slice is delivered every turn.

Path-scoped graph

Rules where they apply

A rule attached to /apps/web only fires when Cursor is acting under that path. .cursorrules stops being a dumping ground.

Reviewable team knowledge

Memories, rules, skills

Three node types, reviewable in the web app. Stale rules surface for cleanup. Conflicting edits resolve through a typed merge flow.

Same content, every tool

Claude Code, Codex, Windsurf, Copilot

One MCP server. Switching editor does not reset team memory.

What the install actually does

Pathrule does not patch Cursor. It registers hooks in your Cursor config that point at a single unobfuscated Node.js script under ~/.pathrule/bin. A session-start hook and a post-tool hook deliver the path-scoped context for the directory you are working in, and the pre-tool hook is where a strict rule blocks a matching edit. You can grep the hook script and your Cursor config yourself. Removing the entries removes Pathrule instantly, and the rest of your Cursor setup is untouched.

.cursorrules vs Pathrule

.cursorrules alonePathrule + Cursor
One file per project. Every turn. Every path.Path-scoped slice for the directory the model is working in.
Editable by anyone with push. No team review trail.Reviewable rules and skills with row-level security and a self-audit.
Token budget grows with team rules.Token cost stays flat. Only relevant rules are injected.
Tied to Cursor; Claude Code and Codex need their own files.Same content drives Cursor, Claude Code, Codex, Windsurf and GitHub Copilot.
Onboarding = "read the file and hope it is current".Onboarding = "join the workspace; the right rules show up on the right paths".

Long read: Why AI coding assistants need scoped rules.

How Pathrule fits a team running Cursor

  • Authoring. Write memories, rules and skills in the web app, desktop or CLI, and attach each to a path. Or let the assistant capture them in flow: when something is worth keeping it proposes a memory or rule and writes it once you confirm. Nothing is saved without your okay.

  • Review and repair. Pathrule treats rules and skills as reviewable artifacts. The self-audit surfaces stale or conflicting entries as suggestions; your assistant drafts the fix and you approve the change. Pathrule never edits your knowledge on its own.

  • Sharing. Memberships and per-node overrides enforced server-side. Onboarding is one invite, not a 400-line file.

  • Privacy. Source code never leaves your disk through Pathrule. See Security.

Frequently asked questions

What does Pathrule add to Cursor?

A path-scoped knowledge layer that injects team memories, rules and skills into Cursor at hook time. It runs before the first tool call so the model sees only the slice of context that matches the current working directory.

Is Pathrule a .cursorrules alternative?

Pathrule is a layer above .cursorrules. .cursorrules is one flat file per project; Pathrule indexes team knowledge by path and delivers only the relevant subtree on each turn. You can keep .cursorrules for repo-wide constants and let Pathrule carry the scoped rules.

Can my whole team share Cursor rules through Pathrule?

Yes. Pathrule is built for teams. Rules and skills are shared in a path-indexed graph with row-level security in the cloud. The same content also works for Claude Code, Codex and Windsurf, so teammates on different tools see the same rules.

Why does Cursor ignore my .cursorrules?

Long instruction files lose signal. As a .cursorrules grows past a few hundred lines, the model follows fewer of its rules. Pathrule fixes this by delivering only the rules that apply to the current path, so each instruction the model sees is load-bearing.

How does Pathrule install into Cursor?

Pathrule writes a hook entry into ~/.cursor/hooks.json that points at a single unobfuscated Node.js script under ~/.pathrule/bin. The hook emits JSON. Removing the entry removes Pathrule instantly.

Does Pathrule see my source code?

No. Pathrule never reads, scans or uploads your source files. The cloud stores only the typed memories, rules and skills your team writes. Full breakdown on the Security page.

Get started with Pathrule.