claude-multi-agent-investing: Command for Claude Code

.claude/commands/tax-harvest.md

tax-harvest is a command for Claude Code from haiiibin/claude-multi-agent-investing. It costs 50 tokens per session (1,793 once invoked), scanned A, original, MIT.

A Canadian tax-loss harvesting planner that finds losing investments in taxable accounts and suggests non-identical replacements.

In plain words
What is it for?
Use it to review eligible losses, estimate possible tax benefits, consider replacement investments, and account for carryback or carryforward rules. TFSA positions are excluded.
Why use it?
It checks the superficial-loss rule, which can deny a tax loss when the same or an identical investment is bought in an affiliated account within the surrounding 60-day period.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; positional $N argument.

This is haiiibin/claude-multi-agent-investing's own configuration. It tells Claude Code how to work on claude-multi-agent-investing itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-multi-agent-investing configures →

Reuse

Borrowing it

Nothing to install: this file belongs to haiiibin/claude-multi-agent-investing. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/haiiibin/claude-multi-agent-investing/main/.claude/commands/tax-harvest.md
Clone the repo
git clone --depth 1 https://github.com/haiiibin/claude-multi-agent-investing

Made for: Claude Code.

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 tax-harvest

README.md
[![agentmods](https://agentmods.dev/badge/commands/haiiibin/claude-multi-agent-investing/tax-harvest/github.svg)](https://agentmods.dev/commands/haiiibin/claude-multi-agent-investing/tax-harvest)
Your own site
<a href="https://agentmods.dev/commands/haiiibin/claude-multi-agent-investing/tax-harvest"><img src="https://agentmods.dev/badge/commands/haiiibin/claude-multi-agent-investing/tax-harvest/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 tax-harvest

Your own site · 80×15
<a href="https://agentmods.dev/commands/haiiibin/claude-multi-agent-investing/tax-harvest"><img src="https://agentmods.dev/badge/commands/haiiibin/claude-multi-agent-investing/tax-harvest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,793 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 original No closer match found 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.00050 $0.01793
Opus 5 $0.00025 $0.00897
Sonnet 5 $0.00010 $0.00359
Haiku 4.5 $0.00005 $0.00179

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

Security

Grade A, and why

tax-harvest 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 12d 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.

.claude/commands/tax-harvest.md · 129 lines

How it starts

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

/tax-harvest -- Canadian Tax-Loss Harvest

Advisory only. Advisory only. Most useful Nov-Dec; works year-round.

Canadian rules enforced

  1. Superficial loss (ITA 54): buy same/identical property within 30 days before OR after sale in ANY affiliated account (TFSA, RRSP, spouse, controlled corp) → loss denied and added to ACB of replacement. 60-day window total.
  2. Identical property: judgment call, not a hardcoded list. Walk the Phase 3 decision tree. Clear-identical examples: cross-listed pairs (BAM ↔ BAM.TO), same-issuer same-index ETFs (VFV.TO ↔ VOO). Grey-zone (likely identical per practitioner consensus even without case law): SPY ↔ IVV ↔ VOO.
  3. T+1 settlement (since May 2024). Last trade day for 2026 tax year = Dec 30.
  4. ACB pooled across ALL accounts for identical property.
  5. Capital losses offset capital gains only. Carry back 3yr / forward indefinitely.

Phase 1 -- Audit

Filter holdings.json to account_type: taxable (skip TFSA + RRSP).

Per holding: unrealized gain/loss (native + CAD), holding period. Apply safe_yield check (CLAUDE.md). Flag stale cost basis per split-detection rule.

Phase 2 -- Candidate identification

For each loss position:

  1. Threshold: ignore losses <$500 CAD (friction not worth it) unless user overrides
  2. 60-day window BOTH directions:
    • Past 30 days: check memory/long_term/trades.md for buys of this ticker in any account → if found, SKIP (loss already superficial)
    • Next 30 days: check memory/long_term/journal.md for "waiting for {ticker}" plans, GTC limits, DRIP schedules → require explicit user confirmation "I will NOT buy within 30 days"
    • DRIP trap: if ex-div date is within next 30 days AND DRIP enabled, auto-reinvest IS the affiliated buy. Loudly flag.
    • Any hit → loss is denied + added to replacement ACB (user benefits eventually, just not this year)
  3. Cross-account ACB: if held in other accounts at a gain, pooled ACB partially offsets. State explicitly.
  4. Gain-harvesting companion (optional): if taxable has large gains, pairing a gain sale with a loss sale is tax-neutral rebalancing. Useful for moving winners (sell in taxable → contribute to TFSA next year).

Read the full file on GitHub · 129 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. 12d ago First seen · 129 lines · 50 tokens per session scan A e248e3386b1d

Subscribe to this mod's changes

tax-harvest is a command published in the GitHub repository haiiibin/claude-multi-agent-investing (2 stars, last pushed 21d ago), licensed MIT. It adds 50 tokens to every session and 1,793 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.