56% of on-call time is triage. ErrorMentor cuts that to zero.
ErrorMentor is an open-source CLI tool that auto-diagnoses production errors by correlating error logs with recent git commits and suggesting exact fixes using Claude AI.
It's 2 AM. A production spike hits 18 errors/min. You have no idea which of the 12 recent commits caused it, or where the bug is. On-call engineers spend the majority of their time just finding the root cause. ErrorMentor automatically analyzes your log stream, finds the spike, correlates it with the exact git commit that deployed right before it, and uses AI to pinpoint the exact line of code to fix.
pip install errormentor# Analyze a log file and correlate with git history
errormentor analyze error.log --correlateErrorMentor — Production Error Analysis
──────────────────────────────────────────────────
✦ Errors analyzed 847 log lines, 3 unique error types
✦ Spike detected AuthTokenError ↑ 340% at 14:32 UTC
── Root Cause ────────────────────────────────────
Error AuthTokenError: Token expired: local_now=..., exp=...
Location auth/validators.py:147
Frequency 3.2/min → 18.7/min (spike started 14:32)
── Git Correlation ───────────────────────────────
Most likely commit:
abc1234 14:31 UTC feat: migrate auth to new token service
Author: dev@company.com
Files touched: auth/validators.py, auth/session.py
Time delta: error spike began 47 seconds after deploy
── AI Analysis ───────────────────────────────────
Root cause datetime.now() uses local time (IST) to compare
against UTC JWT exp field — all tokens appear expired
on non-UTC servers
Fix auth/validators.py line 147:
- if datetime.now().timestamp() > token_payload["exp"]:
+ if datetime.now(timezone.utc).timestamp() > token_payload["exp"]:
Also found Same pattern at auth/session.py:89
Confidence 96%
──────────────────────────────────────────────────
Apply fix automatically? [y/N]
- Parse logs: Reads JSON, logfmt, or plain text logs to find errors.
- Detect spike: Uses a sliding window algorithm to detect sudden increases in error rates.
- Correlate with git: Finds the commit deployed right before the spike started.
- Claude analysis: Packages the error context, git diffs, and source code and sends it to Claude for a definitive diagnosis and fix.
| Format | Support |
|---|---|
| JSON | ✅ |
| Logfmt | ✅ |
| Plain Text | ✅ |
| Datadog | 🔜 |
- RootCause: For failing tests (dev time).
- ErrorMentor: For production errors (on-call time). Both use the same AI-powered approach to find exactly what went wrong and how to fix it.
You can use ErrorMentor as a post-deploy health check in CI:
errormentor analyze --file staging.log --since "1h"ErrorMentor reads ANTHROPIC_API_KEY from your environment. You can also configure it via ~/.errormentor/config.toml.
This tool is part of a suite of open-source AI-powered developer tools built by the same team:
| Tool | What it does |
|---|---|
| RootCause | Auto-diagnose failing tests — AI root cause + fix |
| ErrorMentor | Auto-diagnose production errors — correlate logs with git commits |
| TestGap | Find untested code paths after every commit |
| HalluCheck | Catch AI hallucinations in code diffs |
| IntentDiff | Understand what a diff actually does semantically |
| DepSecure | Block vulnerable dependencies at commit time |
| ArchGuard | Enforce microservice architecture rules across repos |
| SpendSentry | Monitor cloud spend in real time — alert before costs spiral |
| ContextKit | Build minimal AI context bundles — 88% fewer tokens |
MIT License. Issues and PRs welcome!