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 分
