Tax Optimize — LTCG vs STCG Decision Framework
Goal
When user wants to trim a winner, don't just sell — calculate:
- LTCG vs STCG difference ($ saved by waiting)
- Specific lot identification (which shares to sell first)
- Hedge-with-put alternative (no taxable event, similar risk reduction)
- Tax-loss harvesting (offset gains with losses elsewhere)
US Tax Rates Quick Reference (2026)
Short-Term Capital Gains (held < 1 year)
Taxed as ordinary income. Federal rates depend on AGI:
| AGI (single) |
AGI (MFJ) |
Rate |
| < $11,925 |
< $23,850 |
10% |
| $11,925-48,475 |
$23,850-96,950 |
12% |
| $48,475-103,350 |
$96,950-206,700 |
22% |
| $103,350-197,300 |
$206,700-394,600 |
24% |
| $197,300-250,525 |
$394,600-501,050 |
32% |
| $250,525-626,350 |
$501,050-751,600 |
35% |
| > $626,350 |
> $751,600 |
37% |
Plus state tax: 0-13.3% (CA highest, TX/FL/WA = 0%)
Plus NIIT (Net Investment Income Tax): 3.8% if MAGI > $200K (single) / $250K (MFJ)
Long-Term Capital Gains (held ≥ 1 year)
Federal:
| AGI (single) |
AGI (MFJ) |
Rate |
| < $48,350 |
< $96,700 |
0% |
| $48,350-533,400 |
$96,700-600,050 |
15% |
| > $533,400 |
> $600,050 |
20% |
Plus state: same as ordinary (CA does NOT distinguish LTCG)
Plus NIIT: 3.8% if applicable
Quick rule of thumb (high earner, $400K+ income)
- STCG: 32-37% federal + 3.8% NIIT + state = 38-50%+ effective
- LTCG: 20% federal + 3.8% NIIT + state = 24-37% effective
- Difference: ~12-15% of gain
The 5-Step Workflow
Step 1 — Get user's input
Ask if not provided:
- Ticker + how many shares to sell
- Approximate income bracket (or just "high earner $400K+" / "mid $200K" / etc.)
- Buy date(s) for the lots being sold — CRITICAL for STCG vs LTCG
- State of residence (CA/NY/TX/FL/WA)
- Any浮亏 positions? (for tax loss harvesting)
Step 2 — Calculate STCG vs LTCG difference
# Example: 1000 shares of XYZ, avg cost $10, current $13
gain_per_share = 13 - 10 # $3
total_gain = 1000 * 3 # $3,000
# STCG (high earner, NIIT applies, CA resident as example)
stcg_rate = 0.32 + 0.038 + 0.093 # federal + NIIT + CA = ~45%
stcg_tax = total_gain * stcg_rate # ~$1,350
stcg_net = (1000 * 13) - stcg_tax # ~$11,650
# LTCG (same income bracket)
ltcg_rate = 0.15 + 0.038 + 0.093 # CA does not distinguish, still ~28%
ltcg_tax = total_gain * ltcg_rate # ~$840
ltcg_net = (1000 * 13) - ltcg_tax # ~$12,160
# Savings by waiting for LTCG
savings = stcg_tax - ltcg_tax # ~$510 per 1000 shares
Step 3 — Decision matrix
| Scenario |
Action |
| Lots all > 1 year old |
Sell freely (already LTCG) |
| Lots all < 1 year, market risk high |
Hedge with puts, don't sell |
| Lots all < 1 year, will hit 1Y in <30d |
Wait for LTCG, then sell |
| Lots all < 1 year, will hit 1Y in 60+ days |
Hedge with put, hold to LTCG |
| Mixed lots (some > 1Y, some < 1Y) |
Specific lot ID: sell long-term lots first |
| Position is huge (>15% portfolio) |
Consider gradual sell over multiple tax years |
Step 4 — Recommend specific lot identification
If broker supports (most do — IBKR, Fidelity, Schwab, Robinhood):
- Use Specific Lot ID (not FIFO default)
- Sell highest cost basis first (HIFO) → reduces gain
- OR sell long-term lots first → favorable rate
Example:
| Lot # |
Date |
Shares |
Cost |
Days held |
Gain/share |
Tax type |
| 1 |
2024-09-15 |
5,000 |
$5.50 |
600 |
$7.64 |
LTCG |
| 2 |
2025-03-20 |
8,000 |
$8.20 |
410 |
$4.94 |
LTCG |
| 3 |
2025-09-10 |
5,000 |
$11.00 |
240 |
$2.14 |
STCG |
| 4 |
2026-02-15 |
3,100 |
$12.50 |
80 |
$0.64 |
STCG |
To sell 3,000 shares: Sell from Lot 1 (LTCG + lowest tax, highest gain $/share but lowest %).
Step 5 — Alternative: Hedge with Puts (NO TAXABLE EVENT)
If sell triggers high STCG, consider:
Buy ATM/OTM Put instead of selling:
- Pros: No taxable event, keep upside
- Cons: Premium cost (typically 2-5% of position value for 3-6mo cover)
Example for 1,000 shares at $13:
- Buy ATM Put × 10 contracts (covers 1,000 shares) ~3 months out
- Cost:
$0.30 × 100 × 10 = $300 (2.3% of position)
- Protects $13 floor — if stock drops to $11, puts gain $2/share = $2,000
- Net: $300 cost for $2,000 protection
- No tax event — keep stock until LTCG window opens
Cost comparison:
| Strategy |
Tax cost |
Hedge cost |
Net cost |
| Sell now (STCG) |
~$1,350 |
$0 |
-$1,350 |
| Sell after LTCG (wait) |
~$840 |
$0 |
-$840 |
| Buy put + hold |
$0 |
$300 |
-$300 |
Hedge typically wins by $500-1,000+ per 1,000 shares, KEEPS upside, position intact.
Step 6 — Tax loss harvesting (bonus alpha)
If user has 浮亏 positions:
- Sell loser to crystallize loss
- Loss offsets capital gains (dollar for dollar, no limit)
- Buy back after 31 days (avoid wash sale)
Example:
- User wants to sell 1,000 NOK with $2,800 gain
- User has 100 GDXU at $154 (cost $166 = $1,200 loss)
- Sell GDXU first: realize -$1,200 loss
- Sell NOK: realize +$2,800 gain
- Net taxable: +$1,600 (vs $2,800)
- Tax savings: $1,200 × 35% = $420 saved
- Wait 31 days, can rebuy GDXU if still bullish
Output format
# [TICKER] Tax-Optimized Trim — [Date]
## Inputs
- Ticker: [X], Shares to sell: N
- Avg cost: $X, Current: $Y
- Income bracket: [High/Mid/Low]
- State: [CA/NY/TX/etc]
## Tax Cost Analysis
### Scenario A: Sell Now (assumes STCG)
- Gross proceeds: $XX,XXX
- Total gain: $X,XXX
- STCG tax (X% effective): $X,XXX
- **Net to bank**: $XX,XXX
### Scenario B: Wait for LTCG (sell in [date])
- Gross proceeds: $XX,XXX (assumes price stable)
- LTCG tax (Y% effective): $X,XXX
- **Net to bank**: $XX,XXX
- **Savings vs Now**: $X,XXX
### Scenario C: Hedge with Put (no sale)
- Recommended put: [TICKER] [Date] $X Put × N contracts
- Hedge cost: $XXX
- Tax cost: $0
- **Net cash impact**: -$XXX (vs -$X,XXX in Scenario A)
- **Best if**: Long-term thesis intact, just want short-term protection
## Specific Lot ID Recommendation
| Lot | Buy Date | Days held | Suggested action |
| Lot 1 | YYYY-MM-DD | XXX | Sell first (LTCG, lowest tax) |
| Lot 2 | YYYY-MM-DD | XXX | Sell next |
**Broker instruction**: "Use Specific Lot ID, sell from Lot 1 (settled date YYYY-MM-DD)"
## Tax Loss Harvesting Opportunities
- [If user has loss positions]: Sell [TICKER] to realize -$X loss, offsets gain.
## My Recommendation
[Specific action: which scenario + why + step-by-step orders]
Hard rules
- Always ask for buy dates if not provided. Without dates, can't determine STCG/LTCG.
- Never recommend without state context. CA has no LTCG benefit; FL has no state tax.
- Show all 3 scenarios (sell now / wait / hedge). Let user choose.
- NIIT: Apply if income > $200K single / $250K MFJ.
- Wash sale rule: Cannot rebuy same security 30 days before/after loss sale. Use similar-but-different (NOK → ERIC for example).
- Don't recommend "sell" just for tax reasons. If thesis intact and stock undervalued, hedging is often better.
- Specific Lot ID requires broker setup BEFORE the sale. Tell user to call broker first if unsure.
Common scenarios
Scenario 1: All shares held > 1 year (LTCG)
- All long-term capital gain treatment
- Sell freely if you want to trim
- Recommendation: Standard trim, no special tax planning needed beyond LTCG
Scenario 2: All shares held < 1 year (STCG)
- Example: 1,000 shares at $230 avg cost, now $250 (6 weeks held)
- Sell now: ~35% on $20K gain = $7,000 tax
- Wait 11 months: 18.8% = $3,760 tax
- Hedge with put until LTCG: cost ~$2K, save $5,000 net
Scenario 3: Tax loss harvesting
- Have a winner with $10K LTCG
- Have a loser with $5K loss in unrelated position
- Sell loser to crystallize loss + sell winner for gain
- Net taxable: $5K (vs $10K alone)
- Save $1,000-2,000 in tax (depending on bracket)
- Wait 31 days before rebuying loser (avoid wash sale)
Tool cheat-sheet
| Need |
Tool |
| Current price |
mcp__yfmcp__yfinance_get_ticker_info |
| Put options for hedge |
mcp__yfmcp__yfinance_get_option_chain (puts) |
| User's specific positions |
Ask user, OR review review-investment-screenshot |
Pro tips
- December is for harvesting — review portfolio for losses to crystallize.
- January 1 resets — short-term holdings cross to long-term throughout year.
- Married couples have $94,250 LTCG 0% bracket (2026) — useful for low-income years.
- Roth IRA holds — no tax on gains. Use for high-turnover ideas.
- HSA holds — same as Roth, plus tax-deductible contribution.
- Avoid "constructive sale" — covered call deep ITM = IRS may treat as sale.
When to invoke
- User asks: "Should I sell X now or wait for LTCG?"
- User asks: "How much tax will I pay if I sell N shares?"
- User asks: "How can I trim without paying high taxes?"
- After
analyze-stock recommends trim, BEFORE executing
- Year-end (Dec) tax planning
1---2name: tax-optimize3description: Calculate optimal trim strategy with tax math. Compares Sell-Now (STCG/LTCG depending on holding period) vs Wait-for-LTCG vs Hedge-with-Puts (no taxable event). Computes lot identification (FIFO/HIFO/Specific Lot), tax loss harvesting opportunities. Asks for shares + buy date + income bracket + state. Triggers in English ("should I sell X for tax", "tax on selling X", "LTCG vs STCG on X", "trim X tax efficient") or Chinese ("X 减仓税务", "X 卖出税多少", "现在卖还是等长期", "X 减仓最省税").4---56# Tax Optimize — LTCG vs STCG Decision Framework78## Goal910When user wants to trim a winner, **don't just sell** — calculate:111. **LTCG vs STCG difference** ($ saved by waiting)122. **Specific lot identification** (which shares to sell first)133. **Hedge-with-put alternative** (no taxable event, similar risk reduction)144. **Tax-loss harvesting** (offset gains with losses elsewhere)1516## US Tax Rates Quick Reference (2026)1718### Short-Term Capital Gains (held < 1 year)19**Taxed as ordinary income.** Federal rates depend on AGI:2021| AGI (single) | AGI (MFJ) | Rate |22|---|---|---|23| < $11,925 | < $23,850 | 10% |24| $11,925-48,475 | $23,850-96,950 | 12% |25| $48,475-103,350 | $96,950-206,700 | 22% |26| $103,350-197,300 | $206,700-394,600 | 24% |27| $197,300-250,525 | $394,600-501,050 | 32% |28| $250,525-626,350 | $501,050-751,600 | 35% |29| > $626,350 | > $751,600 | 37% |3031**Plus state tax**: 0-13.3% (CA highest, TX/FL/WA = 0%)32**Plus NIIT** (Net Investment Income Tax): 3.8% if MAGI > $200K (single) / $250K (MFJ)3334### Long-Term Capital Gains (held ≥ 1 year)35**Federal:**36| AGI (single) | AGI (MFJ) | Rate |37|---|---|---|38| < $48,350 | < $96,700 | 0% |39| $48,350-533,400 | $96,700-600,050 | 15% |40| > $533,400 | > $600,050 | 20% |4142**Plus state**: same as ordinary (CA does NOT distinguish LTCG)43**Plus NIIT**: 3.8% if applicable4445### Quick rule of thumb (high earner, $400K+ income)46- **STCG**: 32-37% federal + 3.8% NIIT + state = **38-50%+ effective**47- **LTCG**: 20% federal + 3.8% NIIT + state = **24-37% effective**48- **Difference**: ~12-15% of gain4950## The 5-Step Workflow5152### Step 1 — Get user's input5354Ask if not provided:55- **Ticker** + how many shares to sell56- **Approximate income bracket** (or just "high earner $400K+" / "mid $200K" / etc.)57- **Buy date(s) for the lots being sold** — CRITICAL for STCG vs LTCG58- **State of residence** (CA/NY/TX/FL/WA)59- **Any浮亏 positions?** (for tax loss harvesting)6061### Step 2 — Calculate STCG vs LTCG difference6263```python64# Example: 1000 shares of XYZ, avg cost $10, current $1365gain_per_share = 13 - 10 # $366total_gain = 1000 * 3 # $3,0006768# STCG (high earner, NIIT applies, CA resident as example)69stcg_rate = 0.32 + 0.038 + 0.093 # federal + NIIT + CA = ~45%70stcg_tax = total_gain * stcg_rate # ~$1,35071stcg_net = (1000 * 13) - stcg_tax # ~$11,6507273# LTCG (same income bracket)74ltcg_rate = 0.15 + 0.038 + 0.093 # CA does not distinguish, still ~28%75ltcg_tax = total_gain * ltcg_rate # ~$84076ltcg_net = (1000 * 13) - ltcg_tax # ~$12,1607778# Savings by waiting for LTCG79savings = stcg_tax - ltcg_tax # ~$510 per 1000 shares80```8182### Step 3 — Decision matrix8384| Scenario | Action |85|---|---|86| Lots all > 1 year old | Sell freely (already LTCG) |87| Lots all < 1 year, market risk high | **Hedge with puts**, don't sell |88| Lots all < 1 year, will hit 1Y in <30d | **Wait** for LTCG, then sell |89| Lots all < 1 year, will hit 1Y in 60+ days | **Hedge with put**, hold to LTCG |90| Mixed lots (some > 1Y, some < 1Y) | **Specific lot ID**: sell long-term lots first |91| Position is huge (>15% portfolio) | Consider gradual sell over multiple tax years |9293### Step 4 — Recommend specific lot identification9495If broker supports (most do — IBKR, Fidelity, Schwab, Robinhood):96- Use **Specific Lot ID** (not FIFO default)97- Sell highest cost basis first (HIFO) → reduces gain98- OR sell long-term lots first → favorable rate99100**Example**:101| Lot # | Date | Shares | Cost | Days held | Gain/share | Tax type |102|---|---|---|---|---|---|---|103| 1 | 2024-09-15 | 5,000 | $5.50 | 600 | $7.64 | LTCG |104| 2 | 2025-03-20 | 8,000 | $8.20 | 410 | $4.94 | LTCG |105| 3 | 2025-09-10 | 5,000 | $11.00 | 240 | $2.14 | STCG |106| 4 | 2026-02-15 | 3,100 | $12.50 | 80 | $0.64 | STCG |107108To sell 3,000 shares: **Sell from Lot 1** (LTCG + lowest tax, highest gain $/share but lowest %).109110### Step 5 — Alternative: Hedge with Puts (NO TAXABLE EVENT)111112If sell triggers high STCG, consider:113114**Buy ATM/OTM Put instead of selling:**115- Pros: No taxable event, keep upside116- Cons: Premium cost (typically 2-5% of position value for 3-6mo cover)117118**Example for 1,000 shares at $13**:119- Buy ATM Put × 10 contracts (covers 1,000 shares) ~3 months out120- Cost: ~$0.30 × 100 × 10 = $300 (~2.3% of position)121- Protects $13 floor — if stock drops to $11, puts gain $2/share = $2,000122- Net: $300 cost for $2,000 protection123- **No tax event** — keep stock until LTCG window opens124125**Cost comparison**:126| Strategy | Tax cost | Hedge cost | Net cost |127|---|---|---|---|128| Sell now (STCG) | ~$1,350 | $0 | -$1,350 |129| Sell after LTCG (wait) | ~$840 | $0 | -$840 |130| **Buy put + hold** | **$0** | $300 | **-$300** |131132**Hedge typically wins by $500-1,000+ per 1,000 shares**, KEEPS upside, position intact.133134### Step 6 — Tax loss harvesting (bonus alpha)135136If user has 浮亏 positions:137- Sell loser to crystallize loss138- Loss offsets capital gains (dollar for dollar, no limit)139- Buy back after **31 days** (avoid wash sale)140141**Example**:142- User wants to sell 1,000 NOK with $2,800 gain143- User has 100 GDXU at $154 (cost $166 = $1,200 loss)144- Sell GDXU first: realize -$1,200 loss145- Sell NOK: realize +$2,800 gain146- Net taxable: +$1,600 (vs $2,800)147- Tax savings: $1,200 × 35% = **$420 saved**148- Wait 31 days, can rebuy GDXU if still bullish149150## Output format151152```markdown153# [TICKER] Tax-Optimized Trim — [Date]154155## Inputs156- Ticker: [X], Shares to sell: N157- Avg cost: $X, Current: $Y158- Income bracket: [High/Mid/Low]159- State: [CA/NY/TX/etc]160161## Tax Cost Analysis162163### Scenario A: Sell Now (assumes STCG)164- Gross proceeds: $XX,XXX165- Total gain: $X,XXX166- STCG tax (X% effective): $X,XXX167- **Net to bank**: $XX,XXX168169### Scenario B: Wait for LTCG (sell in [date])170- Gross proceeds: $XX,XXX (assumes price stable)171- LTCG tax (Y% effective): $X,XXX172- **Net to bank**: $XX,XXX173- **Savings vs Now**: $X,XXX174175### Scenario C: Hedge with Put (no sale)176- Recommended put: [TICKER] [Date] $X Put × N contracts177- Hedge cost: $XXX178- Tax cost: $0179- **Net cash impact**: -$XXX (vs -$X,XXX in Scenario A)180- **Best if**: Long-term thesis intact, just want short-term protection181182## Specific Lot ID Recommendation183| Lot | Buy Date | Days held | Suggested action |184| Lot 1 | YYYY-MM-DD | XXX | Sell first (LTCG, lowest tax) |185| Lot 2 | YYYY-MM-DD | XXX | Sell next |186187**Broker instruction**: "Use Specific Lot ID, sell from Lot 1 (settled date YYYY-MM-DD)"188189## Tax Loss Harvesting Opportunities190- [If user has loss positions]: Sell [TICKER] to realize -$X loss, offsets gain.191192## My Recommendation193[Specific action: which scenario + why + step-by-step orders]194```195196## Hard rules1971981. **Always ask for buy dates if not provided.** Without dates, can't determine STCG/LTCG.1992. **Never recommend without state context.** CA has no LTCG benefit; FL has no state tax.2003. **Show all 3 scenarios** (sell now / wait / hedge). Let user choose.2014. **NIIT**: Apply if income > $200K single / $250K MFJ.2025. **Wash sale rule**: Cannot rebuy same security 30 days before/after loss sale. Use similar-but-different (NOK → ERIC for example).2036. **Don't recommend "sell" just for tax reasons.** If thesis intact and stock undervalued, hedging is often better.2047. **Specific Lot ID requires broker setup BEFORE the sale.** Tell user to call broker first if unsure.205206## Common scenarios207208### Scenario 1: All shares held > 1 year (LTCG)209- All long-term capital gain treatment210- Sell freely if you want to trim211- Recommendation: Standard trim, no special tax planning needed beyond LTCG212213### Scenario 2: All shares held < 1 year (STCG)214- Example: 1,000 shares at $230 avg cost, now $250 (6 weeks held)215- Sell now: ~35% on $20K gain = $7,000 tax216- Wait 11 months: 18.8% = $3,760 tax217- **Hedge with put** until LTCG: cost ~$2K, save $5,000 net218219### Scenario 3: Tax loss harvesting220- Have a winner with $10K LTCG221- Have a loser with $5K loss in unrelated position222- Sell loser to crystallize loss + sell winner for gain223- Net taxable: $5K (vs $10K alone)224- Save $1,000-2,000 in tax (depending on bracket)225- Wait 31 days before rebuying loser (avoid wash sale)226227## Tool cheat-sheet228229| Need | Tool |230|---|---|231| Current price | `mcp__yfmcp__yfinance_get_ticker_info` |232| Put options for hedge | `mcp__yfmcp__yfinance_get_option_chain` (puts) |233| User's specific positions | Ask user, OR review `review-investment-screenshot` |234235## Pro tips2362371. **December is for harvesting** — review portfolio for losses to crystallize.2382. **January 1 resets** — short-term holdings cross to long-term throughout year.2393. **Married couples have $94,250 LTCG 0% bracket** (2026) — useful for low-income years.2404. **Roth IRA holds** — no tax on gains. Use for high-turnover ideas.2415. **HSA holds** — same as Roth, plus tax-deductible contribution.2426. **Avoid "constructive sale"** — covered call deep ITM = IRS may treat as sale.243244## When to invoke245246- User asks: "Should I sell X now or wait for LTCG?"247- User asks: "How much tax will I pay if I sell N shares?"248- User asks: "How can I trim without paying high taxes?"249- After `analyze-stock` recommends trim, BEFORE executing250- Year-end (Dec) tax planning