Pathrule
io.pathrule由 pathrule.io 发布官方发布者v1.0.6更新于 Oct 26, 2026
Path-scoped project memories, rules and skills for coding agents, on your machine or Pathrule Cloud.
发布方自己的服务:Pathrule
概览
Pathrule 为编码代理保存按路径划分的记忆、规则和技能,并只向代理提供与即将修改的代码相关的条目。
- 可以做什么
- 按路径检索项目知识,让代理获得针对当前文件的记忆、规则和技能
- 通过 get_context 工具按需获取上下文,深度随请求而定
- 把决策、坑点和失败命令的教训记录为简短 markdown 笔记,归档在相关代码旁
- 让强制规则优先于建议,并把超出单次提示预算的内容按标题列出
- 在 Claude Code、Codex、Cursor、GitHub Copilot、Windsurf 及其他 MCP 客户端之间共享同一份知识
- 适用场景
- 适合在不同会话和不同工具中反复向编码代理重复同样纠正的场景,或 CLAUDE.md、AGENTS.md 已变得很大且每一步都被完整读取的情况。也适合希望按路径而非单一全局文件下发项目约定的团队。
- 运行要求
- 使用 cloud.pathrule.io 远程端点并需 OAuth 登录,或通过 npx 运行本地 npm 包 @pathrule/mcp;CLI 安装方式需要 macOS、Linux 或 Windows 上的 Node.js 22.14.0 或更高版本。本地模式无需账号、网络或模型。Cloud 工作区为可选,按 AI Credits 计费。
安装
在 SourceWeft 中
- 打开 控制台中的 Pathrule,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.pathrule%2Fpathrule/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。
{
"mcpServers": {
"pathrule": {
"type": "http",
"url": "https://cloud.pathrule.io/mcp"
}
}
}README
English · Español · Français · Deutsch · 日本語 · Italiano · Türkçe · Português (Brasil)
Your AI forgets. Pathrule remembers.
The open-source knowledge layer for coding agents. Pathrule keeps what your project has learned as memories, rules and skills scoped to paths in your code, and gives Claude Code, Codex, Cursor, GitHub Copilot and Windsurf only what the task in front of them needs, before they act.
[npm] [License: Apache-2.0] [PathruleBench: Python · Go · TypeScript] [CI] [VS Code Marketplace] [Open VSX]
PathruleBench, 2,000 items: 55% lower cost a chain · 2.7× fewer input tokens · 97% of memory probes passed · the numbers
Website · Docs · Quickstart · Benchmarks · Smarter over time · Changelog
Same request, same agent. On the right, Pathrule's hook hands over the three notes filed for apps/web/dashboard before the agent writes a line.
Works with Claude Code · Codex · Cursor · GitHub Copilot · Windsurf · any MCP client
Quickstart
Node.js 22.14.0 or newer, on macOS, Linux or Windows.
Restart your agent. From the next session on, it gets the notes for the path it is about to touch, and writes new ones as it works.
Explain it once
Coding agents start every session blank. So the same correction comes back, day after day, agent after agent:
Five sessions, three agents, nothing remembered. With Pathrule you say it once:
- You fix it once, the way you normally would.
- Pathrule files it next to the code it is about: a memory on
features/, not a line in a file every session has to read. - Every agent knows from the next session on, whichever one you open.
Only what matters
A workspace collects hundreds of notes. An agent editing features/orders needs four of them.
Knowledge is matched by path, scope and relevance, then fit to a per-prompt budget. Enforced rules are never cut for space. Whatever does not fit is listed by title, so the agent can ask for it. When a prompt names a function or a type, the hook also points the agent to the file and line where it is defined (JS/TS, Python, Go).
Three kinds of knowledge
Three ways in
Why not just CLAUDE.md?
[PathruleBench: Python · Go · TypeScript]
A CLAUDE.md file is read whole on every step, so every note your team adds makes every session cost more. Pathrule sends each prompt only what the path and the task need. PathruleBench measured the difference with the same agent, the same prompts and the same hidden checks, from 500 to 2,000 items of team knowledge.
[Cost and input tokens a chain: CLAUDE.md climbs as knowledge grows, Pathrule stays flat]
From 500 to 2,000 items, a chain with CLAUDE.md costs 89–98% more. With Pathrule it moves between −1% and +10%. Your knowledge base can grow; the bill does not.
Claude Code with claude-sonnet-5-5 in Python, Go and TypeScript; nine chains an arm at 2,000 items (three per language); executable tests decide every pass, no model judges. The Pathrule arm is this repository's open-source CLI in local mode: no Cloud, no model.
Every condition, chain and check, and how to run it yourself → pathrule/benchmark
Smarter the longer you use it.
Day one needs no account, no network and no model. Everything after builds on what you and your agents already did in this repository.
[Smarter the longer you use it.]
No model runs on your machine. Everything before Team is the open-source CLI, the same path the benchmark above measured.
Switch agents. Keep the knowledge.
[Switch agents. Keep the knowledge.]
Not another rules file
Keep your CLAUDE.md and AGENTS.md: Pathrule does not edit them. It delivers the rest per path and per task, where a single file cannot.
What's in this repository
This is Pathrule's open-source foundation. It runs with no account and no network service: the store, retrieval and ranking, the MCP server, the hooks, the learning loop and the CLI.
The 11 packages
protocol · agent-ir · core · integrations · mcp · host · ui · local-console · cloud · cli · vscode
Your code stays yours
- Source code is never uploaded automatically.
- Local mode has no account, runs no model, and the open CLI sends no telemetry.
- Your agent keeps its own model provider. Pathrule is not a model, an agent or an IDE.
- Pathrule Cloud is opt-in. Signed in, it stores your knowledge and uses the prompt to rank it, and its model tier may read a prompt to find a decision meant to last.
Community
[Star history]Contributors
[Contributors]Contributing (DCO sign-off) · Code of conduct · Report a vulnerability · Get help · Trademark policy
License
Apache-2.0. See LICENSE and NOTICE. The Pathrule name and logo are not licensed under Apache-2.0.
来源:README.md,提交 37dec9b
工具
0版本历史
1- v1.0.6最新Oct 19, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
