As we approach the end of 2026, I’m staring at a portfolio that’s down about 12% for the year. Not fun—but I keep hearing that this is actually an opportunity for tax-loss harvesting (TLH). The idea sounds simple: sell losers, use those losses to offset my capital gains, save on taxes. Easy, right?
Except it’s not.
The more I dig into this, the more I realize the wash sale rule turns tax-loss harvesting into a 61-day minefield. Sell a stock at a loss and accidentally buy it back within 30 days (or bought it 30 days before the sale)? Boom—loss disallowed. And here’s the kicker: the rule applies across all my accounts, including my IRA, and even my spouse’s accounts.
The Manual Tracking Nightmare
I have accounts at three different brokerages: Vanguard for retirement, Fidelity for taxable, and Robinhood for… well, the less we say about my meme stock phase, the better. Each broker only tracks wash sales within their own accounts for the same CUSIP. That means I’m responsible for tracking potential wash sales across all of them.
Spreadsheets? Tried it. Within a week I was drowning in tabs, formulas, and purchase date tracking. I missed a cross-account wash sale and only caught it when preparing my taxes. Not good.
Why Beancount Might Be the Answer
This is where I think Beancount’s strength really shines: aggregate view of all investments in one unified ledger. I can query across every brokerage account, track cost basis with STRICT booking, and—theoretically—identify wash sale risks before they happen.
I’ve heard about the fava_investor tlh module that can help automate this, and Red Street’s tax loss harvester plugin looks promising. But I’m still figuring out the practical workflow.
Questions for the Community
Here’s where I need your wisdom:
-
Has anyone successfully automated wash sale tracking with Beancount? What’s your workflow?
-
How do you structure your accounts to monitor the 61-day window? Do you use metadata to tag purchase dates? Custom queries?
-
What’s the best practice for STRICT booking with cost basis? I understand the concept but not the implementation details for tax-loss harvesting specifically.
-
How do you handle “substantially identical” securities? Like, if I sell VOO (Vanguard S&P 500 ETF), is buying SPY (SPDR S&P 500 ETF) within 30 days a wash sale? They track the same index but are different securities.
-
Any BQL query examples for identifying TLH opportunities? I’d love to see working code I can adapt.
I know this is a complex topic, but if we can crack the code on Beancount-based TLH automation, it could be a game-changer for anyone managing their own investments in plain text.
Looking forward to your insights—especially if you’ve already solved this problem!
Sources for wash sale info: