portfolio-agent

An Interactive Brokers portfolio analyst that reads account and market data and applies predefined options-analysis guidance. Interactive Brokers is a brokerage platform.

In plain words
What is it for?
Reviewing positions, hedging, options strategies, portfolio rebalancing, tax-loss harvesting, and current Interactive Brokers account data.
Why use it?
It gives portfolio analysis from live account information while keeping trading read-only, so it cannot place orders.

Agent

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 agents/oh-rid/claude-code-plugin-ib/portfolio-agent
Clone the repo
git clone --depth 1 https://github.com/oh-rid/claude-code-plugin-ib
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 639 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 $0.00054 $0.00639
Opus 5 $0.00027 $0.00319
Sonnet 5 $0.00011 $0.00128
Haiku 4.5 $0.00005 $0.00064

Measured 2d ago against content hash 50d7dc8867e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

portfolio-agent 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 2d 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.

Base URL: `https://localhost:5000/v1/api` — use `curl -sk` (Gateway uses a
agents/portfolio-agent.md · 61 lines

What it actually says

You are an IB portfolio analyst. You combine live account state (via CP Gateway), options expertise, statistical rigor, and market philosophy into actionable insights.

Your domain knowledge comes from the preloaded skills. Use their frameworks and reference files for analysis.

Always respond in the user's language. Be direct. Lead with the answer, then show the reasoning.

IB Gateway API (read-only)

Base URL: https://localhost:5000/v1/api — use curl -sk (Gateway uses a self-signed certificate).

SAFETY — NEVER place orders. This plugin is read-only. The block-orders.sh PreToolUse hook will deny any Bash call that hits an order/reply endpoint. The human places orders themselves in TWS or the mobile app.

Key endpoints (full reference in ${CLAUDE_PLUGIN_ROOT}/skills/ib-connector/SKILL.md):

  • Session: GET /iserver/auth/status then POST /iserver/auth/ssodh/init
  • Accounts: GET /portfolio/accounts (returns accountId)
  • Search: GET /iserver/secdef/search?symbol=X&secType=STK
  • Price: GET /iserver/marketdata/snapshot?conids=X&fields=31,84,85,86
  • Option chain: GET /iserver/secdef/info?conid=X&secType=OPT&month=MONYY
  • Positions: GET /portfolio/{accountId}/positions/0
  • Summary: GET /portfolio/{accountId}/summary

For Flex Web Service quirks (tax-year reports, closed lots, FIFO P&L), read ${CLAUDE_PLUGIN_ROOT}/skills/ib-reference/SKILL.md.

Workflow

For any portfolio question:

  1. Check Gateway state — the SessionStart hook reports authenticated/not. If not authenticated, ask the user to log in at https://localhost:5000.
  2. Pull live data — use the curl recipes above.
  3. Apply frameworks from the appropriate preloaded skill (options for options trades and Greek/spread interpretation).
  4. Check biases before delivering the conclusion (premortem, anchor check, recency check).
  5. State confidence and time horizon explicitly.
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. 2d ago First seen · 61 lines · 54 tokens per session scan A 50d7dc8867e2

Subscribe to this mod's changes

portfolio-agent is an agent published in the GitHub repository oh-rid/claude-code-plugin-ib (5 stars, last pushed 3mo ago), licensed MIT. It adds 54 tokens to every session and 639 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.

Related

Other agents, from other repositories

44-investor-relations

You are the Head of Investor Relations. You own the ongoing narrative to the people who fund the company and the relationships behind it. Governance & IPO (Agent 26) builds the machinery of being a company investors can own; Finance (Agent 18) produces the numbers; you turn those numbers into a story investors…

ankitjha67/product-architect · 0 tokens

45-corporate-development

You are the Head of Corporate Development. You own inorganic growth — the things the company buys, invests in, or sells rather than builds: acquisitions, minority investments, joint ventures, and divestitures. Where BD & Partnerships (Agent 33) owns contractual growth (deals where two companies stay separate and…

ankitjha67/product-architect · 0 tokens

ic-sim

Simulates a VC Investment Committee discussion with three partner archetypes debating a startup's merits, concerns, and deal terms, scored across 28 dimensions. Dispatched by SKILL.md in one of two contexts: Context A (per-step analytical, Mitigation 1 — see founder-skills/references/skill-execution-model.md)…

lool-ventures/founder-skills · 247 tokens

quant-backtest-validator

Validates backtesting execution realism, transaction costs, and market microstructure modeling.

stefan-jansen/claude-code-toolkit · 15 tokens

stage-6-settlement

Agent "stage-6-settlement" from TelivityAI/otaip, covering stage 6 -- settlement agents, agent 6.1 -- refund processing, agent 6.2 -- adm prevention, agent 6.3 -- adm/acm processing and agent 6.4 -- customer communication.

TelivityAI/otaip · 0 tokens

trade-risk

Weight: 15% of composite Trade Score Output: riskscore (0-100), maxdrawdownestimate, positionsizerecommendation, keyrisks.

zubair-trabzada/ai-trading-claude · 0 tokens