
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 分
请在仓库或注册中心条目中声明许可证。