Engineering Stack Trace Debugging

Stack Trace Analysis Prompt

Read the trace bottom-up, find the frame where the bad value entered, and name what made it bad — the trace is a map, not an answer.

Overview

A stack trace shows the path to the crash — and teams still patch the top frame and move on. This setup analyzes a Python AttributeError from an import job: the trace says .strip() failed on a float at normalize.py line 31, but the investigation asks the real questions — where did a float enter a path that expects strings? which upstream frame stopped enforcing the contract? — tracing the execution path backward and treating the throw frame as the start of the investigation, not the end.

Workflow

  1. Paste the whole trace

    Every frame matters — the detector recognizes it, and the analysis walks it bottom-up.

  2. Find the entry frame

    The investigation's pivot: the boundary where the bad value entered the failing path.

  3. Fix at the contract, not the crash

    The repair belongs where the contract broke — usually frames above the throw, sometimes in the data itself.

Why This Works

  • Bottom-up reading turns the trace from a blame pointer into an evidence chain
  • Entry-frame hunting localizes the bug to where it is fixable once
  • Contract framing decides the eternal question: fix the caller or the callee

Best for

  • Crashes deep in utility code that "never changed"
  • Type errors that surface far from their source
  • Import/ETL jobs that die mid-file

Not for

  • Traces from intermittent failures — the intermittent strategy's pattern hunt comes first
  • Minified production JS traces — source-map them before investigating

Use cases

  • Working a traceback to the frame where the bad value entered
  • Finding the implicit contract the crashing code assumed
  • Deciding between fixing the data, the caller, or the callee

Tip: Save time by exploring related resources and tools that integrate with this workflow.

Explore all resources