New to Claude Skills? Learn how to install them →

anthropics on GitHub

Portfolio Rebalance

OfficialFree

Optimize your investment allocations with tax-aware strategies.

Get this skill

Free · Opens the source repo

What Portfolio Rebalance does

The Portfolio Rebalance skill provides a structured approach to analyzing and optimizing your investment portfolio's asset allocation. It begins by assessing the current state of each account, including account types such as taxable, IRA, Roth, and 401k, along with their holdings, market values, and cost bases. This foundational step allows you to understand the existing allocation and identify any drift from your investment policy statement (IPS) targets.

Once the current state is established, the skill performs a drift analysis, comparing the current asset allocation against the desired targets. It highlights any positions that exceed the specified rebalancing thresholds, typically within ±3-5%. This analysis is crucial for maintaining alignment with your investment goals and ensuring that your portfolio remains diversified according to your risk tolerance.

The skill then generates tailored trade recommendations, taking into account tax implications and transaction costs. It prioritizes rebalancing in tax-advantaged accounts to minimize tax consequences and suggests strategies for managing taxable accounts effectively. For instance, it advises against selling positions with significant short-term gains and emphasizes tax-loss harvesting where applicable. Additionally, the skill reviews asset location strategies to optimize which assets should be held in different account types based on their tax efficiency.

Finally, the Portfolio Rebalance skill provides a comprehensive output that includes a drift analysis table, a recommended trade list, and a summary of estimated tax impacts. This ensures that users can make informed decisions when rebalancing their portfolios, ultimately leading to a more effective investment strategy that aligns with their financial objectives.

When to use it

Use this skill when you need to assess and adjust your investment portfolio to align with your financial goals and risk tolerance.

When not to use it

Avoid this skill if your portfolio is already well-balanced and you do not require detailed tax considerations or trade recommendations.

What you can build with it

Annual Portfolio Review

Use the skill during your annual financial review to ensure your investment allocations are aligned with your goals.

Tax Season Preparation

Leverage the skill to prepare for tax season by understanding the tax implications of your investment decisions.

Adjusting for Market Changes

Utilize the skill when significant market movements occur to reassess and rebalance your portfolio effectively.

How to install Portfolio Rebalance

View source

1. Install with the skills CLI

npx skills add anthropics/financial-services/portfolio-rebalance --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by anthropics

Portfolio Rebalance

Workflow

Step 1: Current State

For each account, capture:

  • Account type (taxable, IRA, Roth, 401k)
  • Holdings with current market value
  • Cost basis (for taxable accounts)
  • Unrealized gains/losses per position

Step 2: Drift Analysis

Compare current allocation to IPS targets:

Asset ClassTarget %Current %Drift$ Over/Under
US Large Cap Equity
US Small/Mid Cap
International Developed
Emerging Markets
Investment Grade Bonds
High Yield / Credit
TIPS / Inflation Protected
Alternatives
Cash

Flag positions exceeding the rebalancing band (typically ±3-5%).

Step 3: Trade Recommendations

Generate trades to bring allocation back to target:

Tax-Aware Rebalancing Rules:

  • Prefer rebalancing in tax-advantaged accounts (IRA, Roth) first — no tax consequences
  • In taxable accounts, avoid selling positions with large short-term gains
  • Harvest losses where possible while rebalancing
  • Watch for wash sale rules (30-day window) across all accounts
  • Consider directing new contributions to underweight asset classes instead of trading

Trade List:

AccountActionSecurityShares/$ReasonTax Impact
Buy/SellRebalance / TLHST gain / LT gain / Loss

Step 4: Asset Location Review

Optimize which assets are held in which account types:

  • Tax-deferred (IRA/401k): Bonds, REITs, high-turnover funds (highest tax drag)
  • Roth: Highest expected growth assets (tax-free growth)
  • Taxable: Tax-efficient equity (index funds, ETFs, munis), tax-loss harvesting candidates

Step 5: Implementation

  • Total trades by account
  • Estimated transaction costs
  • Estimated tax impact (realized gains/losses)
  • Net effect on allocation drift

Step 6: Output

  • Drift analysis table
  • Recommended trade list (Excel)
  • Tax impact summary
  • Before/after allocation comparison

Important Notes

  • Don't rebalance for rebalancing's sake — small drift within bands is fine
  • Tax costs can outweigh rebalancing benefits in taxable accounts — calculate the breakeven
  • Consider pending cash flows (contributions, withdrawals, RMDs) before trading
  • Check for any client-specific restrictions (ESG, concentrated stock, lockups)
  • Document rationale for every trade for compliance records
  • Wash sale rules apply across accounts — coordinate trades across the household

Frequently asked questions about Portfolio Rebalance

Similar skills