The wash sale rule

What it is: if you sell something at a loss and buy the same or a 'substantially identical' security within 30 days, you cannot claim that loss on your taxes.
The part most people get wrong: it is not a 30-day window, it is 61 days — 30 before the sale, the day itself, and 30 after. Buying *before* you sell triggers it just as easily.
Things that catch people out:
• It applies across ALL your accounts, including your IRA — and a loss washed into an IRA is lost permanently
• A spouse's account can trigger it
• Automatic dividend reinvestment counts as a purchase
• Options on the same underlying can count
The disallowed loss is not destroyed — it is added to the cost basis of the replacement shares, so you get it back eventually.
Chart: the full window.