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

.claude/commands/trade.md

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

A command for recording completed investment trades from natural-language descriptions in a holdings file and an audit log.

In plain words
What is it for?
Use it after buying or selling shares to record the action, ticker, quantity, price, account, date, and currency, including additions, trims, and closing positions.
Why use it?
It reduces manual bookkeeping by extracting the trade details, updating average cost basis, checking holdings before sales, and asking about missing critical information.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. 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/trade.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 trade

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/haiiibin/claude-multi-agent-investing/trade"><img src="https://agentmods.dev/badge/commands/haiiibin/claude-multi-agent-investing/trade.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 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,439 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.00032 $0.01439
Opus 5 $0.00016 $0.00720
Sonnet 5 $0.00006 $0.00288
Haiku 4.5 $0.00003 $0.00144

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

Security

Grade A, and why

trade 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 10d 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/trade.md · 98 lines

How it starts

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

/trade -- Sync Completed Trade

Record a trade the user executed on their broker platform. Updates holdings.json and logs to memory/long_term/trades.md for audit trail.

Input

Natural language from $ARGUMENTS, examples:

  • 昨天在 broker-a-taxable 买了 20 股 NVDA @ $195
  • sold 50 AAPL from broker-a-taxable at $182 today
  • TFSA 加仓 SHOP.TO 30 股 @CAD$175, 成本摊到均价
  • trim half of MSFT in broker-a-taxable at $420

Steps

  1. Parse the trade. Extract:

    • Action: buy / sell / add / trim / close
    • Ticker -- normalize class-share suffix: BRK.B / BRK/BBRK-B, BF.BBF-B (yfinance quirk per CLAUDE.md). Store the yfinance-valid form in holdings.json.
    • Shares
    • Price
    • Account (match to holdings.json account_id -- or ask if ambiguous)
    • Date (default today if not specified)
    • Currency (infer from account's base_currency)
  2. Ask once if critical info missing. Don't over-ask. If user wrote "bought NVDA in broker-a-taxable" without shares/price, ask one question: "How many shares and at what price?"

  3. Validate.

    • If selling, does the account actually hold this ticker + enough shares?
    • If TFSA buy of high-yield US stock → flag the withholding trap before proceeding. Sanity-check yfinance dividendYield per CLAUDE.md quirks: divide by 100 if > 15%, or recompute from trailingAnnualDividendRate / currentPrice. Don't flag trap on a false-high yield number.
    • If position size after trade crosses a concentration tier (see CLAUDE.md: ≤7% neutral, 7-12% flag, 12-20% DRAFT, >20% HIGH-RISK) → note the tier in confirmation. Trades don't block -- /trade records what already happened.
    • If buying with insufficient cash in the account → flag and ask whether to deduct from cash or assume deposit arrived
  4. Update holdings.json.

    IMPORTANT -- Canadian ACB is pooled across ALL accounts for the same identical property. CRA treats identical property held in multiple accounts as ONE pool for cost basis purposes. This means:

Read the full file on GitHub · 98 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. 10d ago First seen · 98 lines · 32 tokens per session scan A 7928d7a8925d

Subscribe to this mod's changes

trade is a command published in the GitHub repository haiiibin/claude-multi-agent-investing (2 stars, last pushed 19d ago), licensed MIT. It adds 32 tokens to every session and 1,439 once invoked, about $0.0002 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.