Skip to content
Pathrule

docs

Compilation

How Pathrule compiles a workspace's knowledge into the instruction files each coding agent already reads, at the paths it governs, when that happens, and why the compiled files carry your team's own words.

On this page

Compilation prepares workspace knowledge for the files and hooks each coding agent supports. The result is a view of the knowledge, not a second place to author it.

Hooks and instruction files

With a Pathrule hook installed, the session-start hook supplies the protocol and team context. The main instruction file keeps a short managed note, and path knowledge arrives through supported prompt and tool hooks. Pathrule removes older managed protocol copies and knowledge files that this delivery replaces.

Without an installed hook, Pathrule writes the fuller protocol and path-scoped knowledge files in the client's native format. Windsurf uses this route because it has no Pathrule hook. Materialized skills remain available in the skill directories each client reads.

ClientPrepared delivery
Claude Code, CodexLocal hook index, short managed instruction note and materialized skills; fuller instruction files when no hook is installed
Cursor, GitHub CopilotSession and tool-hook delivery, managed note and materialized skills; native scoped files when no hook is installed
WindsurfCompiled rules files and materialized skills, with MCP for deeper requests
Remote MCPNo local compilation or files; the client requests Cloud knowledge through tools

The exact paths are listed in the client guides.

Source and compiled guidance

An approved compiled entry can replace longer source prose only while the runtime can establish that it remains grounded in the source and its scope. If that check fails, Pathrule delivers source text instead. Rules keep their authority, findings remain advice and explicit reads return the authored body.

This is different from asking a model to rewrite the whole workspace into a summary. The knowledge remains inspectable, and uncertain compilation does not become a new requirement. See Knowledge IR and Safety and fallback.

When it runs

pathrule setup prepares the integration when a workspace is connected. pathrule sync refreshes managed files and local indexes from current workspace knowledge and cleans up managed files that no longer apply.

Edit entries in Local Console, VS Code or MCP; Cloud workspaces also support CLI authoring. Text inside a Pathrule managed region is regenerated, while text outside it remains yours.

Per-task delivery

Compilation cannot know the next prompt. Claude Code and Codex prompt hooks select task context; other clients use their supported session and tool boundaries, instruction files and MCP. A direct pathrule_get_context call requests the deeper knowledge path.

See Agent IR for what reaches one task and How hooks work for client coverage.