Pathrule for GitHub Copilot

Scoped team context for GitHub Copilot

Pathrule is the path-scoped layer above your `.github/copilot-instructions.md`. Team memories, rules and skills live in a knowledge graph and route into GitHub Copilot at hook time, before the first tool call. One setup reaches Copilot in VS Code agent mode, the Copilot CLI and the coding agent.

The instructions-file ceiling

Pathrule for GitHub Copilot is a concrete implementation of the AI coding context layer pattern. A .github/copilot-instructions.md file works for a small repo. As a team adds guidance for the mobile app, the backend, the data pipeline and the migrations, that one auto-applied file grows past the point where the model can follow it. Long instruction files lose signal. The work is path-scoped; one flat file is not.

Pathrule fixes the shape, not the file. Copilot keeps reading copilot-instructions.md for repo-wide constants; Pathrule carries the path-scoped knowledge it cannot model well and routes it into Copilot on every turn.

What Pathrule adds to Copilot

Hook-time injection

Before the first tool call

Pathrule runs at the hooks layer Copilot exposes, before the model picks a tool, and delivers the scoped slice every turn. A strict rule can block a matching change before it lands.

Path-scoped graph

Rules where they apply

A rule attached to /services/billing only fires when Copilot is acting under that path. copilot-instructions.md keeps the global constants; Pathrule keeps the scoped ones.

MCP and skills

Memories, rules, skills

Pathrule registers as an MCP server and ships Agent Skills Copilot can invoke by name. Three reviewable node types, the same ones every other tool reads.

Three surfaces, one setup

VS Code, CLI, coding agent

One repo-level setup feeds Copilot in VS Code agent mode, the Copilot CLI and the coding agent, so the team's context follows wherever Copilot runs.

What the install actually does

Pathrule does not patch Copilot. It registers the Pathrule MCP server, writes a path-scoped protocol into .github/copilot-instructions.md, and registers a hook that points at a single unobfuscated Node.js script under ~/.pathrule/bin, so Copilot receives the path-scoped context on each prompt and tool call. You can grep the hook script and the generated files yourself. Removing them removes Pathrule instantly, and the rest of your Copilot setup is untouched.

copilot-instructions.md vs Pathrule

copilot-instructions.md alonePathrule + Copilot
One file at the repo root. 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 guidance.Token cost stays flat. Only relevant rules are injected.
Lives with Copilot; other tools need their own files.Same content drives Copilot, Claude Code, Cursor, Codex and Windsurf.
Onboarding = "read the file and hope it is current".Onboarding = "join the workspace; the right rules show up on the right paths".

Long read: One knowledge layer for Claude Code, Cursor and Codex.

How Pathrule fits a team running Copilot

  • 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 instructions file.

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

Frequently asked questions

What does Pathrule add to GitHub Copilot?

A path-scoped knowledge layer that injects team memories, rules and skills into Copilot 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.

Which Copilot surfaces does Pathrule support?

Copilot in VS Code agent mode, the Copilot CLI and the coding agent. One repo-level setup feeds all three, so the same path-scoped context follows wherever Copilot runs.

Is Pathrule a replacement for copilot-instructions.md?

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

Does the same content work across my other tools?

Yes. The same memories, rules and skills also drive Claude Code, Cursor, Codex and Windsurf through one MCP server, so teammates on different tools see the same rules.

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.