portfolio-report

portfolio-report is a skill for Claude Code, Codex from oh-rid/claude-code-plugin-ib. It costs 67 tokens per session (1,214 once invoked), scanned A, original, MIT.

A skill that creates a short portfolio snapshot from live Interactive Brokers data, including profit and loss, holdings, allocation, cash, and risk measures.

In plain words
What is it for?
Generating portfolio summaries, position lists, account overviews, profit-and-loss reports, currency breakdowns, and margin-related metrics.
Why use it?
It gathers account details and calculates the main figures in one concise report instead of requiring manual checks across several data sources.

Skill for Claude CodeCodex

Part of the ib-portfolio-management plugin — 6 skills, 1 command, 1 agent, 2 hooks shipped together

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.

agentmods
npx agentmods add skills/oh-rid/claude-code-plugin-ib/portfolio-report
Any agent
npx skills add oh-rid/claude-code-plugin-ib --skill portfolio-report
Clone the repo
git clone --depth 1 https://github.com/oh-rid/claude-code-plugin-ib

Made for: Claude Code, Codex.

Or install ib-portfolio-management, the plugin that ships this one along with the rest of its 6 skills, 1 command, 1 agent, 2 hooks.

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 portfolio-report

README.md
[![agentmods](https://agentmods.dev/badge/skills/oh-rid/claude-code-plugin-ib/portfolio-report.svg)](https://agentmods.dev/skills/oh-rid/claude-code-plugin-ib/portfolio-report)
Your own site
<a href="https://agentmods.dev/skills/oh-rid/claude-code-plugin-ib/portfolio-report"><img src="https://agentmods.dev/badge/skills/oh-rid/claude-code-plugin-ib/portfolio-report.svg" alt="Measured on agentmods" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,214 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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.00067 $0.01214
Opus 5 $0.00034 $0.00607
Sonnet 5 $0.00013 $0.00243
Haiku 4.5 $0.00007 $0.00121

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

Security

Grade A, and why

portfolio-report scanned grade A with 1 finding 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 5d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sk https://localhost:5000/v1/api/tickle
skills/portfolio-report/SKILL.md · 142 lines

How it starts

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

Portfolio Report — Solo Trader

Pull live IB account data and produce a one-page portfolio snapshot. Not a 10-page client report. A trader's dashboard in markdown.

Workflow

Step 0: Session check

curl -sk https://localhost:5000/v1/api/tickle

Step 1: Get account ID

curl -sk https://localhost:5000/v1/api/portfolio/accounts

Step 2: Account summary

curl -sk "https://localhost:5000/v1/api/portfolio/$ACCT/summary"

Extract:

  • NLV (Net Liquidation Value)
  • Buying power (available margin or cash)
  • Gross position value
  • Maintenance margin (if on margin)
  • Cushion (excess liquidity / NLV — how far from margin call)

Step 3: Pull all positions

curl -sk "https://localhost:5000/v1/api/portfolio/$ACCT/positions/0"

For each position: ticker, assetClass, position (qty), mktValue, avgCost, avgPrice, unrealizedPnl, realizedPnl, currency.

Step 4: Currency breakdown

curl -sk "https://localhost:5000/v1/api/portfolio/$ACCT/ledger"

Shows cash balances per currency and settled/unsettled.

Step 5: Calculate derived metrics

All via python3 -c:

  • Total unrealized P&L = sum of all unrealizedPnl
  • Total realized P&L = sum of all realizedPnl
  • Concentration = largest position mktValue / NLV (flag if > 25%)
  • Position count = number of open positions
  • Long/short split = sum of long mktValue vs short mktValue
  • Asset class breakdown = aggregate mktValue by assetClass (STK, OPT, FUT, CASH, BOND)

Step 6: Identify notable positions

Flag:

  • Biggest winner: position with highest unrealizedPnl
  • Biggest loser: position with most negative unrealizedPnl
  • Most concentrated: position with highest % of NLV
  • Deep underwater: any position with > 20% loss

Output format

One markdown block, max 1 page:

## Portfolio Snapshot — {date} {time}

### Account: {account_id}

| Metric           | Value     |
|------------------|-----------|
| Net Liquidation  | $XXX,XXX  |
| Buying Power     | $XX,XXX   |
| Margin Used      | $XX,XXX   |
| Cushion          | XX%       |
| Unrealized P&L   | +$X,XXX   |
| Realized P&L     | +$X,XXX   |
| Open Positions   | XX        |

### Allocation

| Asset Class | Value     | % of NLV |
|-------------|-----------|----------|
| Stocks      | $XXX,XXX  | XX%      |
| Options     | $X,XXX    | X%       |
| Cash        | $XX,XXX   | XX%      |

### Positions (by size)

| Ticker | Qty  | Mkt Value | Unreal P&L | % of NLV | % P&L  |
|--------|------|-----------|------------|----------|--------|
| AAPL   | 100  | $17,500   | +$1,200    | 12%      | +7.4%  |
| ...    |      |           |            |          |        |

### Notable
- Biggest winner: {ticker} (+${pnl}, +X%)
- Biggest loser: {ticker} (-${pnl}, -X%)
- Concentration: {ticker} at {X}% of NLV {warning if >25%}

### Cash by Currency
| Currency | Settled  | Total    |
|----------|----------|----------|
| USD      | $XX,XXX  | $XX,XXX  |

Read the full file on GitHub · 142 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. 5d ago First seen · 142 lines · 67 tokens per session scan A 89c0aab6f1a0

Subscribe to this mod's changes

portfolio-report is a skill published in the GitHub repository oh-rid/claude-code-plugin-ib (5 stars, last pushed 3mo ago), licensed MIT. It adds 67 tokens to every session and 1,214 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.