Don't track defects on a list, find them and fix them -- Mary Poppendieck
Indeed, If inventory is waste, what about an inventory of defects...
That's why I always try to implement a Stop-the-Line mentality with test-driven development and continuous integration, so that we find and fix most defects instead of putting them on a rework list.
And when defects pass through, we fix them before writing new code (stories with bugs aren't done anyway). Then, we try to fix our process to make it more mistake-proof and detect defects the moment they occur.