# Bug (/academy/bug)



A bug is a mismatch: you meant this, the software did that.

The button ignores the click. The total is off by one. The page dies on an empty email. None of that is a virus. None of it is the computer "having a moment." Somewhere an instruction is wrong, a case was never written, or two features never met — and now the product lies.

The job is not writing code with zero bugs. That is not a job that exists. The job is finding the mismatch faster than it costs you the room.

**Reproduce, then hunt**

If you cannot make it happen twice, you do not have a bug yet. You have a ghost story. Click the same path. Read the [log](/academy/log). If it crashed, read the [stack trace](/academy/stack-trace). Then write a [test](/academy/test) that fails on purpose. Then a [patch](/academy/patch). That loop is the whole craft.

Agents write bugs too. They are doing the same hard thing you are: a pile of instructions meeting a real click. "That's not quite right, here's the failing case" is a better prompt than "rewrite everything."

**Name it so you can kill it**

"It's broken" is weather. "Submit on `/checkout` with an empty coupon 500s" is a ticket. Put that sentence in the [PR](/academy/pull-request). Put it in the commit. The [CLI](/academy/cli) `bun test` should say the same sentence when you are done.

At a hackathon, fix the bug the judge will hit. Leave the ugly-but-true paths alone until after the demo. That is [YAGNI](/academy/yagni) for defects.

**What this unlocks**

A bug is not a moral failing. It is a gap you can close. Reproduce it, pin it with a test, ship the small patch. Weather passes. The pin stays.
