About
## The problem it solves
## The problem
Beginners hit a Python error, paste the traceback into an AI chat, copy the suggested fix, and hope it works. This goes wrong in three ways:
- **The fix is never checked.** The AI sounds confident, but it can be wrong, and you only find out after pasting it.
- **Nothing is learned.** The error goes away, and the same mistake comes back next week.
- **The AI guesses.** It only sees the text you paste, not what your code actually does when it runs.
## How Explain My Error solves it
You paste your Python code. The tool:
- **Reproduces** the error by running your code in a sandbox
- **Finds the cause** by parsing the traceback and classifying the error with rule-based logic
- **Explains it in plain English**, with the LLM used only for the explanation and the fix
- **Verifies the fix** by running it, and retries once if it fails
- **Tracks your mistake patterns**, for example "3 KeyErrors this session", so you learn what to stop doing
## Who it helps
- **Beginners and students** who need to understand errors instead of copy-pasting fixes
- **Self-learners** who want to see which mistakes they repeat
- **Anyone** who wants proof that a suggested fix actually runs
**Copilot fixes your error. Explain My Error proves the fix works and helps you stop repeating the mistake.**
*Limits: Python only, strongest on common error types. "Verified" means the fixed code runs without errors, not that the logic matches your intent.*
## Challenges we ran into
## 1. Not building "just another ChatGPT wrapper" My first idea was to send an error to an LLM and show its answer. That's what Copilot and ChatGPT already do. I redesigned it as a pipeline where my own code does most of the work (reproducing, parsing, classifying and verifying) and the LLM only writes the explanation.
## 2. Parsing real Python tracebacks
Python 3.11+ adds `~~~^^^` marker lines under the failing code, which a simple parser mistakes for code. Chained exceptions ("During handling of the above exception...") also hide the real error. I wrote a parser that skips the markers, keeps only the final traceback, handles `SyntaxError` (which has no function name), and strips dotted names like `requests.exceptions.ConnectionError`. I tested it against each case.
## 3. Running untrusted code safely
Reproducing an error means running a stranger's code. I had to handle infinite loops, memory bombs, output floods and `input()` hanging forever. The sandbox runs code in a subprocess with a timeout (killing the whole process group), memory and file-size limits, a capped output size, and a clean environment so my API key isn't passed to it. It's a demo sandbox, not production-grade security, and I say so in the README.
## 4. Unreliable LLM output
The model sometimes wraps JSON in code fences or adds chatty text around it. I added tolerant parsing, validation of every required field, and a fallback so a bad reply returns a clear message instead of crashing the app.
## 5. Fixes that don't actually fix
An AI fix can be wrong, or identical to the original code. The verifier runs the fixed code, rejects empty or unchanged "fixes", and retries once, feeding the new error back to the model. If it still fails, the app says "could not verify" instead of claiming success.
## 6. Hosting on free tiers
Free hosting sleeps (Render after 15 minutes, Streamlit after 12 hours), Vercel can't host Streamlit, and one platform's signups were unavailable. I split the app into a FastAPI backend and a Streamlit frontend on separate free hosts, added a `/health` endpoint for keep-alive pings, and wrote a wake-up note in the README.
## 7. A 23-hour deadline
I cut the scope to Python only, five core error types, and in-session history, so I could finish a working, verified pipeline instead of a bigger unfinished one.
Screenshots
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.









