Tax-Loss Harvesting
What it does
This skill looks for investments with unrealized losses in taxable accounts and suggests how to use them for tax savings. It is for investors and advisors planning taxes, especially near year end.
When to use it
- ✓When year-end tax planning is coming up and you want to review losses.
- ✓When a taxable account has positions that are well below their purchase price.
- ✓When you want to avoid wash sale problems when selling and buying back.
Skill link
https://github.com/AI4Finance-Foundation/FinRobot/blob/master/finrobot_desktop/skills/wealth-management/tax-loss-harvesting/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Find the tax-loss harvesting opportunities in my taxable account before year end.”
5 new skills a week. 1 minute to read.
How it works
The agent scans taxable accounts for positions with losses, ranks them by impact, and compares them with the year's gains. It then suggests replacement holdings and tracks wash sale windows.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Tax-Loss Harvesting
description: Identify tax-loss harvesting opportunities across taxable accounts. Finds positions with unrealized losses, suggests replacement securities, and tracks wash sale windows. Triggers on "tax-loss harvesting", "TLH", "harvest losses", "tax losses", "unrealized losses", or "year-end tax planning".
Workflow
Step 1: Identify Candidates
Scan taxable accounts for positions with unrealized losses:
| Security | Asset Class | Cost Basis | Current Value | Unrealized Loss | Holding Period | % Loss |
|---|---|---|---|---|---|---|
| ST / LT |
Prioritize by:
- Largest absolute loss (biggest tax benefit)
- Short-term losses first (offset short-term gains taxed at ordinary income rates)
- Positions with the largest % loss (less likely to recover quickly)
Step 2: Gain/Loss Budget
Calculate the client's tax situation:
| Category | Amount |
|---|---|
| Realized short-term gains YTD | |
| Realized long-term gains YTD | |
| Realized losses YTD | |
| Net gain/(loss) position | |
| Carryforward losses from prior years | |
| Target harvesting amount |
Tax savings estimate:
- Short-term losses × marginal ordinary income rate
- Long-term losses × capital gains rate
- Up to $3,000 net loss deduction against ordinary income
- Excess carries forward
Step 3: Replacement Securities
For each harvest candidate, suggest a replacement that:
- Maintains similar market exposure (same asset class, sector, geography)
- Is NOT "substantially identical" (wash sale rule)
- Has similar risk/return characteristics
| Sell | Replace With | Reason | Tracking Error Risk |
|---|---|---|---|
| SPDR S&P 500 (SPY) | iShares Core S&P 500 (IVV) | Same index, different fund family | Minimal |
| Vanguard Total Intl (VXUS) | iShares MSCI ACWI ex-US (ACWX) | Similar exposure, different index | Low |
| Individual stock ABC | Sector ETF (XLK) | Broader exposure, no wash sale risk | Moderate |
Step 4: Wash Sale Check
Before executing, verify no wash sales:
- Check ALL accounts in the household (taxable, IRA, Roth, spouse accounts)
- 30-day lookback: Did we buy substantially identical securities in the last 30 days?
- 30-day forward: Block repurchase of the same security for 30 days
- Check for dividend reinvestment plans (DRIPs) that could trigger wash sales
- Document the wash sale window for each trade
| Security Sold | Wash Sale Window Start | Window End | DRIP Active? | Risk |
|---|---|---|---|---|
Step 5: Execution Plan
| Trade # | Account | Action | Security | Shares | Est. Proceeds | Est. Loss | Replacement | Notes |
|---|---|---|---|---|---|---|---|---|
| Sell | ||||||||
| Buy |
Summary:
- Total estimated losses harvested: $
- Estimated tax savings: $ (at marginal rate of %)
- Net portfolio impact: minimal (replacement securities maintain exposure)
- Wash sale window management: [dates]
Step 6: Post-Harvest Tracking
After 30+ days, optionally:
- Swap back to original securities (if preferred)
- Maintain replacement securities (if no reason to switch back)
- Update cost basis records
- Document for tax reporting
Step 7: Output
- Harvest opportunity list (Excel)
- Trade execution sheet
- Wash sale tracking calendar
- Tax savings estimate summary
- Replacement security rationale
Important Notes
- Wash sale rules are strict — violations disallow the loss AND adjust cost basis
- Substantially identical means same security, not same asset class — ETFs tracking different indexes are generally fine
- Always coordinate across all household accounts including retirement accounts
- Consider the long-term cost basis step-down — harvesting resets cost basis, which means more gains later
- Year-end is prime harvesting season but opportunities exist throughout the year
- Mutual fund capital gains distributions in December can create additional harvesting urgency
- Document everything for tax reporting and compliance
- Not all losses are worth harvesting — transaction costs and tracking error have real costs
FAQ
What is a wash sale?
It is a rule that can disallow a loss if a substantially identical investment is bought shortly before or after the sale.
Can losses reduce ordinary income?
The skill notes a deduction of up to 3,000 dollars in net losses against ordinary income, with any excess carried forward.
Does it look at retirement accounts?
No. It looks only at taxable accounts.
Details
Original description by the author
Identify tax-loss harvesting opportunities across taxable accounts. Finds positions with unrealized losses, suggests replacement securities, and tracks wash sale windows. Triggers on "tax-loss harvesting", "TLH", "harvest losses", "tax losses", "unrealized losses", or "year-end tax planning".
Popularity
- GitHub stars
- 8.4k
- Ranking position
- #12464
- License
- Apache-2.0
- Updated
- 10/24/2026
Comments
- …
More skills from this repository
Portfolio AI Readiness
8.4kHelps your agent review updates from several investment companies, rank where AI would help most, and list quick wins for each company.
Due Diligence Checklist
8.4kHelps your agent build and track a checklist for reviewing a company before a deal, grouped by area, with missing items and red flags noted.
Diligence Meeting Prep
8.4kHelps your agent prepare questions and points to check before a diligence meeting, such as a management presentation or a customer reference call.
Investment Committee Memo
8.4kHelps your agent draft a formal investment committee memo that summarizes a deal, its risks, its financials, and its recommendation for approval.
Similar skills
blucli
394kHelps your agent find, play, pause, group, and adjust the volume of Bluesound and NAD speakers through the blu command.
camsnap
394kHelps your agent grab snapshots, short clips, or motion events from network cameras and local webcams that you have set up.
eightctl
394kHelps your agent check and control an Eight Sleep pod, including its temperature, alarms, and sleep schedules.