# Pathrule

Binds memories, rules, and skills to code paths so coding agents receive only relevant instructions before writing code.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: pathrule
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pathrule/pathrule
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/mcp/pathrule

## What it does

Pathrule acts as an open-source knowledge layer for development agents. It files architectural decisions, constraints, and operational skills next to specific directories. When an agent prepares to edit a file, Pathrule matches the target path, trims information to fit the prompt budget, and delivers the notes. Enforced rules are never trimmed away for space.

When a prompt references functions or types, the system resolves their exact file and line number across JavaScript, TypeScript, Python, or Go. All stored entries can be viewed and managed via `pathrule ui` running locally on `127.0.0.1`.

Running the local toolchain demands a Node environment at release 22.14.0 or higher. Connecting directly to the hosted HTTP endpoint bypasses package setup entirely, but drops local hooks.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://cloud.pathrule.io/mcp`

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http pathrule https://cloud.pathrule.io/mcp
```

2. **Platform CLI**
```bash
claude mcp add pathrule -- npx -y @pathrule/mcp
```

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add pathrule --url https://cloud.pathrule.io/mcp
```

2. **Platform CLI**
```bash
codex mcp add pathrule -- npx -y @pathrule/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "pathrule": {
            "url": "https://cloud.pathrule.io/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "pathrule": {
            "command": "npx",
            "args": [
                "-y",
                "@pathrule/mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "pathrule": {
            "type": "http",
            "url": "https://cloud.pathrule.io/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "pathrule": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@pathrule/mcp"
            ]
        }
    }
}
```

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http pathrule https://cloud.pathrule.io/mcp
```

2. **Platform CLI**
```bash
gemini mcp add pathrule npx -y @pathrule/mcp
```

## When to use it
- Attach project conventions and guidelines to specific directory paths
- Stop repeating architectural instructions across separate agent sessions
- Point agents to exact definition lines for functions and types
- Inspect project knowledge through a local browser dashboard

## Example prompts
- Add a rule for `features/orders` to handle all API traffic exclusively through our custom client.
- Check the saved notes and constraints recorded for `apps/web/dashboard`.
- List the enforced rules and checklist skills applicable to the auth directory.

## Similar
- [remember](https://affpapa.org/en/nevibecode/skills/rohitg00-remember.md) — skill · 14000 installs
- [handoff](https://affpapa.org/en/nevibecode/skills/rohitg00-handoff.md) — skill · 13400 installs
- [wrap-up](https://affpapa.org/en/nevibecode/skills/codewithmukesh-wrap-up.md) — skill · 2800 installs
- [self-improvement](https://affpapa.org/en/nevibecode/skills/self-improvement.md) — skill · 2000 installs
- [memory-continue](https://affpapa.org/en/nevibecode/skills/memory-continue.md) — skill · 1300 installs
- [memory-reflect](https://affpapa.org/en/nevibecode/skills/basicmachines-co-memory-reflect.md) — skill · 746 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
