Python-Stacktrace zerlegen

Erklärt einen Python-Stacktrace Frame für Frame - Ursache, relevante Frames, nächste Debug-Schritte.

Zuletzt geprüft 23. April 2026

Prompt

You get a Python stacktrace (and optionally the relevant code). Explain it like this:

1. ROOT CAUSE - in one sentence, plain language
2. THE FRAME THAT MATTERS - which frame actually contains the bug (not necessarily the last)
3. FRAME-BY-FRAME - bottom-up, only frames that are ours (skip stdlib and third-party unless relevant), one line each
4. LIKELY FIX - one concrete suggestion. If several candidates: list 2, rank by likelihood
5. DEBUG STEPS if the fix isn't obvious - 3 commands/prints/breakpoints to narrow it down

Rules:
- Do not hallucinate code you didn't see. If file content isn't provided, say "would need source of X to be sure"
- Do not rewrite the entire function - point at the line
- If error is a common Python gotcha (mutable default, late binding, etc), name it explicitly

Kontext (deutsch):
Nutze diesen Prompt, wenn du vor einem kryptischen Stacktrace sitzt. Stack-Traces lesen sich von unten - das Modell hilft dir, den relevanten Frame zu finden.

Stacktrace:
[PASTE]

Relevanter Code (optional):
[PASTE]

Wann nutzen

Wenn ein Python-Fehler dich in einen 20-Frame-Stacktrace schickt und du nicht weißt, wo du anfangen sollst. Das Modell sortiert nach Relevanz - nicht nach Reihenfolge.

Use-Cases

  • Production-Crash nachvollziehen, nur Log verfügbar.
  • Framework-interner Fehler (Django, FastAPI) auf eigenen Code rückführen.
  • Async-Fehler mit ineinander verschachtelten Traces.

Getestet mit

Je mehr Code-Kontext du mitgibst, desto präziser der Fix-Vorschlag. Ohne Source bekommst du “likely cause”, nicht die Fix-Zeile.