Smarter with every session, automatically
Project description
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.
The Problem
You're managing a team of AI coding agents, but flying blind:
- 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
Your Sessions Afterpaths
─────────────── ────────────────────────────────────
Claude Code ──► ap log ──► Browse sessions across IDEs
Cursor ap stats ──► Analytics: tokens, activity, errors
Codex ap summarize──► Session summaries (what happened)
ap rules ──► Rule files (what to remember)
│
▼
.claude/rules/ · .cursor/rules/
│
▼
Your next session is smarter
Quick Start
pip install afterpaths
export ANTHROPIC_API_KEY="sk-ant-..."
# See your recent sessions (Claude Code + Cursor)
ap log
# Get analytics: tokens, sessions, rejection rates
ap stats
ap stats --daily
# Summarize a session (captures discoveries, dead ends, decisions)
ap summarize 1
# Extract rules from summaries → .claude/rules/
ap rules
Tip:
apis the short alias forafterpaths. Both work identically.
See docs/commands.md for the full command reference and recipes.
From Session to Rules
A 2-day auth outage becomes a rule that prevents the next one:
# Dead Ends: What Not to Try
- **Restrictive Auth0 callback detection**: Don't require both 'code' AND
'state' URL parameters—Auth0 sometimes omits 'state'. This exact pattern
caused a 2-day production outage. Use `urlParams.has('code')` alone.
_Source: session 8a3f2c91_
- **Silent callback error handling**: Don't catch Auth0 callback errors and
redirect to home. Users end up in login loops. Implement error-specific
recovery logic instead.
_Source: session 8a3f2c91_
Claude Code automatically loads all .md files from .claude/rules/ into context. Next time you're working on auth, Claude already knows what not to try.
Why Afterpaths
| 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/ |
What Gets Extracted
| 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.
Supported Tools
| Tool | Status | Location |
|---|---|---|
| Claude Code | ✅ Ready | ~/.claude/projects/*.jsonl |
| Cursor | ✅ Ready | ~/Library/Application Support/Cursor/User/workspaceStorage/ |
| Codex CLI | ✅ Ready | ~/.codex/ |
The Vault (Coming Soon)
Share and discover rule sets from the community:
# Install community rules for your stack
afterpaths vault install fastapi-production
# Share your learnings
afterpaths rules publish
Popular rule sets surface through community upvotes. Your hard-won discoveries help others avoid the same pitfalls.
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 - Optional sharing — Vault publishing is explicit opt-in
Storage
your-project/
├── .afterpaths/ # Summaries (gitignored)
│ ├── summaries/
│ └── meta.json
├── .claude/
│ └── rules/ # Generated rules (commit these!)
│ ├── dead-ends.md
│ ├── gotchas.md
│ └── patterns.md
└── src/
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
- Rule Vault (community rule sharing)
- Semantic search across sessions
- Benchmarking and productivity insights
License
MIT
Manage your AI coding agents. Learn what works. Stop repeating mistakes.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file afterpaths-0.1.1.tar.gz.
File metadata
- Download URL: afterpaths-0.1.1.tar.gz
- Upload date:
- Size: 72.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5b012518d21f2537970c5d6cd7997f42025159a7a6db9ebeea276108eecff4e
|
|
| MD5 |
8355f7b53c8d8b21b7c763a50dc3810a
|
|
| BLAKE2b-256 |
95f76d2088a260d0d9153007179909b954b6139cae00512733eee741f06f25e3
|
File details
Details for the file afterpaths-0.1.1-py3-none-any.whl.
File metadata
- Download URL: afterpaths-0.1.1-py3-none-any.whl
- Upload date:
- Size: 69.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26a7b3ae8db3afc302b621bacbb64e82c2bed49a9b71d70d7e4c70754bfa5990
|
|
| MD5 |
0b9bddaf7bb79559522deef2e291de56
|
|
| BLAKE2b-256 |
35f03bf79846f59d0a9715002341f23cbf7d0da7ff5a31c54506feb6844cfe60
|