What you'll take away

  • Harvesting is a constrained optimization problem, not a screen. The constraints — wash sales, lots, tracking error — are coupled, which is what makes it hard.
  • The wash-sale rule reaches further than people think, across time, across accounts, and across "substantially identical" securities.
  • Lot-level accounting changes the answer. Which specific shares you sell is itself a decision with real after-tax consequences.

Start with the part everyone knows. When you sell a security for less than you paid, you realize a capital loss, and that loss can offset gains elsewhere — or, within limits, ordinary income — reducing the tax you owe. In a taxable account, harvested losses are a genuine, spendable benefit, which is precisely why direct indexing exists: a fund cannot pass an individual security's loss through to you, but an account that holds the securities directly can. So far, so simple. Now watch the simplicity disintegrate the moment you try to do it well, at scale, without breaking a rule.

The wash-sale rule is bigger than it looks

The wash-sale rule, codified in §1091 of the U.S. tax code and explained in IRS Publication 550, says that if you sell a security at a loss and buy the same or a "substantially identical" security within thirty days before or after the sale, the loss is disallowed for that transaction — instead, it is added to the basis of the replacement shares. The intent is to stop investors from booking a loss while staying economically invested. The effect, for anyone trying to harvest systematically, is a minefield.

Read that window again: thirty days before or after. That is a sixty-one-day envelope around every sale, and it interacts with every other thing happening in the account. A dividend reinvestment can trigger it. A scheduled contribution can trigger it. A purchase in a completely different account — including, under the rule's reach, an IRA or a spouse's account — can trigger it. "Substantially identical" is its own thicket: two S&P 500 funds may be substantially identical; two different small-cap value strategies may or may not be, and reasonable people argue about it. The harvest you booked in March can be quietly undone by a buy you did not think about in April.

Figure 1 — The 61-day wash-sale envelope around a harvest

loss sale −30 days +30 days any "substantially identical" buy in here disallows the loss

And the envelope spans accounts — including IRAs and a spouse's accounts — which is why harvesting has to be reasoned about at the household level, not the account level.

Lots are decisions, not bookkeeping

The second layer of difficulty is lot-level accounting. When you have bought the same security at different times and prices, you hold multiple "tax lots," each with its own cost basis and holding period. When you sell, which lots you sell is a choice, and it is a consequential one. Selling the highest-cost lots first maximizes the realized loss now; selling lots with long-term holding periods changes whether gains are taxed at the favorable long-term rate; the order you choose ripples into next year's position. Specific-identification lot selection — deliberately choosing which shares to sell rather than defaulting to first-in-first-out — is one of the most underappreciated levers in after-tax investing, and it multiplies the size of the decision space.

Put the two layers together and the shape of the real problem comes into focus. You are not running a screen that flags losers. You are solving a constrained optimization: maximize after-tax value, subject to staying close to the benchmark (tracking error), subject to the wash-sale envelope across the household and across time, subject to lot-level holding-period rules, subject to turnover and trading-cost limits, subject to whatever the client has asked you not to own. These constraints are coupled — moving one moves the others — which is exactly the property that makes a problem hard rather than merely tedious.

61
Days in the wash-sale envelope around every loss sale
Household
The scope the rule actually applies to — not just the account
Coupled
Constraints interact, so harvesting can't be solved one rule at a time

Why "just harvest the losers" leaves money on the table

The naive approach — periodically sell whatever is down and buy a placeholder — captures some benefit, and for a small account it may be good enough. But it is structurally leaky. It harvests losses that the wash-sale rule will later disallow. It ignores lot selection, leaving long-term-versus-short-term value uncaptured. It drifts the portfolio away from the benchmark in ways a tracking-error constraint would have prevented. And it cannot reason about the household, so it triggers disallowances across accounts it never looked at. Each leak is small; in aggregate, across a book, across a year, they are the difference between a harvesting program that markets well and one that actually delivers the after-tax dollars it promised.

Doing it properly means treating harvesting as the optimization problem it is, and solving that problem fast enough and at enough scale to do it across every account, repeatedly, as the wash-sale clocks tick and the lots age. That is the unglamorous engineering reality behind the clean marketing phrase "tax-aware by design." The phrase is easy. The constraint-respecting, lot-aware, household-scoped, benchmark-tracking optimization underneath it is the hard part — and it is the part worth measuring on your own data before you believe anyone's claims about it.

Claims are cheap; measured tax dollars are not. A matched-workload pilot runs harvesting on your real lots and constraints and shows the after-tax result against your current approach — losing cases included.

Request a pilot →

References & further reading

  1. Internal Revenue Service, Publication 550, Investment Income and Expenses — wash sales and the treatment of disallowed losses.
  2. Internal Revenue Code §1091 — the statutory wash-sale rule.
  3. Internal Revenue Service, Publication 551, Basis of Assets — cost basis and lot identification.
  4. Asymmetry Computing, Tax-loss harvesting latency is a product constraint.