{
  "site": {
    "title": "Pathrule Docs for AI coding context",
    "description": "Pathrule routes path-scoped memories, rules and skills into Claude Code, Cursor, Codex, Windsurf and GitHub Copilot at hook time, before the first tool call. The team knowledge layer for AI coding assistants.",
    "url": "https://www.pathrule.io/docs",
    "image": "https://www.pathrule.io/og-image.png",
    "language": "en",
    "updated": "2026-06-23"
  },
  "sections": [
    {
      "slug": "start",
      "title": "Start",
      "pages": [
        {
          "slug": "introduction",
          "title": "Introduction",
          "description": "What Pathrule is, how it routes team knowledge into AI coding sessions, and what it stores instead of your source code.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/start/introduction",
          "mdUrl": "https://www.pathrule.io/docs/start/introduction.md",
          "llmSummary": [
            "Pathrule is a team knowledge layer for AI coding assistants. It stores memories, rules, and skills, not source code.",
            "Content is path scoped and delivered just in time via hooks at MCP boundaries, so the assistant sees the right slice for the current working directory.",
            "One workspace tree drives two local runtimes (Pathrule Studio, Pathrule CLI), a browser management console (Pathrule Web), and a hosted Remote MCP endpoint for cloud-only clients.",
            {
              "Supported AI clients today": "Claude Code, Cursor, Codex CLI, Windsurf, GitHub Copilot, and any MCP compatible client."
            }
          ]
        },
        {
          "slug": "quickstart",
          "title": "Quickstart",
          "description": "Install a Pathrule runtime, create a workspace, write your first memory, and see Claude Code pick it up through the hook.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/start/quickstart",
          "mdUrl": "https://www.pathrule.io/docs/start/quickstart.md",
          "llmSummary": [
            "Install Pathrule Studio on macOS or the Pathrule CLI on macOS, Linux, or Windows, then sign in.",
            "Create a workspace and attach it to a local repository path on your machine.",
            "Write a memory at the path you want the assistant to see, then open Claude Code in that path.",
            "The hook supervisor reads the cached slice and hands it to the editor before the first tool call."
          ]
        },
        {
          "slug": "core-concepts",
          "title": "Core concepts",
          "description": "Memories, rules, and skills, plus the workspace tree and path scope that route them to the right AI session.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/start/core-concepts",
          "mdUrl": "https://www.pathrule.io/docs/start/core-concepts.md",
          "llmSummary": [
            "A workspace is a tree of nodes. Each node can carry memories, rules, and skills.",
            "Memories are facts. Rules are constraints. Skills are named procedures the assistant can invoke.",
            "Path scope decides where content surfaces. Priority decides how strictly the assistant must follow it.",
            "The same content tree drives Pathrule Web, Studio, and CLI, and is read by Claude Code, Cursor, and Codex."
          ]
        },
        {
          "slug": "how-knowledge-compounds",
          "title": "How knowledge compounds",
          "description": "Pathrule is a loop, not a filing cabinet. Context is delivered before work, knowledge is captured during it with your approval, and the cloud surfaces the most valuable first.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/start/how-knowledge-compounds",
          "mdUrl": "https://www.pathrule.io/docs/start/how-knowledge-compounds.md",
          "llmSummary": [
            {
              "Pathrule is a continuous loop, not static storage": "deliver, capture, score, repeat."
            },
            "Delivery happens at hook time, before the first tool call, scoped to the path you work in.",
            {
              "Capture is in flow": "the assistant proposes a memory, rule or skill and writes it via MCP only after you confirm."
            },
            "Routing and base ranking are open source and run locally; the cloud edition adds a separate learning layer that re-ranks by how knowledge actually helped, surfacing the most valuable first.",
            "Knowledge lives outside any single tool, so it stays portable across Claude Code, Cursor, Codex, Windsurf and GitHub Copilot."
          ]
        },
        {
          "slug": "how-we-measure",
          "title": "How we measure",
          "description": "What the reference task behind the headline numbers actually is, what was compared, and why these are reference figures rather than per-session guarantees.",
          "updated": "2026-06-13",
          "url": "https://www.pathrule.io/docs/start/how-we-measure",
          "mdUrl": "https://www.pathrule.io/docs/start/how-we-measure.md",
          "llmSummary": [
            "The headline numbers come from one reference task, a knowledge-heavy edit on a real codebase, run with Pathrule and without it.",
            "The decisive fact in that task is team knowledge a code scan cannot surface, not anything stated in the source files.",
            {
              "Observed figures": "about 85% fewer input tokens, 5 to 8 times faster, about 5 times fewer tool calls, about 10 times fewer files read, about 80% lower cost."
            },
            "A separate open, reproducible benchmark on a real pinned repository (Fastify) compares path-scoped delivery against a whole-knowledge-base dump with mechanical scoring across Claude and Codex, at github.com/pathrule/benchmarks.",
            "In that benchmark the primary metric is total footprint (tokens processed per turn); the hard tier shows about 52% lower for Claude and 41% lower for Codex with facts preserved, and the report publishes cells where Pathrule costs more.",
            "These are reference figures from one comparison, not a per-session guarantee. Your numbers depend on your codebase, task, and model.",
            "We publish what we measured and why; we do not publish the scoring internals."
          ]
        },
        {
          "slug": "demo-workspace",
          "title": "Demo workspace",
          "description": "Every new account opens with a read-only Demo Workspace, a realistic sample repo you can explore before you connect a single folder.",
          "updated": "2026-06-06",
          "url": "https://www.pathrule.io/docs/start/demo-workspace",
          "mdUrl": "https://www.pathrule.io/docs/start/demo-workspace.md",
          "llmSummary": [
            "Every new Pathrule account starts with a read-only Demo Workspace, pinned at the top of the sidebar, so you can see the product in real use before binding a repo.",
            "The demo is a hand-crafted sample repo tree with coherent example memories, rules and skills and a fully populated Summary dashboard.",
            {
              "It is read-only": "edits are blocked with a friendly notice, and it has no local folder, no hooks and no agent binding."
            },
            "You can remove the Demo Workspace whenever you like, and it never counts against your plan limits or seats."
          ]
        }
      ]
    },
    {
      "slug": "editions",
      "title": "Editions",
      "pages": [
        {
          "slug": "open-source-core",
          "title": "Open source core",
          "description": "Pathrule's engine is open source. Run the path-scoped memory, rule and skill core locally, for free, with no account, on an embedded local store.",
          "updated": "2026-06-06",
          "url": "https://www.pathrule.io/docs/editions/open-source-core",
          "mdUrl": "https://www.pathrule.io/docs/editions/open-source-core.md",
          "llmSummary": [
            "Pathrule's core is open source under Apache-2.0. It is the path-scoped memory, rule and skill engine plus the MCP tool surface, and it runs fully local with no account.",
            "The local edition stores content in an embedded SQLite database under ~/.pathrule and exposes the same MCP tools as Pathrule Cloud, so any MCP client sees an identical contract.",
            "Semantic search and the LLM router are available in the core with your own API key (bring your own key); the deterministic router is the default with no key.",
            {
              "Pathrule Cloud adds the team layer on top": "sync, live activity and overlap detection, AI curation, staleness detection, the managed backend and the web and desktop apps. Pricing plans apply to Pathrule Cloud only; the open source core is free."
            }
          ]
        },
        {
          "slug": "self-hosted",
          "title": "Enterprise self-hosted",
          "description": "Run the full Pathrule Cloud product on your own infrastructure for data residency, security review and procurement, with your SSO and your database.",
          "updated": "2026-06-06",
          "url": "https://www.pathrule.io/docs/editions/self-hosted",
          "mdUrl": "https://www.pathrule.io/docs/editions/self-hosted.md",
          "llmSummary": [
            "Enterprise self-hosted runs the full Pathrule Cloud product on the customer's own infrastructure, so the database, the data and the backups stay on their side.",
            "It is the same managed product pointed at a customer-hosted database, delivered as signed container images, not a different or cut-down backend.",
            "Identity is the customer's own SSO via SAML or OIDC (Microsoft Entra ID, Okta, Google Workspace); full team features including realtime sync and overlap detection run on their infra.",
            "AI is a toggle between a hosted proxy and bring-your-own-key; licensing is entitlement-based, and on expiry writes pause while reads and existing data stay available."
          ]
        }
      ]
    },
    {
      "slug": "surfaces",
      "title": "Surfaces",
      "pages": [
        {
          "slug": "web",
          "title": "Pathrule Web",
          "description": "The management console for Pathrule at app.pathrule.io. Organizations, members and roles, plans and billing, workspaces and usage, from any browser.",
          "updated": "2026-06-23",
          "url": "https://www.pathrule.io/docs/surfaces/web",
          "mdUrl": "https://www.pathrule.io/docs/surfaces/web.md",
          "llmSummary": [
            "Pathrule Web lives at app.pathrule.io and is the management console for your organization, not a coding surface.",
            "It owns organizations, members and roles, plans and billing, workspace admin (rename, archive, export) and usage analytics.",
            "Knowledge authoring (memories, rules, skills) and running agents happen in Pathrule Studio, the desktop app.",
            "Sign in once; the same workspaces and members are shared across Studio and Web."
          ]
        },
        {
          "slug": "desktop",
          "title": "Pathrule Studio",
          "description": "The native macOS app for Pathrule. Code with Claude Code, Codex and OpenCode in one workbench, with the local runtime, MCP server, hooks and cache bundled in.",
          "updated": "2026-06-23",
          "url": "https://www.pathrule.io/docs/surfaces/desktop",
          "mdUrl": "https://www.pathrule.io/docs/surfaces/desktop.md",
          "llmSummary": [
            "Pathrule Studio is the native macOS app and the flagship Pathrule surface.",
            "It runs Claude Code, Codex and OpenCode in one app, lets you switch models mid-conversation, and has an orchestrated mode where a conductor model delegates subtasks across engines.",
            "Your team's memories, rules and skills are delivered natively on the path you are working in, with the MCP server, hook supervisor and local cache bundled in.",
            {
              "Around the chat sits a full workbench": "source control, Patterns, MCP servers and extensions, scheduled tasks, usage, an integrated terminal and run."
            },
            "Organization, members and roles, billing and workspace admin route out to Pathrule Web. Studio and CLI can coexist; run pathrule doctor if ownership is unclear."
          ]
        },
        {
          "slug": "cli",
          "title": "Pathrule CLI",
          "description": "The terminal first surface for Pathrule. Scriptable, SSH friendly, and a full local runtime for agents you drive from a shell.",
          "updated": "2026-06-23",
          "url": "https://www.pathrule.io/docs/surfaces/cli",
          "mdUrl": "https://www.pathrule.io/docs/surfaces/cli.md",
          "llmSummary": [
            "Pathrule CLI is the terminal first runtime. Auth, workspace attach, AI client install, doctor, and JSON output for scripts.",
            "It hosts the MCP server, the hook supervisor, and the local cache the same way Pathrule Studio does.",
            "SSH friendly via device code login. Stable JSON output makes it scriptable for CI and automation.",
            "Billing, team, and org admin commands open the matching Pathrule Web view in your browser."
          ]
        },
        {
          "slug": "vscode",
          "title": "Pathrule for VS Code",
          "description": "The Pathrule extension for VS Code, Cursor and Windsurf. A full client with a knowledge tree, markdown-tab editing and one-command agent setup, in local or cloud mode.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/surfaces/vscode",
          "mdUrl": "https://www.pathrule.io/docs/surfaces/vscode.md",
          "llmSummary": [
            "Pathrule for VS Code is a native editor extension and a full Pathrule client, with the same knowledge tree, content editing and agent setup as the other surfaces.",
            {
              "It runs in two modes behind one UI": "local with no account (the open source core) and cloud with sign in (team features), the same split as the CLI."
            },
            "Memories, rules and skills open as ordinary markdown editor tabs; saving persists through Pathrule with conflict-safe handling, never a silent overwrite.",
            "The knowledge tree follows the active file to the deepest covering path, and the status bar shows that path and its content counts.",
            "One command connects your AI clients (Copilot agent mode, Claude Code, Cursor, Codex, Windsurf) and injects hooks, with a doctor command to verify the setup.",
            "It installs from the Visual Studio Marketplace and Open VSX, so Cursor and Windsurf can install it too."
          ]
        },
        {
          "slug": "remote-mcp",
          "title": "Pathrule Remote MCP",
          "description": "The cloud-only MCP surface for Pathrule. A hosted Model Context Protocol server at mcp.pathrule.io that gives remote AI clients OAuth-scoped access to your workspace, with no local install.",
          "updated": "2026-05-30",
          "url": "https://www.pathrule.io/docs/surfaces/remote-mcp",
          "mdUrl": "https://www.pathrule.io/docs/surfaces/remote-mcp.md",
          "llmSummary": [
            "Pathrule Remote MCP is a hosted MCP server at https://mcp.pathrule.io/mcp for AI clients that only support cloud connectors, such as Claude.ai, Claude Code remote, and Codex remote.",
            "It is OAuth-authenticated and cloud-only. It cannot read local files or run hooks, so there is nothing to install.",
            "It exposes the same workspace as the other surfaces, memories, rules, skills, snapshots, and activity logging, gated by OAuth scopes (pathrule:read, pathrule:write, pathrule:activity) and database row-level security.",
            "Source and the registry manifest live at github.com/pathrule/mcp and https://mcp.pathrule.io/server.json."
          ]
        }
      ]
    },
    {
      "slug": "content",
      "title": "Memory, Rules, Skills",
      "pages": [
        {
          "slug": "memories",
          "title": "Writing memories",
          "description": "What memories are, when to write them, and how to scope them so your assistant surfaces them at the right time.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/content/memories",
          "mdUrl": "https://www.pathrule.io/docs/content/memories.md",
          "llmSummary": [
            "A memory is a short markdown note attached to a workspace path. The assistant sees it when work happens nearby.",
            "Write memories for decisions, gotchas, postmortems, and conventions that are not obvious from the code itself.",
            "Scope by path. A memory at /apps/web only surfaces when the assistant is working under apps/web.",
            "Memories are versioned. Each save carries a version token so concurrent edits conflict cleanly instead of clobbering.",
            "The same memory the AI writes via MCP is the one your teammate reads in the UI. No private cache, no parallel store."
          ]
        },
        {
          "slug": "rules",
          "title": "Writing rules",
          "description": "",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/content/rules",
          "mdUrl": "https://www.pathrule.io/docs/content/rules.md"
        },
        {
          "slug": "skills",
          "title": "Writing skills",
          "description": "How to capture a reusable procedure the assistant can invoke by name instead of re deriving the steps every time.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/content/skills",
          "mdUrl": "https://www.pathrule.io/docs/content/skills.md",
          "llmSummary": [
            "A skill is a named procedure the assistant can invoke. Useful for recurring jobs like replaying a webhook or running a release checklist.",
            "Skills are workspace level and attached to nodes through a join. One skill can be reused across many paths.",
            {
              "Three sources": "manual (written by hand or by the assistant), template (Pathrule provided starters), github_ref (external published skills)."
            },
            "Author a skill when you notice the same pattern repeating. The assistant can also suggest a skill rather than write one directly.",
            "The full SKILL.md body is the source of truth, including frontmatter and instructions."
          ]
        },
        {
          "slug": "suggestions",
          "title": "Suggestions and self-audit",
          "description": "",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/content/suggestions",
          "mdUrl": "https://www.pathrule.io/docs/content/suggestions.md"
        },
        {
          "slug": "work-episodes",
          "title": "How did we solve this before",
          "description": "How Pathrule rolls the activity your agents log into work episodes, so a later session can recall what your team solved before, where, and when.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/content/work-episodes",
          "mdUrl": "https://www.pathrule.io/docs/content/work-episodes.md",
          "llmSummary": [
            "When an AI session finishes a piece of work it can log the area, action, files, and a short summary; Pathrule rolls related activity into a work episode, a titled record of one thing your team solved.",
            "Recall is on demand, not on every prompt. Ordinary prompts add no history, so the context window pays no tax for memory it is not using.",
            "Episodes surface only on tasks where the past helps (fixing a bug, debugging, refactoring, exploring), and stay quiet for small UI tweaks and brand-new features.",
            "Relevance combines what the work was about, where it happened, and how recent it was, and Pathrule would rather surface nothing than surface the wrong thing.",
            "Episodes are built only from activity you log, never from your source code, and are scoped to your workspace behind the same per-user access control as the rest of your knowledge."
          ]
        }
      ]
    },
    {
      "slug": "patterns",
      "title": "Patterns",
      "pages": [
        {
          "slug": "overview",
          "title": "Patterns overview",
          "description": "What a Pathrule pattern is, why patterns exist, and how a curated bundle of memories, rules and skills lands pre-scoped in your workspace.",
          "updated": "2026-06-09",
          "url": "https://www.pathrule.io/docs/patterns/overview",
          "mdUrl": "https://www.pathrule.io/docs/patterns/overview.md",
          "llmSummary": [
            "A pattern is a curated package of memories, rules and skills, each piece pre-scoped to the workspace path it belongs to.",
            "The public catalog at /patterns is first-party and Apache-2.0, spanning frameworks, frontend, backend, billing, infra and workflow.",
            "A pattern reuses the same content model as the rest of Pathrule, so an imported piece behaves exactly like one you wrote by hand.",
            "You can copy a bundle manually today, or import it with a single token; either way the pieces become yours and evolve locally."
          ]
        },
        {
          "slug": "anatomy",
          "title": "Anatomy of a pattern",
          "description": "The content model behind a pattern, how each piece is typed and pre-scoped, and how versioning and the open package keep the catalog honest.",
          "updated": "2026-06-09",
          "url": "https://www.pathrule.io/docs/patterns/anatomy",
          "mdUrl": "https://www.pathrule.io/docs/patterns/anatomy.md",
          "llmSummary": [
            "A pattern is a bundle of pieces; each piece is a memory, rule or skill with a target node path and a full markdown body.",
            "Rule pieces carry scope, priority and enforcement; skill pieces carry an invocable name and tags. These survive import unchanged.",
            "Counts and target paths are derived from the pieces, so a pattern's summary can never drift from its actual contents.",
            "Patterns live in the open @pathrule/patterns package; each one carries a version, an updated date and an optional changelog."
          ]
        },
        {
          "slug": "importing",
          "title": "Importing a pattern",
          "description": "How the reference token brings a pattern into your workspace, how paths are chosen, and how to remove a bundle later.",
          "updated": "2026-06-09",
          "url": "https://www.pathrule.io/docs/patterns/importing",
          "mdUrl": "https://www.pathrule.io/docs/patterns/importing.md",
          "llmSummary": [
            "Paste ::pathrule:package:<slug> into your AI assistant and Pathrule imports the pattern's pieces onto the matching paths.",
            "A dry-run preview shows pieces and suggested paths, aligns them to your tree, and asks you to confirm when the stack does not match.",
            "Imported pieces become yours and evolve locally; re-importing is idempotent and a single call removes the whole bundle.",
            "Import works across Claude Code, Cursor, Codex, Windsurf and GitHub Copilot, on the local runtimes and the hosted Remote MCP."
          ]
        }
      ]
    },
    {
      "slug": "teams",
      "title": "Teams",
      "pages": [
        {
          "slug": "real-time-collaboration",
          "title": "Real-time collaboration",
          "description": "How Pathrule syncs team knowledge live, detects overlapping edits at save time, and lets you resolve a conflict by keeping yours, taking theirs, or merging with AI.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/teams/real-time-collaboration",
          "mdUrl": "https://www.pathrule.io/docs/teams/real-time-collaboration.md",
          "llmSummary": [
            "When a teammate writes a memory, rule, or skill, the change propagates to everyone within a couple of seconds, both in the UI and in the MCP context that external AI clients read.",
            "Pathrule does not silently overwrite. If you are editing an item a teammate just changed, you see a stale-base warning before you save.",
            "Overlap is detected at save time using a version token, not by locking the item, so two people can work in parallel and only collide if they touched the same thing.",
            {
              "On a conflict you get three choices": "keep mine, take theirs, or AI merge. Both destructive options confirm first, and your local edits are never thrown away without your say-so."
            },
            "AI merge does a three-way combine against the common starting version and returns an editable result you approve before it saves.",
            "A read-only change history records who changed what, when, and whether the edit came from a person or an AI client."
          ]
        },
        {
          "slug": "roles-and-permissions",
          "title": "Roles and permissions",
          "description": "The workspace roles in Pathrule, how per-node overrides cascade to child paths, and how the database enforces every read and write the same way across Web, Studio, CLI, and MCP.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/teams/roles-and-permissions",
          "mdUrl": "https://www.pathrule.io/docs/teams/roles-and-permissions.md",
          "llmSummary": [
            {
              "Pathrule has four roles assigned at the organization level": "Owner, Admin, Member, and Viewer."
            },
            "A workspace is either organization-wide (every org member has access) or private (only added members do).",
            "Per-node permission overrides apply to a path and cascade to its children unless a descendant overrides them.",
            "Losing write access is non-destructive. The editor goes read-only and content is only hidden if read access is removed.",
            "Access is enforced by the database, not the app, and the same way for Web, Studio, CLI, and the MCP server."
          ]
        }
      ]
    },
    {
      "slug": "mcp",
      "title": "MCP and AI clients",
      "pages": [
        {
          "slug": "overview",
          "title": "MCP overview",
          "description": "How Pathrule serves your team knowledge to Claude Code, Cursor, Codex, Windsurf, GitHub Copilot, and any MCP compatible client.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/mcp/overview",
          "mdUrl": "https://www.pathrule.io/docs/mcp/overview.md",
          "llmSummary": [
            {
              "Pathrule serves MCP two ways": "a local server inside Pathrule Studio and the CLI (over stdio), and a hosted Remote MCP endpoint that cloud-only clients connect to directly over streamable-http."
            },
            "The server exposes read tools to fetch context and write tools to create or update memories, rules, and skills at workspace paths.",
            "Most context arrives without an explicit tool call thanks to hooks. MCP tools are used when the assistant needs more, or when the user asks Pathrule to write something down.",
            "Any MCP client can connect. Claude Code, Cursor, and Codex CLI are first class."
          ]
        },
        {
          "slug": "one-contract",
          "title": "One contract, every surface",
          "description": "Pathrule exposes one MCP tool contract. The same tools serve Studio, CLI, VS Code, Web, and Remote MCP, and reach Claude Code, Cursor, Codex, Windsurf, and GitHub Copilot. Tool-agnostic, low lock-in.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/mcp/one-contract",
          "mdUrl": "https://www.pathrule.io/docs/mcp/one-contract.md",
          "llmSummary": [
            "Pathrule exposes one MCP tool contract; the tool names, arguments, and responses are identical across every surface and AI client.",
            "Studio, CLI, and the VS Code extension are local runtimes that host the MCP server over stdio; Pathrule Web is the cloud-only management console; Remote MCP is a hosted streamable-http endpoint at mcp.pathrule.io.",
            "The VS Code extension registers the server with Copilot agent mode and writes managed MCP entries for Claude Code, Cursor, Codex, and Windsurf, so the editor agent reaches the same tools with no hand-edited JSON.",
            "No surface has a tool that reads your source files; local runtimes keep code on the machine, the remote endpoint is OAuth-scoped and cloud-only.",
            "Because the contract is plain MCP, Pathrule is tool-agnostic and low lock-in; any MCP client can connect by adding the Pathrule MCP command to its config."
          ]
        },
        {
          "slug": "claude-code",
          "title": "Claude Code",
          "description": "How Pathrule shows up to Claude Code through hooks and MCP, and what gets written into your project for the integration to work.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/mcp/claude-code",
          "mdUrl": "https://www.pathrule.io/docs/mcp/claude-code.md",
          "llmSummary": [
            {
              "Pathrule integrates with Claude Code through two mechanisms": "hooks for fast path injection, and MCP tools for deeper reads and writes."
            },
            "Hooks are registered in .claude/settings.json on PreToolUse, UserPromptSubmit, and PostToolUse events.",
            "Strict rules can block a matching tool call before it runs; advisory rules inject as context. Priority (high, medium, low) ranks rules, it does not decide blocking.",
            {
              "Companion files": "CLAUDE.md as workspace overview, .claude/settings.json for hooks, .claude/rules/pathrule-protocol.md for the interaction protocol."
            },
            "The integration is auto installed by Pathrule Studio or pathrule install claude on the CLI."
          ]
        },
        {
          "slug": "cursor",
          "title": "Cursor",
          "description": "How Pathrule integrates with Cursor through native hooks and MCP, with parity to the Claude Code integration.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/mcp/cursor",
          "mdUrl": "https://www.pathrule.io/docs/mcp/cursor.md",
          "llmSummary": [
            "Pathrule uses Cursor's native hook system (.cursor/hooks.json) so it shows up in Cursor's Hooks Settings tab like any first party integration.",
            {
              "Hook events": "sessionStart and postToolUse deliver the path-scoped context, preToolUse enforces strict rules (it blocks but does not carry context on Cursor)."
            },
            "Cursor uses MCP for deeper reads and writes through the same Pathrule tool surface.",
            {
              "Per client isolation": "you can run Cursor only, Claude Code only, or both. The hook script switches event shapes transparently."
            },
            "Install with pathrule install cursor or through the Pathrule Studio AI clients tab."
          ]
        },
        {
          "slug": "codex",
          "title": "Codex CLI",
          "description": "How Pathrule integrates with OpenAI's Codex CLI through MCP and a companion AGENTS.md file, with the same content tree as the other clients.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/mcp/codex",
          "mdUrl": "https://www.pathrule.io/docs/mcp/codex.md",
          "llmSummary": [
            "Codex CLI reads Pathrule through AGENTS.md (companion file) and the MCP tool surface.",
            "The MCP tools are the same set Claude Code and Cursor use; only the client config differs.",
            "Native hook support in Codex is limited compared to Claude Code or Cursor; Pathrule compensates by keeping AGENTS.md current and by routing more work through MCP tools.",
            "Codex applies patches via apply_patch markers; Pathrule's hook script understands that format when it does run.",
            "Install with pathrule install codex or through the Pathrule Studio AI clients tab."
          ]
        },
        {
          "slug": "windsurf",
          "title": "Windsurf",
          "description": "How Pathrule integrates with Windsurf through MCP and a companion instruction file, with the same content tree and tool surface as every other client.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/mcp/windsurf",
          "mdUrl": "https://www.pathrule.io/docs/mcp/windsurf.md",
          "llmSummary": [
            "Windsurf connects to Pathrule through an MCP server entry and a companion instruction file rendered in the format Windsurf reads.",
            "The companion file is generated from a shared renderer, so the Windsurf protocol stays in sync with Claude Code, Cursor, and Codex instead of drifting as a hand-copied file.",
            "The MCP tool surface is identical to every other client; only the client config differs.",
            "Windsurf is a VS Code fork, so the Pathrule VS Code extension can register the same MCP entry from inside the editor with no hand-edited JSON.",
            "Install with pathrule install windsurf or through the Pathrule Studio AI clients tab, then verify with the doctor."
          ]
        },
        {
          "slug": "copilot",
          "title": "GitHub Copilot",
          "description": "How Pathrule integrates with GitHub Copilot across VS Code agent mode, the Copilot CLI, and the coding agent, through repo-level instruction files, hooks, MCP, and Agent Skills.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/mcp/copilot",
          "mdUrl": "https://www.pathrule.io/docs/mcp/copilot.md",
          "llmSummary": [
            {
              "Pathrule supports GitHub Copilot as a first class agent target across three surfaces that share the same repo level files": "VS Code agent mode, the Copilot CLI, and the coding agent."
            },
            {
              "Pathrule writes Copilot's native paths": ".github/copilot-instructions.md (auto applied), .github/instructions/pathrule.instructions.md (applyTo scoped), .github/hooks/pathrule.json (hooks), and .github/skills when Claude Code is not also active."
            },
            {
              "Hook coverage matches the Cursor profile": "SessionStart delivers the bootstrap context, PostToolUse delivers path scoped context, and PreToolUse enforces strict rules; the per prompt event is not wired because it carries no context."
            },
            {
              "MCP is configured per surface": "a user level mcp.json for VS Code (servers key) and ~/.copilot/mcp-config.json for the Copilot CLI; the coding agent reads MCP from repo Settings and is a documented manual step."
            },
            "The same shared hook script serves every client and is fail open, so an unrecognized payload returns nothing rather than breaking a Copilot session."
          ]
        },
        {
          "slug": "tools-reference",
          "title": "MCP tools reference",
          "description": "Every Pathrule MCP tool the assistant can call, grouped by purpose, with a one line description of what each does.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/mcp/tools-reference",
          "mdUrl": "https://www.pathrule.io/docs/mcp/tools-reference.md",
          "llmSummary": [
            {
              "Pathrule exposes a small MCP surface grouped by purpose": "context, memory, rule, skill, activity, suggestions, and utility."
            },
            "The primary entry point is pathrule_get_context. Most other tools are reached from the ids it surfaces.",
            "Write tools auto create missing nodes along the workspace path. You never call a separate create node tool.",
            "Update tools use optimistic concurrency through version ids. Mismatched versions return a clear conflict error.",
            "Activity logging is mandatory after a file modifying response. Use pathrule_log_activity once per response."
          ]
        }
      ]
    },
    {
      "slug": "hooks",
      "title": "Hooks",
      "pages": [
        {
          "slug": "how-hooks-work",
          "title": "How hooks work",
          "description": "How Pathrule injects path scoped memories and rules into your AI assistant before the first tool call.",
          "updated": "2026-06-13",
          "url": "https://www.pathrule.io/docs/hooks/how-hooks-work",
          "mdUrl": "https://www.pathrule.io/docs/hooks/how-hooks-work.md",
          "llmSummary": [
            "Hooks are short scripts your AI client invokes on pre tool use and user prompt submit events. Pathrule registers them when you attach a workspace.",
            "The hook reads a precomputed slice from the local cache and returns it as system context, so there is no synchronous MCP call mid turn.",
            "The most relevant memories and skills for the prompt are delivered as full bodies the assistant can act on directly, not just titles to fetch later.",
            "The slice is shaped by path and intent. UI tweaks see a minimal payload. Discovery prompts unlock a deeper one.",
            "When the hook surfaces nothing useful or the user asks for discovery, the assistant falls back to pathrule_get_context."
          ]
        },
        {
          "slug": "rules-as-guardrails",
          "title": "Rules as guardrails",
          "description": "How a high-priority Pathrule rule can block a non-compliant change before it lands, not just describe the problem after it ships.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/hooks/rules-as-guardrails",
          "mdUrl": "https://www.pathrule.io/docs/hooks/rules-as-guardrails.md",
          "llmSummary": [
            "Context arrives before the assistant acts. Hooks deliver the rules attached to a path on prompt submit and before each tool call, so the assistant does not have to remember to ask.",
            "Rules come at two levels. Advisory rules ride along as context. High-priority rules marked for enforcement can block a non-compliant tool call before the file is written.",
            "When a high-priority rule is violated, the hook stops the change and returns the rule text. The assistant reads the reason and retries inside the constraint, so the non-compliant version never reaches disk.",
            "Enforcement fails open. If the supervisor cannot evaluate a rule, your work is not blocked, and a kill switch turns every hook off instantly."
          ]
        },
        {
          "slug": "work-safety",
          "title": "Work safety",
          "description": "How Pathrule checks a risky edit before it lands, asks for confirmation when a write would collide with a teammate, and fails open so it never blocks your work.",
          "updated": "2026-06-07",
          "url": "https://www.pathrule.io/docs/hooks/work-safety",
          "mdUrl": "https://www.pathrule.io/docs/hooks/work-safety.md",
          "llmSummary": [
            "Before a write, the same hook that delivers context runs a pre-tool check. A clean write proceeds with no prompt. A risky one surfaces as your AI client's normal confirmation moment.",
            "A write is risky when a teammate is actively working on the same file, or has changed it locally and not committed it. The confirmation names the person and the conflict and nothing else.",
            "This is a separate guardrail from rule enforcement. A conflict check asks and lets you continue; a high-priority rule violation can block outright.",
            "The check fails open. If it cannot verify in time it asks on a write, allows a read, and never hangs the assistant. A kill switch turns every hook off instantly.",
            "It runs after a normal install with no setup, and it stores no source files or diffs remotely. Your own uncommitted work never warns you."
          ]
        }
      ]
    },
    {
      "slug": "retrieval",
      "title": "Retrieval",
      "pages": [
        {
          "slug": "how-retrieval-works",
          "title": "How retrieval finds the right knowledge",
          "description": "How Pathrule narrows by path, matches on meaning and keywords, works across languages, learns from real usage, and computes the same answer once for the whole team.",
          "updated": "2026-06-13",
          "url": "https://www.pathrule.io/docs/retrieval/how-retrieval-works",
          "mdUrl": "https://www.pathrule.io/docs/retrieval/how-retrieval-works.md",
          "llmSummary": [
            "Retrieval narrows by path first, so the candidate set is already small before anything more expensive runs.",
            "It matches your intent on meaning and on keywords at once, so exact matches keep priority and same-idea-different-words matches still surface.",
            "Meaning-based matching works across languages, including the case where prompt and memory share an idea but no words.",
            "The entries that clearly fit the prompt are delivered as full ready-to-use content, so the assistant acts on them without a separate fetch.",
            "Uncertain matches are shown as candidates to read, not asserted as answers, because wrong context is worse than no context.",
            "Retrieval learns from which knowledge actually helped over time, skips ambiguous signals, and lets influence fade as code drifts.",
            "The selection is computed once on the server, so the whole team and every AI client get the same result."
          ]
        }
      ]
    },
    {
      "slug": "cli",
      "title": "CLI",
      "pages": [
        {
          "slug": "install",
          "title": "Install",
          "description": "Install Pathrule CLI on macOS, Linux, or Windows with npm, then sign in over a browser or an SSH friendly device code flow.",
          "updated": "2026-05-15",
          "url": "https://www.pathrule.io/docs/cli/install",
          "mdUrl": "https://www.pathrule.io/docs/cli/install.md",
          "llmSummary": [
            "Pathrule CLI installs with npm on macOS, Linux, and Windows (Node 20.11.1+), or a direct signed download; a Homebrew tap is planned.",
            {
              "Two sign in flows": "pathrule login opens a browser PKCE flow, pathrule login --device-code returns a short code for headless or SSH boxes."
            },
            "After login, pathrule workspace attach binds a local repo path to a cloud workspace so the runtime knows which content to serve.",
            "pathrule doctor verifies cache, MCP server, and AI client integration in one command."
          ]
        }
      ]
    }
  ]
}
