agentsclimarketplace

Tax optimize

Skill ssurmic/claude-investment-skills/tax-optimize

Investment-research skills for Claude Code: top-down macro-aware framework, bilingual EN/CN NL triggers, Telegram alerts (2-min cron + 1-3s webhook). For personal-finance buy-side use (swing/position/LEAPS) — not HFT. See NEXT-STEPS.md for roadmap.

Install
npx -y skills add ssurmic/claude-investment-skills --skill tax-optimize

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

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 减仓最省税").

SKILL.md

9.4 KB, ~3.0k tokens by cl100k_base, as published. Nobody here has run it

Tax Optimize — LTCG vs STCG Decision Framework

Goal

When user wants to trim a winner, don't just sell — calculate:

  1. LTCG vs STCG difference ($ saved by waiting)
  2. Specific lot identification (which shares to sell first)
  3. Hedge-with-put alternative (no taxable event, similar risk reduction)
  4. 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,85010%
$11,925-48,475$23,850-96,95012%
$48,475-103,350$96,950-206,70022%
$103,350-197,300$206,700-394,60024%
$197,300-250,525$394,600-501,05032%
$250,525-626,350$501,050-751,60035%
> $626,350> $751,60037%

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,7000%
$48,350-533,400$96,700-600,05015%
> $533,400> $600,05020%

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

ScenarioAction
Lots all > 1 year oldSell freely (already LTCG)
Lots all < 1 year, market risk highHedge with puts, don't sell
Lots all < 1 year, will hit 1Y in <30dWait for LTCG, then sell
Lots all < 1 year, will hit 1Y in 60+ daysHedge 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 #DateSharesCostDays heldGain/shareTax type
12024-09-155,000$5.50600$7.64LTCG
22025-03-208,000$8.20410$4.94LTCG
32025-09-105,000$11.00240$2.14STCG
42026-02-153,100$12.5080$0.64STCG

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:

StrategyTax costHedge costNet 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

  1. Always ask for buy dates if not provided. Without dates, can't determine STCG/LTCG.
  2. Never recommend without state context. CA has no LTCG benefit; FL has no state tax.
  3. Show all 3 scenarios (sell now / wait / hedge). Let user choose.
  4. NIIT: Apply if income > $200K single / $250K MFJ.
  5. Wash sale rule: Cannot rebuy same security 30 days before/after loss sale. Use similar-but-different (NOK → ERIC for example).
  6. Don't recommend "sell" just for tax reasons. If thesis intact and stock undervalued, hedging is often better.
  7. 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

NeedTool
Current pricemcp__yfmcp__yfinance_get_ticker_info
Put options for hedgemcp__yfmcp__yfinance_get_option_chain (puts)
User's specific positionsAsk user, OR review review-investment-screenshot

Pro tips

  1. December is for harvesting — review portfolio for losses to crystallize.
  2. January 1 resets — short-term holdings cross to long-term throughout year.
  3. Married couples have $94,250 LTCG 0% bracket (2026) — useful for low-income years.
  4. Roth IRA holds — no tax on gains. Use for high-turnover ideas.
  5. HSA holds — same as Roth, plus tax-deductible contribution.
  6. 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

Gives 0 of the 12 instructions most performance cost skills give in ~3.0k tokens

Counted across 803 of the 1,058 authors here whose files we hold, read 2026-08-06

  • keep skill files under 500 linesin 82 of 803, across 17 files
  • use imperative form in instructionsin 81 of 803, across 10 files
  • draft assertions while test runs are in progressin 75 of 803, across 9 files
  • create two to three realistic test promptsin 74 of 803, across 8 files
  • write skill descriptions to be pushyin 72 of 803, across 7 files
  • save test cases to evals jsonin 72 of 803, across 6 files
  • ask questions about edge cases and input formatsin 71 of 803, across 6 files
  • save timing data immediately when runs completein 70 of 803, across 5 files
  • include all trigger conditions in the skill descriptionin 69 of 803, across 3 files
  • launch all test runs in a single turnin 69 of 803, across 3 files
  • capture intent before writing a skillin 67 of 803, across 1 file
  • import directly instead of barrel filesin 52 of 803, across 15 files

Said here and by no other author read

  • Ask for shares, buy dates, income, and state if not provided
  • Calculate the tax difference between short-term and long-term gains
  • Present sell now, wait, and hedge scenarios
  • Recommend selling specific lots to minimize tax
  • Suggest buying puts to hedge risk without a taxable event
  • Recommend tax loss harvesting to offset capital gains

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.