china-tax-year-end-plan

china-tax-year-end-plan is a command for Claude Code from Esonhugh/ibkr-trade-analyzer. It costs 17 tokens per session (953 once invoked), scanned A, original, MIT.

A command for reviewing an Interactive Brokers portfolio and tax records for year-end overseas-investment tax planning by a China tax resident.

In plain words
What is it for?
Preparing a year-end review of brokerage activity, foreign tax credits, withholding, documentation, and cost-basis quality.
Why use it?
It organizes tax evidence, identifies missing records, checks withholding and cost basis, and models scenarios without presenting final tax or investment advice.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the ibkr-trade-analyzer plugin — 2 skills, 7 commands, 1 MCP server shipped together

Good fit Preparing a year-end review of brokerage activity, foreign tax credits, withholding, documentation, and cost-basis quality.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Esonhugh/ibkr-trade-analyzer
Claude Code
/plugin install ibkr-trade-analyzer

Made for: Claude Code.

Or install ibkr-trade-analyzer, the plugin that ships this one along with the rest of its 2 skills, 7 commands, 1 MCP server.

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 china-tax-year-end-plan

README.md
[![agentmods](https://agentmods.dev/badge/commands/esonhugh/ibkr-trade-analyzer/china-tax-year-end-plan/github.svg)](https://agentmods.dev/commands/esonhugh/ibkr-trade-analyzer/china-tax-year-end-plan)
Your own site
<a href="https://agentmods.dev/commands/esonhugh/ibkr-trade-analyzer/china-tax-year-end-plan"><img src="https://agentmods.dev/badge/commands/esonhugh/ibkr-trade-analyzer/china-tax-year-end-plan/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 china-tax-year-end-plan

Your own site · 80×15
<a href="https://agentmods.dev/commands/esonhugh/ibkr-trade-analyzer/china-tax-year-end-plan"><img src="https://agentmods.dev/badge/commands/esonhugh/ibkr-trade-analyzer/china-tax-year-end-plan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 953 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.00017 $0.00953
Opus 5 $0.00009 $0.00477
Sonnet 5 $0.00003 $0.00191
Haiku 4.5 $0.00002 $0.00095

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

Security

Grade A, and why

china-tax-year-end-plan 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.

commands/china-tax-year-end-plan.md · 66 lines

How it starts

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

Use the china-tax skill as the primary official-source evidence and tax-planning workflow reference.

Generate a year-end tax planning review for China resident overseas brokerage activity. Focus on documentation, evidence gaps, foreign tax credit readiness, withholding sanity checks, cost-basis quality, and scenario modeling. This is not final tax or investment advice.

Workflow

  1. Consult skills/china-tax/references/official-tax-rules-and-implementation-plan.md for official-source rules, overseas income management considerations, foreign tax credit constraints, and planning guardrails.
  2. Determine the tax year and planning focus from $ARGUMENTS; if absent, ask one clarifying question before choosing a tax year.
  3. Confirm or state the user-provided assumption that the review is for a China tax resident individual; do not determine residency independently.
  4. Recheck official-source freshness for the relevant tax year, or flag the reference date as a limitation.
  5. Load current IBKR data:
    • If the user provided a local file path, call ibkr_fetch_data(mode="file", source="<path>").
    • Otherwise call ibkr_fetch_data(mode="flex").
  6. Call:
    • ibkr_portfolio for current holdings, cash, concentration, and currency exposure.
    • ibkr_cost_analysis for dividends, withholding tax, interest, fees, and tax-evidence readiness.
    • ibkr_pnl_summary for realized P&L context.
    • ibkr_analyze(sections=["diluted_cost"]) if cost basis or breakeven quality is important.
  7. Separate observations into:
    • Evidence readiness
    • Foreign tax credit readiness
    • Treaty withholding sanity checks
    • Cost-basis / tax-lot review
    • Year-end scenario modeling items
  8. Phrase every planning item as a neutral review point, not a buy/sell or filing directive.

Script Usage

When the user provides local evidence files and shell execution is available, provide this command for the user to run with planning mode in skills/china-tax/scripts/china_tax_self_check.py:

Read the full file on GitHub · 66 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 · 66 lines · 17 tokens per session scan A 45c9a17a6482

Subscribe to this mod's changes

china-tax-year-end-plan is a command published in the GitHub repository Esonhugh/ibkr-trade-analyzer (18 stars, last pushed 3mo ago), licensed MIT. It adds 17 tokens to every session and 953 once invoked, about $0.0001 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-30.