タックスロスハーベスティング
含み損のある金融資産を売却して税金を軽減し、特定期間後の買い戻し規制を遵守しながら、年間の繰越損失を管理・追跡することで、効率的な節税計画を立てるSkill。
📜 元の英語説明(参考)
Tax-loss harvesting opportunity identification, scoring, and planning with wash sale compliance and annual carryforward tracking
🇯🇵 日本人クリエイター向け解説
含み損のある金融資産を売却して税金を軽減し、特定期間後の買い戻し規制を遵守しながら、年間の繰越損失を管理・追跡することで、効率的な節税計画を立てるSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o tax-loss-harvesting.zip https://jpskill.com/download/10444.zip && unzip -o tax-loss-harvesting.zip && rm tax-loss-harvesting.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10444.zip -OutFile "$d\tax-loss-harvesting.zip"; Expand-Archive "$d\tax-loss-harvesting.zip" -DestinationPath $d -Force; ri "$d\tax-loss-harvesting.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
tax-loss-harvesting.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
tax-loss-harvestingフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
税務上の損失の実現
暗号資産ポートフォリオ全体で、税務上の損失の実現(TLH)の機会を特定、スコアリング、計画します。このスキルは、未実現損失のランキング、純利益の計算、ウォッシュセール(仮装売買)コンプライアンス、年間損失繰越追跡、および年末の「使い切り」戦略を網羅しています。
免責事項: このスキルは、情報分析のみを提供します。税務アドバイスではありません。税法は管轄区域によって異なり、頻繁に変更されます。税金に関連する取引の決定を行う前に、資格のある税務専門家にご相談ください。
税務上の損失の実現の仕組み
税務上の損失の実現とは、実現したキャピタルゲインを相殺するために、意図的に投資損失を実現し、それによって当年度の納税義務を軽減する慣行です。
中核となるメカニズム
- ポートフォリオ内の未実現損失のあるポジションを特定します。
- それらのポジションを売却して、損失を実現します。
- 実現したゲインを、実現した損失で相殺し、課税対象所得を減らします。
- 必要に応じて、市場へのエクスポージャーを維持するために、類似の(ただし「実質的に同一」ではない)ポジションに再参入します。
短期 vs 長期
| 保有期間 | 分類 | 一般的な税率 |
|---|---|---|
| 1年未満 | 短期キャピタルゲイン/ロス | 通常所得税率 |
| 1年以上 | 長期キャピタルゲイン/ロス | 優遇税率 (0-20%) |
短期損失はまず短期ゲインを相殺し、長期損失はまず長期ゲインを相殺します。残りの純損失は、もう一方のカテゴリを相殺するために繰り越されます。
年間損失控除限度額
総純損失が総ゲインを超える場合、超過分は通常所得から年間最大3,000ドル(夫婦別申告の場合は1,500ドル)まで控除できます。残りの損失は、将来の課税年度に無期限に繰り越されます。
未実現損失のランキング
すべての未実現損失が、実現する価値があるとは限りません。このスキルは、各機会を4つの側面でスコアリングします。
1. 損失の大きさ
ドル建ての損失が大きいほど、税金の節約額は大きくなります。生の損失は、現在の市場価値と原価基準の差です。
unrealized_loss = current_value - cost_basis # 損失の場合は負の値
tax_savings = abs(unrealized_loss) * marginal_tax_rate
2. 長期基準までの日数
1年の保有期間に近づいているポジションは、特別な考慮に値します。
- 長期領域に近づいている場合は、今すぐ実現することで短期損失を確定します(税率の高い短期ゲインを相殺します)。
- すでに長期の場合は、損失は長期ゲインを相殺します(税率の低いメリット)。
days_held = (today - acquisition_date).days
days_to_long_term = max(0, 365 - days_held)
長期までの日数が少ないポジションは、365日を超えると短期損失が価値の低い長期損失になるため、評価する上でより緊急性が高くなります。
3. ウォッシュセールリスク(相関スコア)
IRSのウォッシュセールルールでは、売却の前後30日以内に「実質的に同一」の証券を購入した場合、損失を請求することを禁じています。暗号資産では、正確な適用は進化していますが、慎重な計画では、61日間のウォッシュセール期間(売却前30日 + 売却日 + 売却後30日)以内に同じトークンに再参入することを避けます。
相関スコアリング: 実現した資産と相関性の高いポジションを保有している(または再参入を計画している)場合、ウォッシュセールリスクが高まります。これを次のようにスコアリングします。
wash_sale_risk = 1.0 # 30日以内に同じトークンに再参入する予定の場合
wash_sale_risk = correlation_coefficient # 相関性のある代替品を保有している場合
wash_sale_risk = 0.0 # 再参入または相関性のない代替品がない場合
ウォッシュセールリスクが高いほど、機会の有効スコアが低下します。
4. 相殺可能なゲイン
実現した損失は、相殺するゲインがある場合にのみすぐに役立ちます。次の場合、機会のスコアが高くなります。
- 一致するタイプのゲインがある場合(短期損失 vs 短期ゲイン)。
- 損失額が利用可能なゲインを大幅に超えない場合(3,000ドルの控除上限を超えると、限界利益が減少します)。
offset_efficiency = min(1.0, available_matching_gains / abs(unrealized_loss))
複合スコア
def tlh_score(
unrealized_loss: float,
days_to_long_term: int,
wash_sale_risk: float,
offset_efficiency: float,
weights: dict | None = None,
) -> float:
w = weights or {
"magnitude": 0.35,
"urgency": 0.25,
"wash_safety": 0.20,
"offset_match": 0.20,
}
magnitude_score = min(abs(unrealized_loss) / 10_000, 1.0)
urgency_score = max(0, 1.0 - days_to_long_term / 365)
wash_safety_score = 1.0 - wash_sale_risk
return (
w["magnitude"] * magnitude_score
+ w["urgency"] * urgency_score
+ w["wash_safety"] * wash_safety_score
+ w["offset_match"] * offset_efficiency
)
純利益の計算
損失の実現は無料ではありません。取引コスト(スワップ手数料、スリッページ、ガス)は利益を減少させます。
def net_benefit(
unrealized_loss: float,
marginal_tax_rate: float,
transaction_cost: float,
re_entry_cost: float = 0.0,
) -> float:
"""損失を実現することによる純ドル利益を計算します。
Args:
unrealized_loss: 損失を表す負の数。
marginal_tax_rate: 適用される税率(0.0〜1.0)。
transaction_cost: 売却を実行するためのコスト(手数料 + スリッページ)。
re_entry_cost: 代替ポジションに再参入するためのコスト。
Returns:
ドル建ての純利益。正の値は、実現する価値があることを意味します。
"""
tax_savings = abs(unrealized_loss) * marginal_tax_rate
total_costs = transaction_cost + re_entry_cost
return tax_savings - total_costs
経験則: net_benefit > 0 の場合にのみ、意味のあるマージンで実現します。非常に小さな損失は、取引コストと運用上の複雑さを考えると価値がありません。
年末の「使い切り」
12月31日近くになったら、実現を加速するかどうかを評価します。
- 年初来の実現ゲイン(短期と長期の両方)を集計します。
- それらのゲインを相殺できる未実現損失を特定します。
- 次の損失を優先します。
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Tax-Loss Harvesting
Identify, score, and plan tax-loss harvesting (TLH) opportunities across a crypto portfolio. This skill covers unrealized-loss ranking, net-benefit calculation, wash sale compliance, annual loss carryforward tracking, and year-end "use it or lose it" strategies.
Disclaimer: This skill provides informational analysis only. It is NOT tax advice. Tax rules vary by jurisdiction and change frequently. Consult a qualified tax professional before making any tax-related trading decisions.
How Tax-Loss Harvesting Works
Tax-loss harvesting is the practice of intentionally realizing investment losses to offset realized capital gains, thereby reducing your current-year tax liability.
Core Mechanism
- Identify positions with unrealized losses in your portfolio.
- Sell those positions to realize the loss.
- Offset realized gains with the harvested loss, reducing taxable income.
- Optionally re-enter a similar (but not "substantially identical") position to maintain market exposure.
Short-Term vs Long-Term
| Holding Period | Classification | Typical Tax Rate |
|---|---|---|
| < 1 year | Short-term capital gain/loss | Ordinary income rate |
| >= 1 year | Long-term capital gain/loss | Preferential rate (0-20%) |
Short-term losses first offset short-term gains; long-term losses first offset long-term gains. Remaining net losses cross over to offset the other category.
Annual Loss Deduction Limit
If total net losses exceed total gains, the excess is deductible against ordinary income up to $3,000 per year ($1,500 if married filing separately). Any remaining loss carries forward indefinitely to future tax years.
Ranking Unrealized Losses
Not all unrealized losses are equally valuable to harvest. This skill scores each opportunity on four dimensions:
1. Loss Magnitude
Larger dollar losses provide more tax savings. The raw loss is the difference between current market value and cost basis.
unrealized_loss = current_value - cost_basis # negative when loss
tax_savings = abs(unrealized_loss) * marginal_tax_rate
2. Days Until Long-Term Threshold
A position approaching the 1-year holding mark deserves special consideration:
- If close to crossing into long-term territory, harvesting now locks in a short-term loss (offsets higher-taxed short-term gains).
- If already long-term, the loss offsets long-term gains (lower tax rate benefit).
days_held = (today - acquisition_date).days
days_to_long_term = max(0, 365 - days_held)
Positions with fewer days remaining until long-term are more urgent to evaluate because once they cross 365 days, a short-term loss becomes a less-valuable long-term loss.
3. Wash Sale Risk (Correlation Score)
The IRS wash sale rule prohibits claiming a loss if you buy a "substantially identical" security within 30 days before or after the sale. In crypto, the exact application is evolving, but prudent planning avoids re-entering the same token within the 61-day wash sale window (30 days before + sale day + 30 days after).
Correlation scoring: If you hold (or plan to re-enter) a position that is highly correlated with the harvested asset, wash sale risk increases. Score this as:
wash_sale_risk = 1.0 # if same token re-entry planned within 30 days
wash_sale_risk = correlation_coefficient # if correlated substitute held
wash_sale_risk = 0.0 # if no re-entry or uncorrelated substitute
Higher wash sale risk reduces the effective score of the opportunity.
4. Available Gains to Offset
A harvested loss is only immediately useful if there are realized gains to offset. Score opportunities higher when:
- There are matching-type gains (short-term loss vs short-term gain).
- The loss amount does not greatly exceed available gains (diminishing marginal benefit beyond the $3K deduction cap).
offset_efficiency = min(1.0, available_matching_gains / abs(unrealized_loss))
Composite Score
def tlh_score(
unrealized_loss: float,
days_to_long_term: int,
wash_sale_risk: float,
offset_efficiency: float,
weights: dict | None = None,
) -> float:
w = weights or {
"magnitude": 0.35,
"urgency": 0.25,
"wash_safety": 0.20,
"offset_match": 0.20,
}
magnitude_score = min(abs(unrealized_loss) / 10_000, 1.0)
urgency_score = max(0, 1.0 - days_to_long_term / 365)
wash_safety_score = 1.0 - wash_sale_risk
return (
w["magnitude"] * magnitude_score
+ w["urgency"] * urgency_score
+ w["wash_safety"] * wash_safety_score
+ w["offset_match"] * offset_efficiency
)
Net Benefit Calculation
Harvesting a loss is not free. Transaction costs (swap fees, slippage, gas) reduce the benefit.
def net_benefit(
unrealized_loss: float,
marginal_tax_rate: float,
transaction_cost: float,
re_entry_cost: float = 0.0,
) -> float:
"""Compute net dollar benefit of harvesting a loss.
Args:
unrealized_loss: Negative number representing the loss.
marginal_tax_rate: Applicable tax rate (0.0 to 1.0).
transaction_cost: Cost to execute the sell (fees + slippage).
re_entry_cost: Cost to re-enter a substitute position.
Returns:
Net benefit in dollars. Positive means harvesting is worthwhile.
"""
tax_savings = abs(unrealized_loss) * marginal_tax_rate
total_costs = transaction_cost + re_entry_cost
return tax_savings - total_costs
Rule of thumb: Only harvest when net_benefit > 0 by a meaningful margin. Very small losses are not worth the transaction costs and operational complexity.
Year-End "Use It or Lose It"
Near December 31, evaluate whether to accelerate harvesting:
- Tally year-to-date realized gains (both short-term and long-term).
- Identify unrealized losses that can offset those gains.
- Prioritize losses that offset same-type gains (short-term loss vs short-term gain yields the highest tax rate differential).
- Check the $3K excess limit: If net losses already exceed gains by $3K, additional harvesting this year has no immediate tax benefit (though the carryforward still has value).
- Consider settlement timing: Ensure trades settle before year-end.
Wash Sale Compliance
The 61-Day Window
The wash sale rule applies to purchases of substantially identical securities within:
- 30 days before the sale (retroactive wash sale)
- The day of the sale
- 30 days after the sale
If triggered, the disallowed loss is added to the cost basis of the replacement shares, deferring (not eliminating) the tax benefit.
Compliance Strategies
| Strategy | Description | Trade-off |
|---|---|---|
| Wait 31 days | Sell, wait 31 days, re-buy | Market exposure gap |
| Substitute asset | Sell, immediately buy a non-identical but correlated asset | Tracking error |
| No re-entry | Sell and stay out | Lost upside |
| Double-up | Buy additional shares, wait 31 days, sell original lot | Capital intensive |
Crypto-Specific Considerations
- The IRS has not explicitly ruled that the wash sale rule applies to cryptocurrency (as of 2025). However, proposed legislation may extend it.
- Prudent practitioners treat crypto as subject to wash sale rules for conservative planning.
- Different tokens (e.g., SOL vs ETH) are generally considered non-identical.
- Wrapped versions of the same token (e.g., SOL vs wSOL) may be considered substantially identical.
Annual Loss Carryforward Tracking
def compute_carryforward(
realized_gains_st: float,
realized_gains_lt: float,
realized_losses_st: float,
realized_losses_lt: float,
prior_carryforward: float = 0.0,
annual_deduction_limit: float = 3_000.0,
) -> dict:
"""Compute net tax position and carryforward.
Returns dict with keys:
net_st, net_lt, total_net,
deduction_used, carryforward
"""
net_st = realized_gains_st + realized_losses_st # losses are negative
net_lt = realized_gains_lt + realized_losses_lt
total_net = net_st + net_lt - prior_carryforward
if total_net >= 0:
return {
"net_st": net_st, "net_lt": net_lt,
"total_net": total_net, "deduction_used": 0.0,
"carryforward": 0.0,
}
excess_loss = abs(total_net)
deduction_used = min(excess_loss, annual_deduction_limit)
carryforward = max(0, excess_loss - annual_deduction_limit)
return {
"net_st": net_st, "net_lt": net_lt,
"total_net": total_net,
"deduction_used": deduction_used,
"carryforward": carryforward,
}
Prerequisites
- Python 3.10+
- No external dependencies for core calculations
- Portfolio data: cost basis, acquisition date, current market value per lot
- Tax parameters: marginal tax rate, filing status, prior carryforward
Capabilities
| Capability | Description |
|---|---|
| Opportunity scanning | Identify all positions with unrealized losses |
| Multi-factor scoring | Rank by magnitude, urgency, wash safety, offset match |
| Net benefit analysis | Compare tax savings against transaction costs |
| Wash sale tracking | Flag positions within the 61-day window |
| Carryforward calculator | Track annual $3K limit and loss carryforward |
| Year-end planning | Prioritize harvesting before December 31 |
| Harvesting plan output | Generate actionable plan with sell orders and re-entry dates |
Quick Start
from datetime import date
# Define a portfolio position
position = {
"symbol": "TOKEN-A",
"cost_basis": 10_000.0,
"current_value": 6_500.0,
"acquisition_date": date(2025, 8, 15),
"quantity": 500.0,
}
unrealized_loss = position["current_value"] - position["cost_basis"] # -3500
days_held = (date.today() - position["acquisition_date"]).days
days_to_lt = max(0, 365 - days_held)
# Score the opportunity
score = tlh_score(
unrealized_loss=unrealized_loss,
days_to_long_term=days_to_lt,
wash_sale_risk=0.0,
offset_efficiency=0.8,
)
print(f"TLH score: {score:.3f}")
# Calculate net benefit
benefit = net_benefit(
unrealized_loss=unrealized_loss,
marginal_tax_rate=0.35,
transaction_cost=15.0,
re_entry_cost=15.0,
)
print(f"Net benefit: ${benefit:.2f}")
Use Cases
- Quarterly portfolio review: Scan all positions for harvesting opportunities ranked by composite score.
- Year-end tax planning: Identify optimal set of positions to harvest before December 31 given year-to-date gain/loss totals.
- Ongoing monitoring: Flag positions that are approaching the long-term threshold where harvesting a short-term loss becomes urgent.
- Carryforward management: Track multi-year loss carryforward balances and project when they will be fully utilized.
- Transaction cost analysis: Determine minimum loss threshold worth harvesting given current fee environment.
Files
| File | Description |
|---|---|
references/planned_features.md |
TLH mechanics, scoring formula, wash sale interaction, carryforward rules, year-end strategies |
scripts/harvest_scanner.py |
Demo scanner: score opportunities, generate harvesting plan, compute net benefit |
Important: This skill provides analytical tools for informational purposes only. All tax-related decisions should be reviewed by a qualified tax professional. Tax laws vary by jurisdiction and are subject to change.