
Context Autopilot
io.github.ChiragBachani由 GitHub 帳號 ChiragBachani 發布v0.6.0更新於 Oct 25, 2026
Mines your Claude Code and Cursor sessions into evidence-based CLAUDE.md / AGENTS.md rules.
概覽
一個本機 MCP 伺服器,把 Claude Code 與 Cursor 工作階段歷史挖掘成有證據支撐、由你批准的 CLAUDE.md 與 AGENTS.md 規則。
- 可以做什麼
- 列出有可觀察 Claude Code 或 Cursor 工作階段歷史的專案,並掃描其中重複的指示、糾正和被拒絕的工具呼叫,附上原文引用作為證據。把這些訊號提煉成專案層級或跨所有專案的全球規則提案。把已保存在專案記憶或上下文檔案中的規則提升到全球規則檔案。審閱提案,只把你接受的規則寫入 CLAUDE.md 和 AGENTS.md 的受管區塊。找出過時的上下文檔案引用,例如遺失的檔案或已移除的 npm 指令碼,並以非零結束碼供 CI 使用。
- 適用情境
- 當你反覆向編碼助理重複同樣的慣例,希望根據自己過去的工作階段而非一般性的儲存庫掃描來建立持久上下文檔案時使用。適合同時使用 Claude Code 和 Cursor、並希望在寫入任何內容前明確批准或拒絕的開發者。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js;挖掘 Cursor 工作階段需要 Node 22 或更新版本,較舊版本會略過該來源。提煉透過你現有的 claude CLI 完成,不需要 API 金鑰。它會讀取本機 Claude Code 記錄和 Cursor 的本機 SQLite 儲存。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Context Autopilot,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Context Autopilot
Automated context collection for coding agents. Mines your real agent sessions — every instruction you repeated, every correction you made, every tool call you rejected — and distills them into CLAUDE.md / AGENTS.md rules you approve.
Part of The Context Layer.
Run in your terminal (it's a plain CLI — don't paste this into a chat):
Why
Every session starts blank, so you re-teach your agent the same conventions — and when you forget, it repeats the same mistakes. Hand-writing context files works but nobody keeps them current. And naive auto-generation is worse: research on LLM-generated context files found they reduce task success and raise cost, because repo scans produce generic filler.
Context Autopilot takes a third path: evidence. Your session history is a literal record of what the agent got wrong and what you said to fix it. Autopilot mines that record and only proposes rules your own words support — each one shipped with the quotes that justify it.
How it works
- Observe —
ctxlayer scanparses your local Claude Code transcripts (~/.claude/projects) and Cursor sessions and extracts three signal types: instructions repeated across sessions, corrections after the agent went wrong, and rejected tool calls. Runs 100% locally. - Distill —
ctxlayer distillsends the signals (not your history) through Claude — via your existingclaudeCLI, no API key needed — and gets back imperative, project-specific rules with evidence and confidence ratings. - Approve —
ctxlayer applywalks you through each proposal. Accepted rules land in a managed block:
Hand-written content is never touched; re-runs update the block idempotently. Rules are written to both CLAUDE.md and AGENTS.md, so Claude Code, Cursor, Copilot, Codex, and every AGENTS.md-aware agent benefits.
Install
Commands
Global mode
Project context files hold repo conventions — but some feedback is about you: "explain things in plain English", "don't build while I'm brainstorming", "run independent work in parallel". Global mode mines all your projects across all your tools for exactly that, and maintains a managed block in your personal ~/.claude/CLAUDE.md, so every future session in every project starts already knowing how you like to work. Rules that mention a specific project are excluded by design — those belong in the project's own context file.
Promote saved memory to global
Where global mode mines your session transcripts, promote mines the memory your agents have already written down: each project's auto-memory files (~/.claude/projects/<name>/memory/) and each repo's CLAUDE.md/AGENTS.md. Rules about how you work — or rules duplicated in two or more projects — are proposed for your global ~/.claude/CLAUDE.md, generalized and with the source files as evidence. Additive only: project files are read, never edited. Anything already covered globally is filtered before the model is even called.
Options: --project <path>, --global, --source claude-code|cursor|all, --model <model>, --min-score <n>, --yes, --json.
Cursor session mining reads Cursor's local SQLite storage via Node's built-in node:sqlite (Node 22+; on older Node the Cursor source is skipped gracefully).
Claude Code plugin
Then ask Claude to "update project context from my session history" — or don't ask at all: the plugin ships a SessionStart hook that runs ctxlayer check (fast, no model call) when a session begins. If enough new signals have accumulated since the last distillation, Claude gets a nudge to offer distillation at a natural pause. No new signals → complete silence.
MCP server
Exposes list_observable_projects, scan_context_signals, distill_context_proposals, distill_global_context, promote_to_global, apply_context_proposals, and find_stale_context.
The approval loop closes entirely inside chat: distill tools return each proposal with its evidence and instruct the agent to ask you which to accept; apply_context_proposals then writes exactly the titles you approved, remembers the ones you rejected (never re-proposed), and leaves the rest pending. No tool ever touches a context file without your explicit decision.
FAQ
How is this different from Claude Code's /insights?
/insights is the same core observation — instructions you repeat belong in CLAUDE.md — shipped as a personal usage report: an HTML page with suggestions you copy-paste by hand, Claude Code only. Context Autopilot is the pipeline version: it also mines Cursor history, attaches your verbatim quotes as evidence to every rule, runs an explicit approve/reject flow, writes accepted rules into managed blocks in both CLAUDE.md and AGENTS.md (so Codex/Copilot/Cursor benefit), maintains a global cross-project rules file, and adds a CI staleness check. Fully open source and local.
How is this different from Claude Code's auto-memory? Auto-memory captures what the model notices live, in the moment, in one harness. Autopilot is retroactive and systematic: it mines months of existing history across tools, and finds cross-session patterns (you said it 6× in 4 sessions) that no single live session can see.
Troubleshooting
- "Skill not found" / agent can't see the tools — MCP servers load at session start. After installing, start a new session (resumed/old sessions won't have the tools), and say "MCP tools" rather than a slash command: "Using the context-autopilot MCP tools, distill this project's context proposals."
- Everything else (evidence presentation, approval flow, error hints) is built into the server itself — the tool results tell the agent exactly what to show and when to ask you.
Privacy
Everything runs on your machine. Transcripts are parsed locally; only the extracted signals (short quotes of your own instructions) are sent to the model you already use for coding. Nothing is uploaded anywhere else, ever.
Roadmap
Coding agents are chapter one. The engine is source-agnostic — it distills observations of work into Agent Operating Procedures (AOPs):
- Now: Claude Code + Cursor sessions → CLAUDE.md / AGENTS.md; global cross-project rules (
--global); staleness detection (ctxlayer stale) - Next: team-shared context; a GitHub Action for context linting in CI
- Later: browser-workflow observation → AOPs for web tasks; ambient capture — until agents absorb the work you repeat, without you ever "building an agent"
License
MIT © The Context Layer
來源:README.md,提交 9ece859
工具
0版本歷史
1- v0.6.0最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。