Pathrule CLI for Windsurf
Shared rules and team context for Windsurf
Windsurf is supported through Pathrule CLI, the lighter integration route into Pathrule's Context Layer. Team memories, rules and skills live in one path-scoped graph and reach Windsurf before work starts, while Pathrule Studio remains the complete product and runs its primary agents itself.
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
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.
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.
Memories, rules, skills
Three node types, reviewable in the web app. Stale rules surface for cleanup. Conflicting edits resolve through a typed merge flow.
Studio agents first, Windsurf through CLI
Studio's six primary agents and Windsurf use the same path-scoped knowledge without making Windsurf the product itself.
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 alone | Pathrule + 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 scales with the relevant slice, not the whole rule set. |
| Tied to Windsurf; other tools need their own files. | Same content drives Windsurf and every engine Studio runs, plus Cursor 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. Studio's primary agents use that graph directly, and Windsurf receives it through Pathrule CLI.
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.