Listed from the MCP registry; nobody on Odel publishes it.
Retrieves GitHub PR history as context material; the connected IDE agent does the reasoning.
Runs on your machine from its package; the steps are below.
At most: only reads or looks up information.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally
This server runs on your machine over stdio, but its source registry didn't list a distribution package. Check the source repository for setup instructions.
Your AI coding assistant learns from your team's past code reviews — and stops repeating the same mistakes.
Reviewers keep catching the same things: "add a timeout here", "don't block the event loop", "call this once, not in a loop". Your AI assistant never read those reviews, so it makes the same mistakes again.
Pitfall reads your repository's pull-request history, turns real reviewer feedback into short rules with evidence, and gives your assistant the right ones before it writes code. When a known mistake happens again, it tells you.
flowchart LR
A["Past PRs and CI<br/>reviews, reverts, fixes"] --> B["Learn<br/>AI notes what reviewers caught"]
B --> C["Check<br/>a second pass verifies each rule"]
C --> D["Rules<br/>scored, with PR links"]
D --> E["Before coding<br/>only the relevant rules"]
E --> G["Before finishing<br/>AI re-checks its own change"]
D --> F["Repeat detected<br/>alert: 'this kind of mistake happened again'"]
Learn from history. Your assistant reads closed PRs (oldest first) through GitHub's official MCP and notes what reviewers caught: reverts, follow-up fixes, and change requests the author actually fixed. CI failures that a later commit fixed count too.
Check before it counts. A fresh second pass verifies every proposed rule against the exact reviewer quote. Nothing is used until it is approved.
Keep only real patterns. The code — not the AI — decides what becomes a rule:
| Level | When | Shown to the assistant? |
|---|---|---|
| Candidate | seen once | no |
| Rule | seen in 2 different PRs, or reverted once | yes |
| Must not repeat | the same kind of mistake happened again after it became a rule | yes, first — and you get an alert |
| Archived | no new evidence for a year | no |
Plain opinions, self-reviews and bot comments are ignored. Rules raised by only one reviewer are marked as reviewer preference.
Use the right rules. Before coding, the assistant names the kinds of mistake its change involves and asks for the rules about its files and those kinds — at most 8, strongest first, each with a link to the PR it came from.
Check before finishing. After writing code, the assistant re-reads its own change against those rules, fixes what it finds and tells you, e.g. "Checked 5 rules, fixed 1 (missing timeout)."
Keep learning. New PRs are processed the same way. If a known kind of mistake shows up again, the rule gets stronger and you see: "This type of mistake happened again (lesson L3, PR #57) — you may want to look at it."
Same kind of mistake, not just the same one. Every rule has a general principle ("every outbound call needs a timeout") next to the specific case it came from, and belongs to one mistake family from a small fixed list (such as missing-timeout or resource-leak). So a missing timeout on a database call counts as the same kind of mistake as one on an HTTP call, even in another folder, and the rule is shown for both. See how it works.
1. Connect GitHub's official MCP in your AI client (setup guide). Read-only access is enough.
2. Install Pitfall and add it to the same client:
pipx install git+https://github.com/paarths-collab/pitfall
{
"mcpServers": {
"pitfall": { "command": "pitfall-mcp" }
}
}
3. Teach it your repo. Run the prompt learn_from_prs with repo: owner/name. Repeat until it says it is caught up (or schedule it daily). For a big backlog, learn_history_parallel splits old PRs across helper agents. Run learn_from_ci to also learn from CI failures that a later commit fixed.
4. Code as usual. Before a change, run check_lessons_before_change — or let your agent follow the skill. It tells you which rules it applied, and self_check_before_finishing has it re-check its own diff against them before handing over.
pitfall-mcp lessons --repo owner/name # all rules, readable
pitfall-mcp lessons --repo owner/name --alerts # repeated mistakes
pitfall-mcp lessons --repo owner/name --export CLAUDE.md
--export writes your rules into CLAUDE.md or AGENTS.md (inside its own marked section, nothing else is touched), so every AI tool sees them.
Rules are stored locally in ~/.github-pr-context/lessons/ — nothing leaves your machine except what your AI client already sends.
pitfall-indexed (install with the indexed extra)python -m pip install '.[test,indexed]'
python -m pytest
Pitfall was previously called GitHub PR Context. The old commands (github-pr-context-mcp, github-pr-context-indexed) still work, and old links redirect here.
MIT licensed.