smart-rebalance

smart-rebalance is a skill for Claude Code, Codex from kayzaa/k.i.t.-bot. It costs 0 tokens per session (750 once invoked), scanned A, a copy of smart-rebalance, MIT.

A portfolio rebalancing tool that moves assets back toward chosen percentage targets. It can account for taxes, trading fees, gas fees, market hours, and volatility when deciding whether to trade.

In plain words
What is it for?
It is for maintaining target allocations, scheduling regular rebalances, and identifying tax-loss harvesting opportunities. Tax-loss harvesting means selling an asset at a loss to potentially reduce taxable gains, subject to local rules.
Why use it?
It removes the need to calculate portfolio drift and decide manually when a rebalance is worth its costs or tax impact.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit It is for maintaining target allocations, scheduling regular rebalances, and identifying tax-loss harvesting opportunities. Tax-loss harvesting means selling an asset at a loss to potentially reduce taxable gains, subject to local rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kayzaa/k.i.t.-bot/smart-rebalance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kayzaa/k.i.t.-bot --skill smart-rebalance
Clone the repo
git clone --depth 1 https://github.com/kayzaa/k.i.t.-bot

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for smart-rebalance

README.md
[![agentmods](https://agentmods.dev/badge/skills/kayzaa/k.i.t.-bot/smart-rebalance/github.svg)](https://agentmods.dev/skills/kayzaa/k.i.t.-bot/smart-rebalance)
Your own site
<a href="https://agentmods.dev/skills/kayzaa/k.i.t.-bot/smart-rebalance"><img src="https://agentmods.dev/badge/skills/kayzaa/k.i.t.-bot/smart-rebalance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for smart-rebalance

Your own site · 80×15
<a href="https://agentmods.dev/skills/kayzaa/k.i.t.-bot/smart-rebalance"><img src="https://agentmods.dev/badge/skills/kayzaa/k.i.t.-bot/smart-rebalance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 750 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00750
Opus 5 $0.00000 $0.00375
Sonnet 5 $0.00000 $0.00150
Haiku 4.5 $0.00000 $0.00075

Measured 8d ago against content hash 04920b134ef9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

smart-rebalance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to smart-rebalance — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/smart-rebalance/SKILL.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Smart Rebalance Bot

AI-powered portfolio rebalancing with tax awareness.

Overview

Like Pionex Rebalancing Bot, but smarter: considers taxes, gas fees, and market conditions before making moves.

Rebalancing Strategies

1. Threshold Rebalancing

targets:
  BTC: 40%
  ETH: 30%
  SOL: 20%
  USDC: 10%

threshold: 5%  # Rebalance when >5% drift

# Current: BTC 48%, ETH 28%, SOL 16%, USDC 8%
# Action: Sell 8% BTC, buy 4% SOL, buy 2% USDC

2. Calendar Rebalancing

schedule: monthly  # weekly, monthly, quarterly
day: 1            # First of month
time: "09:00"     # After market opens

3. Smart Rebalancing

mode: smart
considerations:
  - tax_lots: true      # Sell highest cost basis first
  - gas_threshold: $10  # Skip if gas > $10
  - min_trade: $50      # Don't rebalance tiny amounts
  - market_hours: true  # Avoid weekends
  - volatility: true    # Pause during high vol

Tax-Loss Harvesting

Opportunity Found:
├── Asset: SOL
├── Cost Basis: $120
├── Current Price: $95
├── Loss: -$25/coin (208 coins = -$5,200)
├── Tax Savings: ~$1,560 (at 30% rate)
└── Action: Sell SOL, buy similar asset (AVAX)

Wait 30 days → Buy back SOL (wash sale rule)

Fee Optimization

Rebalance Plan:
├── Direct Route: 3 trades, $45 fees
├── Optimized Route: 2 trades via ETH, $28 fees
└── Savings: $17 ✓

Also considering:
├── Batch with pending trades
├── Use limit orders (maker fees)
└── Wait for lower gas (evening)

Risk Parity Mode

mode: risk_parity
target_vol: 15%  # Portfolio volatility target

# Automatically adjusts weights based on:
# - Asset volatility (more volatile = less weight)
# - Correlation (diversification bonus)
# - Current market regime

Drift Alerts

📊 Portfolio Drift Report

BTC: 40% → 46% (+6%) ⚠️ Over threshold
ETH: 30% → 32% (+2%) ✓ OK
SOL: 20% → 14% (-6%) ⚠️ Under threshold
USDC: 10% → 8% (-2%) ✓ OK

Suggested Action: Rebalance (est. cost: $12)

Commands

kit rebalance preview  # Show what would change
kit rebalance execute  # Run rebalance
kit rebalance set --btc 40 --eth 30 --sol 20 --usdc 10
kit rebalance schedule --frequency monthly
kit rebalance tax-harvest  # Find tax loss opportunities
kit rebalance history  # Past rebalances

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 106 lines · 0 tokens per session scan A 04920b134ef9

Subscribe to this mod's changes

smart-rebalance is a skill published in the GitHub repository kayzaa/k.i.t.-bot (5 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 750 tokens. A static security scan graded it A with 0 findings. It is 100% identical to smart-rebalance, differing in 0 lines, and is treated as a copy.