The wash-sale rule is the line between competent tax-loss harvesting and self-inflicted damage.
If you get it wrong, the IRS disallows the loss. That means you traded, took the friction, and did not get the tax benefit you thought you were getting.
If you get it right, it becomes a scheduling and replacement problem. Serious software can handle that. But the rule is worth understanding because it shapes nearly every TLH decision.
The rule in plain English
If you sell a security at a loss and buy the same or substantially identical security inside the 30-day window before or after that sale, the loss is disallowed.
That means the danger window is really 61 days:
- 30 days before the sale
- the day of the sale
- 30 days after the sale
That is why wash-sale awareness has to look both backward and forward. A purchase you already made can ruin the harvest just as easily as a purchase you make after the sale.
What disallowed actually means
The loss does not simply disappear in every case. In a taxable account, it is generally added to the basis of the replacement shares. So the benefit is delayed rather than immediately recognized.
That sounds less bad than it feels. In practice, the point of harvesting is to improve taxes now or to build a usable loss bank. A delayed benefit is still a broken workflow.
The phrase that makes this messy
The IRS uses the term substantially identical, not a bright-line list. That is why this topic keeps confusing investors.
The operational lesson is simple: do not play games with near-clones unless your system is intentionally designed to handle them conservatively.
Good TLH software should assume caution where the line is fuzzy, especially with index funds and close substitutes.
The real-world traps
1. Dividend reinvestment
You sell a position at a loss, feel clever, and then your DRIP automatically buys a few shares back inside the window. Congratulations, you created a wash sale without touching the keyboard.
2. Spouse and household accounts
The rule is not just about one login. A spouse account can create the problem. In some cases, an IRA can make the result even worse because the loss benefit may not be recoverable the way it is in taxable accounts.
3. Partial re-entry
You sell 200 shares, then buy back 50 because you think the stock bottomed. The wash-sale treatment follows the replacement shares. This is one of the easiest ways to quietly break a harvest.
The right way to work around it
The legitimate tax-aware workflow is straightforward:
- Sell the losing position.
- Buy a replacement with similar economic exposure but not the same security.
- Hold through the window.
- Only return to the original if the timing and replacement logic still make sense.
That is the core reason replacement quality matters so much. A harvest is only useful if the portfolio stays in roughly the right place while the clock runs.
Why this matters for HarvestEngine
Wash-sale awareness is not a nice extra. It is table stakes.
That means the system has to think across:
- tax lots
- replacement candidates
- household accounts
- pending buys and recent buys
- portfolio exposure after the swap
That is exactly why HarvestEngine is being built as a portfolio system instead of a one-screen tax gadget.
The investor takeaway
If you are harvesting by hand, the wash-sale rule is the easiest place to make a mistake you do not notice until tax season.
If you are using software, this is one of the first things you should demand competence on. The product should not just show you a red number and say "sell." It should know what else you own, what you recently bought, and what replacement keeps the portfolio clean.
Read this next with TLH 101, the IRS code cheat sheet, and the three sleeves.