Tau
AI prompt · about 60 seconds

Go from error message to fix, fast

Ranked likely causes and a quick test for each, instead of guess-and-check.

What most people type

why doesnt my code work

Short prompts like this get generic answers, because the AI has to guess who you are and what you need.

A better prompt

Act as a senior engineer pairing with me on a bug. Stack: [LANGUAGE AND FRAMEWORK]. Error and stack trace: [THE ERROR MESSAGE]. Relevant code: [THE CODE THAT FAILS]. What changed recently: [WHAT CHANGED RECENTLY]. Remove secrets, keys, internal URLs and customer data before pasting. Give me: 1) the 3 most likely causes, ranked, each with a one-line reason, 2) a quick check to confirm or rule out each, 3) a minimal fix for the top cause as a code diff, 4) one test that would catch this in future. Be concise. Don't rewrite unrelated code. End by asking me one question that would make this more useful.

Fill in the blanks

Swap each highlighted part for your own details. Here’s an example.

  • [LANGUAGE AND FRAMEWORK]
    TypeScript, React 18
  • [THE ERROR MESSAGE]
    TypeError: Cannot read properties of undefined (reading 'map') at OrderList (OrderList.tsx:14)
  • [THE CODE THAT FAILS]
    const { data } = useOrders(); return <ul>{data.orders.map(o => <li key={o.id}>{o.total}</li>)}</ul>
  • [WHAT CHANGED RECENTLY]
    the orders API was updated yesterday

What a good answer looks like

Likely causes: 1. The API response shape changed, so data.orders is undefined (renamed, e.g. to data.items?). Fits 'API updated yesterday'. 2. First render before the fetch resolves. 3. The request fails and the hook returns an empty object. Quick checks: 1. console.log(data) vs the new API docs 2. Does it fail only on first load? 3. Network tab: any non-200 status? Minimal fix: - {data.orders.map(...)} + {(data?.orders ?? []).map(...)} This stops the crash; if cause 1 is right, update the field name too. Test: render OrderList with no orders field and assert an empty state. Question: what does console.log(data) show?

This is a sample answer for the example above. Yours will be different, so check it against your own facts.

Make it even better

Paste the exact error text, never a paraphrase. Small wording details often point straight to the cause.

Stay safe

Learn the skill behind it

This prompt comes from the course AI for software engineers. The next lesson to watch is “Debug a production error with AI”.

Try this in Tau

In Tau, you can fill in the blanks, run the prompt and get feedback, then watch the one-minute lesson that explains why it works. Join the waitlist for early access.