Summarize and search coding sessions, extract rules from discoveries, benchmark coding agents.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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 sessionYou're managing multiple agents - retaining critical context and learning from sessions is painful:
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.
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.
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.
| Without | With Afterpaths |
|---|---|
| Discover gotcha, forget to document it | ap summarize captures it with full context |
| Hit the same issue 3 weeks later | Rule in .claude/rules/ prevents it |
| No idea what's working | ap stats shows tokens, sessions, error rates |
| Sessions scattered across IDEs | ap log unified view across Claude + Cursor |
| Learnings siloed per tool | Rules sync to .claude/rules/ and .cursor/rules/ |
| Category | What it captures | Example |
|---|---|---|
| Dead Ends | Approaches that failed | "Don't use X because Y" |
| Decisions | Architectural choices | "We chose Redis over Postgres because..." |
| Gotchas | Non-obvious warnings | "Watch out for X when doing Y" |
| Patterns | Techniques that worked | "For X, use pattern Y" |
Each rule includes source session references so you can trace back to the original context.
| Tool | Status | Location |
|---|---|---|
| Claude Code | β Ready | ~/.claude/projects/*.jsonl |
| Cursor | β οΈ Partial | ~/Library/Application Support/Cursor/User/workspaceStorage/ |
| Codex CLI | β Ready | ~/.codex/ |
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.
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:
| Tool | Description |
|---|---|
afterpaths_list_sessions | List recent sessions for context recovery |
afterpaths_show_session | Read session summaries and transcripts |
afterpaths_show_artifacts | Show artifacts ledger: files written/edited with provenance |
afterpaths_summarize | Generate summaries for sessions |
afterpaths_search | Search across past sessions (auto-escalates to transcripts on 0 summary hits) |
afterpaths_get_rules | Get extracted rules (dead ends, decisions, etc.) |
Once configured, agents can ask "have we seen this before?" or "what were the dead ends?" and get answers from your session history.
.afterpaths/ excluded by defaultEach 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.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/afterpaths)<a href="https://allmcps.com/mcp/afterpaths"><img src="https://allmcps.com/api/badge/afterpaths?style=directory" alt="Afterpaths on AllMCPs" /></a>