managing-tax-loss-harvesting

Identifies and executes tax-loss harvesting opportunities with wash sale compliance and tracking. Use when harvesting tax losses, managing wash sale rules, or optimizing after-tax returns.

11 stars

Best use case

managing-tax-loss-harvesting is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Identifies and executes tax-loss harvesting opportunities with wash sale compliance and tracking. Use when harvesting tax losses, managing wash sale rules, or optimizing after-tax returns.

Teams using managing-tax-loss-harvesting should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/managing-tax-loss-harvesting/SKILL.md --create-dirs "https://raw.githubusercontent.com/CaseMark/skills/main/skills/finance/managing-tax-loss-harvesting/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/managing-tax-loss-harvesting/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How managing-tax-loss-harvesting Compares

Feature / Agentmanaging-tax-loss-harvestingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Identifies and executes tax-loss harvesting opportunities with wash sale compliance and tracking. Use when harvesting tax losses, managing wash sale rules, or optimizing after-tax returns.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Managing Tax Loss Harvesting

## When To Use

- Reviewing portfolios for unrealized losses that can offset realized gains or ordinary income
- Approaching year-end and need to quantify harvesting opportunities across accounts
- A client has triggered significant realized gains and needs loss offsets before the tax year closes
- Rebalancing a portfolio and want to prioritize selling loss positions over gain positions
- Evaluating whether to harvest a loss now versus holding for long-term capital loss treatment

## Inputs To Gather

- **Portfolio holdings**: Current positions with cost basis (lot-level), acquisition dates, and current market values
- **Realized gains YTD**: Short-term and long-term capital gains already recognized in the current tax year
- **Income context**: Ordinary income estimate (losses can offset up to $3,000/$1,500 MFS of ordinary income annually) [VERIFY: current annual limit]
- **Loss carryforward balance**: Any capital loss carryforwards from prior tax years
- **Account structure**: Taxable vs. tax-advantaged accounts — harvesting only applies to taxable accounts
- **Wash sale exposure**: Positions held in IRAs, 401(k)s, or spouse accounts that could trigger wash sale disqualification
- **Replacement security candidates**: Substitute securities or ETFs to maintain market exposure without triggering wash sales
- **Client tax bracket**: Marginal federal and state rates to quantify the tax benefit of harvesting [VERIFY: applicable state tax treatment of capital gains]

## Workflow

1. **Screen for unrealized losses** — Pull all taxable account positions with unrealized losses. Separate into short-term (held ≤ 1 year) and long-term (held > 1 year). Prioritize short-term losses first since they offset higher-taxed short-term gains dollar-for-dollar.

2. **Quantify the tax benefit** — For each candidate position, calculate:
   - Loss amount (proceeds minus cost basis at the lot level)
   - Tax savings = loss × applicable marginal tax rate
   - Transaction costs (commissions, bid-ask spread on replacement)
   - Net benefit = tax savings − transaction costs
   - Discard candidates where net benefit is negligible or negative

3. **Check wash sale constraints** — For each candidate sale, verify:
   - The same or "substantially identical" security was not purchased 30 days before the sale date
   - No repurchase of the same or substantially identical security will occur within 30 days after the sale
   - No purchase of the same security exists in IRAs, Roth IRAs, or spouse accounts within the 61-day window [VERIFY: IRS guidance on cross-account wash sale treatment]
   - Dividend reinvestment plans (DRIPs) on the same security are paused or redirected

4. **Select replacement securities** — Identify substitutes that maintain asset allocation exposure without being "substantially identical":
   - Different index (e.g., swap S&P 500 ETF for a total market ETF)
   - Different fund family tracking a different benchmark
   - Individual stocks in the same sector as a proxy (higher tracking error)
   - Document why each replacement is not substantially identical

5. **Execute harvesting trades** — Sell loss positions using specific lot identification to maximize the loss. Simultaneously purchase replacement securities to avoid market exposure gaps. Record trade dates to start the 30-day post-sale wash sale window.

6. **Set wash sale calendar controls** — Create 31-day hold alerts for each replacement position. Block automated rebalancing or DRIP from repurchasing the original security within the window. After day 31, the original security can be repurchased if desired.

7. **Track basis adjustments** — If a wash sale is inadvertently triggered, the disallowed loss is added to the cost basis of the replacement shares. Document the adjusted basis and new holding period for affected lots.

