
Afterpaths
io.github.burnssa由 GitHub 帳號 burnssa 發布v0.2.5更新於 Oct 25, 2026
Session memory for AI coding agents. Search past sessions, extract rules, and track what works.
概覽
本機 MCP 伺服器,讓 AI 程式設計助理存取過往程式設計工作階段歷史:列出、讀取、搜尋與摘要工作階段,並擷取可重複使用的規則。
- 可以做什麼
- 列出 Claude Code、Cursor 與 Codex 的近期工作階段以恢復上下文,讀取工作階段摘要或原始紀錄,並檢視附來源資訊的檔案寫入/編輯清單。跨過往工作階段搜尋,摘要無結果時自動升級至原始紀錄。產生工作階段的 LLM 摘要,並取得擷取出的規則,涵蓋死路、決策、陷阱與模式。
- 適用情境
- 適合同時使用多個 AI 程式設計工具、希望助理回想早前工作階段、避免重複已知死路,或把專案規則帶入新工作階段的開發者。適合想把工作階段歷史與提煉經驗當成原生工具而非獨立命令列使用的人。
- 執行需求
- 以 Python 套件形式透過 stdio 在本機執行(uvx 或 pip,需 mcp 附加元件)。摘要功能需要 ANTHROPIC_API_KEY 或 OPENAI_API_KEY;搜尋、列表、檢視與規則工具無需金鑰。從本機 Claude Code、Cursor 與 Codex 儲存區讀取工作階段資料。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Afterpaths,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Afterpaths
Smarter with every session, automatically.
Extract rules from what worked. Track what didn't. Find the best models for your stack.
You're running Claude Code, Cursor and Codex, but which model actually works best for your stack? What approaches lead to breakthroughs vs. expensive dead ends? How do you stop your agents from making the same mistakes?
Afterpaths gives you a single view across all your AI coding tools: compare what's working, capture discoveries as rules, and guide your agent team away from costly diversions.
What you're seeing:
ap audit— Overview of your sessions, models used, and rule statusap show 5 --raw— Raw session transcript (the messy JSONL data, made readable)ap show 5— LLM-generated summary extracting discoveries, dead ends, and decisionshead .claude/rules/gotchas.md— Rules automatically extracted and ready for Claude's next session
The Problem
You're managing multiple agents - retaining critical context and learning from sessions is painful:
- Repeated mistakes — Your agents hit the same gotchas. Three weeks later, same dead end, same wasted tokens.
- No cross-tool visibility — Is Opus actually better than Sonnet for your codebase? Is Cursor outperforming Claude Code? You're guessing.
- Rules are tedious — After a costly diversion, the last thing you want is to write a CLAUDE.md rule. So you don't. And the knowledge evaporates.
- Sessions vanish — Session content is obscurely logged and hard to extract. Then it's often auto-deleted after 30 days. That breakthrough architecture decision? Context gone.
Afterpaths captures sessions across tools, surfaces what's working, and generates rules automatically—so your agents learn from every session, and you retain all your rich session context.
How It Works
Quick Start
The audit shows your sessions across all tools, model performance, and whether you have rules set up. No API key needed.
From there, the recommended flow:
Tip:
apis the short alias forafterpaths. Both work identically.
All commands support --json for structured output (e.g., ap log --json, ap show 1 --json, ap search "query" --json).
See docs/commands.md for the full command reference and recipes.
From Session to Rules
Real example: A bug causing 76 missing sessions became a rule that prevents the same mistake.
While building afterpaths, sessions for a project weren't showing up. The path (let's call it) /Users/Code/foo_bar was being decoded as /Users/Code/foo/bar. After investigation, we discovered Claude Code uses lossy path encoding—both / and _ become -.
The summary captured the discovery:
ap rules extracted it into .claude/rules/gotchas.md:
Next time Claude works on path decoding in this codebase, it already knows about the lossy encoding—no need to rediscover it.
Why Afterpaths
What Gets Extracted
Each rule includes source session references so you can trace back to the original context.
Supported Tools
Known Limitations
Cursor sessions: the adapter reads several known chat/composer formats from
state.vscdb (including workbench.panel.aichat.view.aichat.chatdata,
composer.composerData, and allComposers), but Cursor changes its storage
schema often and some sessions will return Entries: 0 even when the
state.vscdb file is present. When this happens, ap show <ref> --raw and the
afterpaths_show_session MCP tool emit a warning rather than silently
returning empty. The raw file is untouched — if you need that session, opening
state.vscdb directly with sqlite3 will still work.
Tool provenance features (ap show --artifacts, commit tracing, file
activity) only cover sessions whose entries the adapter can read.
MCP Server
Afterpaths includes an MCP server that puts session history directly into your agent's tool list. Instead of relying on agents to discover the CLI, the MCP server makes session search, summaries, and rules available as native tools.
Tools exposed:
Once configured, agents can ask "have we seen this before?" or "what were the dead ends?" and get answers from your session history.
Privacy
- All local — Summaries and rules stay in your project
- Your API key — Uses your Anthropic/OpenAI key
- Read-only — Never modifies your source code
- Gitignored —
.afterpaths/excluded by default
Storage
Hand-edited notes in rule files
Each rule file is split into a manual section (preserved across ap rules runs) and an auto section (regenerated each run):
Put hand-curated rules or project-specific reminders between the manual:start / manual:end markers — they'll survive every ap rules run. Content outside those markers (and outside the recognized boilerplate) blocks the run as a safety check. Pass --force to overwrite anyway, or wrap the content in manual markers to preserve it.
If you're upgrading from an earlier version and your rule files contain only auto-generated content, markers are inserted automatically on the next ap rules run with an empty manual section — no action required.
Roadmap
- Claude Code session parsing
- Cursor session support
- Session analytics (tokens, errors, daily trends)
- LLM summarization
- Automatic rule extraction
- Multi-target export (Claude, Cursor)
- Codex CLI support
- Cross-session search (
ap search) - JSON output (
--jsonflag) - MCP server for agent integration
- Semantic search across sessions
- Benchmarking and productivity insights
License
MIT
Manage your AI coding agents. Learn what works. Stop repeating mistakes.
來源:README.md,提交 1bdd717
工具
0版本歷史
1- v0.2.5最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。