Pathrule for VS Code
The Pathrule editor surface for VS Code and its forks, with a knowledge tree, markdown-tab editing, a local no-account mode and one-command agent setup.
On this page
Pathrule for VS Code is a native editor surface. It brings the workspace knowledge tree, content editing, and AI client setup inside the editor, so the folder you have open is the workspace and the file you are editing is the path. It is the right surface if you live in VS Code, Cursor, or Windsurf and want your knowledge next to your code.
It is a focused editor surface. The same content and hooks the CLI works with are driven from the editor you already use, and external client setup reuses the CLI's installer.
Install
Install it from the Visual Studio Marketplace, or from Open VSX so Cursor and Windsurf can install it too. From a terminal:
code --install-extension Pathrule.pathrule-vscode
Or, from the editor, open the Quick Open prompt and run:
ext install Pathrule.pathrule-vscode
It is free and open source under Apache-2.0, and local mode needs no account, so you can start the moment it installs.
What the extension owns
- Knowledge tree. A sidebar that shows only the paths carrying knowledge, repo-shaped, with memories, rules, and skills grouped under each path. Content counts appear as badges on tree rows and on the matching files and folders in the built-in explorer.
- Active-file sync. As you move between files the tree follows the editor to the deepest path that covers the current file, and the status bar shows that path with its content counts.
- Content editing. Memories, rules, and skills open as ordinary markdown editor tabs. Saving persists through Pathrule, with full editor tooling for free.
- Agent setup. One command connects your AI clients and installs the path-scoped hooks, the same setup the CLI performs.
- Onboarding. Open a folder with no workspace yet and the extension walks you from set up to a bound workspace without leaving the editor.
- Doctor. A single command that checks each client is connected, the hooks are present, and the context server is reachable.
Local mode and cloud mode
The extension runs in two modes behind one user interface, the same split as the CLI and the open source core.
- Local mode needs no account. Initialize a folder locally and your memories, rules, and skills live on your machine. It is the fastest way to start.
- Cloud mode signs you in and adds the team layer: shared knowledge, team activity and the managed backend.
The mode is a property of the open folder, not a guess. A signed-in user whose folder is not yet a cloud workspace is offered both creating one in the current organization and initializing locally. Cloud-only actions are hidden, not broken, when a folder is in local mode, so the same extension serves both.
Editing as markdown tabs
Open a memory, rule, or skill from the tree and it opens as a normal markdown tab. Edit it like any file and save to persist the change. If a teammate changed the same item while you had it open, the save does not silently overwrite their work: you are offered to reload, keep a copy of your version, or overwrite with your own. Conflicts surface as a decision, never as lost edits.
From the explorer, right-click any file or folder for a Pathrule submenu: browse the knowledge that applies there, or create a new memory, rule, or skill scoped to that path. From a tree item you can copy it as a prompt pointer, view its details, rename, move it to another path, or delete it with an undo. Multi-select supports bulk move and delete, and a fuzzy search spans every title across the workspace.
Identity shared with the CLI
Signing in from the extension uses the same hosted login as the CLI, with your choice of GitHub, Google, or email. The session is shared: signing in here signs the CLI in too, and switching organization in one switches it in the other. One identity across the extension, the CLI, and your AI assistant.
Connect your AI clients
A single Connect AI clients command wires your assistant to Pathrule with no JSON editing.
- GitHub Copilot agent mode gets Pathrule's MCP server registered by the extension for the bound folder.
- Claude Code, Codex, Cursor and Windsurf, the ones you pick, receive managed MCP entries written with the same installer the CLI uses.
- Hooks are installed for Claude Code, and for Codex when the repository has Codex files, through the same pipeline the CLI uses, and the result notification lists exactly what was written.
After this, your assistant receives the Pathrule context for the current path through the channel it has: hooks that include a prompt hook for Claude Code and Codex, and Pathrule's MCP tools for Cursor, GitHub Copilot and Windsurf, which get no Pathrule hooks. Run the doctor command at any time to confirm each client is connected and the hooks are fresh.
Working with your team
Cloud writes are shared, but the current Cloud backend does not provide a real-time subscription. Refresh the knowledge view or request context again to read the latest state; local hooks and instruction files use prepared knowledge until refreshed. Organization-level work stays in Pathrule Web: team management, plans and billing, and the cross-workspace overview are reached through links rather than reimplemented in the editor.
If you started in local mode and want to bring a folder to your team, a single action signs you in, picks an organization, and copies the workspace and its content to a new Cloud workspace. The local copy stays on this machine, unchanged and unused while the folder is a Cloud folder.
When to use Pathrule for VS Code
Use the extension when you work primarily in VS Code, Cursor, or Windsurf and want the workspace knowledge tree, content editing, and agent setup in the editor that already knows your open folder and active file. Start in local mode in seconds, and sign in later when you want the team layer.
If you live in the terminal or script Pathrule into CI, prefer Pathrule CLI. The two share the same sign-in, so you can use both.
What to read next
- Pathrule CLI for the terminal first runtime that shares the same identity and hooks.
- Open source core for what local mode runs and what Cloud adds.
- How hooks work for what the extension hands to your assistant.