## Output

- **Harvesting summary table**: Position | Cost Basis | Market Value | Unrealized Loss | Loss Type (ST/LT) | Estimated Tax Savings | Replacement Security | Trade Date | Wash Sale Window End
- **Net tax impact**: Total losses harvested, gains offset, remaining carryforward, and estimated tax savings at the client's marginal rate
- **Wash sale compliance log**: Each sold position mapped to its 61-day exclusion window, cross-account holdings check, and DRIP status
- **Replacement security rationale**: Brief note per swap explaining why the replacement avoids substantially identical classification
- **Post-harvest allocation comparison**: Pre- and post-harvest asset allocation to confirm portfolio drift is within acceptable tolerance

## Quality Checks

- Verify lot-level cost basis data — aggregate basis numbers mask partial-lot opportunities and can miscalculate gains/losses
- Confirm short-term vs. long-term classification by checking actual acquisition dates, not estimates
- Cross-reference all taxable and tax-advantaged accounts for wash sale exposure — omitting an IRA or 401(k) holding is the most common compliance failure
- Validate that replacement securities are not substantially identical (different index, different issuer, materially different composition)
- Ensure harvested losses are not artificially inflated by pending corporate actions (stock splits, mergers, return of capital adjustments)
- Flag any position where the unrealized loss is less than 2% of position value — transaction costs may eliminate the benefit
- Confirm the $3,000 ordinary income offset limit and carryforward mechanics apply correctly to the client's filing status [VERIFY: filing status impact on loss limits]

Related Skills

managing-wound-care

11
from CaseMark/skills

Guides wound assessment, classification, and treatment selection with documentation requirements. Use when managing surgical wounds, classifying wound types, or selecting wound care protocols.

managing-wound-assessment-nursing

11
from CaseMark/skills

Structures wound assessment with measurement, staging, and treatment plan documentation. Use when assessing wounds, staging pressure injuries, or documenting wound care.

managing-workplace-safety-healthcare

11
from CaseMark/skills

Tracks OSHA healthcare requirements including bloodborne pathogen, TB, and violence prevention programs. Use when managing OSHA compliance, implementing safety programs, or documenting exposure incidents.

managing-workers-compensation-rehabilitation

11
from CaseMark/skills

Structures workers comp rehab documentation with functional capacity evaluation and return-to-work planning. Use when managing work injury rehab, performing FCEs, or documenting return-to-work status.

managing-vestibular-rehabilitation

11
from CaseMark/skills

Structures vestibular assessment with positional testing and customized exercise programs. Use when evaluating vestibular disorders, performing Dix-Hallpike testing, or designing vestibular exercise programs.

managing-venous-thromboembolism-prophylaxis

11
from CaseMark/skills

Applies VTE risk assessment (Padua, Caprini) with appropriate prophylaxis selection. Use when assessing VTE risk, selecting prophylaxis regimens, or documenting DVT prevention.

managing-valvular-heart-disease

11
from CaseMark/skills

Guides valve disease severity assessment with intervention criteria and surveillance schedules. Use when evaluating valve disease, assessing surgical/interventional timing, or monitoring valve function.

managing-vaccine-schedules

11
from CaseMark/skills

Applies CDC immunization schedules with catch-up protocols and contraindication screening. Use when managing vaccinations, creating catch-up schedules, or documenting immunization decisions.

managing-vaccination-campaigns

11
from CaseMark/skills

Plans mass vaccination campaigns with logistics, cold chain management, and adverse event monitoring. Use when planning vaccination drives, managing immunization logistics, or monitoring VAERS.

managing-traumatic-brain-injury-rehabilitation

11
from CaseMark/skills

Structures TBI rehab with Rancho Los Amigos scoring and cognitive rehabilitation protocols. Use when managing TBI rehab, tracking Rancho levels, or implementing cognitive therapy.

managing-trauma-assessments

11
from CaseMark/skills

Conducts structured primary and secondary trauma surveys following ATLS methodology. Use when assessing trauma patients, documenting trauma workups, or coordinating trauma team activations.

managing-transplant-evaluations

11
from CaseMark/skills

Guides transplant candidacy evaluation with organ-specific criteria and listing documentation. Use when evaluating transplant candidates, documenting listing criteria, or coordinating transplant workups.