A wash sale is one idea: if you sell at a loss but the same shares come back within 30 days — before or after — you never really left, so that part of the loss waits inside the new shares' basis. An RSU vest counts as shares coming back, even though you never placed an order. Build your story as a strip of events below — vest-then-sell and sell-then-vest are just the order the cards sit in.
0 shares, bought earlier.
—
No loss in this story.
Nothing is held back.
No shares were matched, so no basis changes.
—
This story's allowed losses drop into the short-term or long-term bucket of the sale that made them. Each bucket nets inside itself first; then the two buckets meet.
Bucket total before the buckets meet.
Bucket total before the buckets meet.
After the two buckets cross-net.
No net loss this year, so nothing carries forward.
An open-market buy, an ESPP purchase, or dividend reinvestment does exactly the same thing as an RSU vest. The rule cares that shares came back, not how — that's why one "+ Shares in" card covers all of them.
The window is two-sided — 30 days before, the sale day, 30 days after — so a vest three weeks before a loss sale washes it just as surely as one three weeks after. Add a Shares-in card dated before a Sell card and watch.
Each loss sale is matched against every Shares-in card within its window, in the order those shares arrived, share for share, capped at the shares sold — and a card's shares can only be used as replacements once. The matched card shows its own bumped basis, so you can see which acquisition absorbed which sale's loss.
The wash caps at the shares sold. Sell 200 and 250 come back, and only the first 200 matched shares get the basis bump; the extra 50 keep their plain price as basis.
Flip "Inside an IRA" on a Shares-in card and the loss it matches is gone for good instead of postponed — an IRA has no basis to hold it, so that card gets no basis bump.
Each Sell card's "held over a year" toggle decides which bucket its allowed loss lands in. Short-term losses meet short-term gains first, inside their own bucket; only what's left over crosses to the other bucket. A washed loss skips this year entirely — it is not a carryforward; it waits in basis.
The 1099-B wash adjustment only tracks activity in the same account at the same firm. RSUs usually vest at a different firm from where you sell. The wash still applies legally — adjusting it on your return is on you.