Pathrule for Windsurf

Shared rules and team context for Windsurf

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

The rules file problem at team scale

Pathrule for Windsurf is a concrete implementation of the AI coding context layer pattern. A .windsurfrules file 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 Windsurf 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. Windsurf still reads its rules file for repo-wide constants; Pathrule carries the scoped rules and routes them in on every turn.

What Pathrule adds to Windsurf

Hook-time injection

Before the first tool call

Pathrule runs at the hook layer Windsurf exposes, before the model picks a tool. The scoped slice is delivered every turn, not only on session start.

Path-scoped graph

Rules where they apply

A rule attached to /apps/web only fires when Windsurf is acting under that path. The rules file 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, Cursor, Codex, Copilot

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

What the install actually does

Pathrule does not patch Windsurf. It registers a hook in your Windsurf configuration that points at a single unobfuscated Node.js script under ~/.pathrule/bin, so Windsurf receives the path-scoped context on each prompt and tool call, and a strict rule can block a matching change. You can grep the hook script and your Windsurf config yourself. Removing the entry removes Pathrule instantly, and the rest of your Windsurf setup is untouched.

Windsurf rules vs Pathrule

Windsurf rules alonePathrule + Windsurf
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 Windsurf; other tools need their own files.Same content drives Windsurf, Claude Code, Cursor, Codex and 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 Windsurf

  • 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 long rules file.

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

Frequently asked questions

What does Pathrule add to Windsurf?

A path-scoped knowledge layer that injects team memories, rules and skills into Windsurf 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 replacement for my Windsurf rules?

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

Can my whole team share Windsurf rules through Pathrule?

Yes. 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, Cursor, Codex and GitHub Copilot, so teammates on different tools see the same rules.

How does Pathrule install into Windsurf?

Pathrule registers a hook in your Windsurf configuration 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.