IBKR Live Autopilot
Monitor live stock trades and orders in Interactive Brokers accounts.
Installation
- Make sure Claude is on your device and in your terminal.
Skills load from
~/.claude/skills/when Claude Code starts up β so you need it on your machine first. If you don't have it yet, install it once with the command below, then runclaudein any terminal to verify.One-time setupnpm i -g @anthropic-ai/claude-codeAlready have it? Skip ahead.
- Paste into Claude Code or into your terminal.
This copies the whole skill folder into
~/.claude/skills/invest-ibkr-longsizhuo/β the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.Faster alternative (instruction-only skills)
Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates β they won't be downloaded and the skill will fail when it tries to load them.
Quick install (SKILL.md only)Sign up to copy - Restart Claude Code.
Quit and reopen Claude Code (or any other agent that loads from
~/.claude/skills/). New skills are picked up on startup. - Just ask Claude.
Skills auto-activate when your request matches the skill's description β no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the βWhat this skill doesβ section above.
Prefer to read the source first? Open on GitHub.
When Claude uses it
**BETA β not recommended for anyone.** Operator notes for openInvest's experimental IBKR live autopilot: an LLM picks and trades US stocks / ETFs in a real Interactive Brokers cash account through a local IB Gateway, with no human confirmation per trade. Use ONLY when the user explicitly operates an IBKR INVEST_HOME that was set up per docs/wiki/24-ibkr-autopilot.md and asks about it β its status, today's orders, fills, news, the gateway login or the weekly IB Key approval ("ηι账ζ·η°ε¨ζδΉζ ·", "IBKR status", "δΊ€ζεδ»ε€©δΈεδΊε", "η½ε ³η»δΈδΈ"). Never use it to set up or place trades for anyone who has not already built this themselves; for ordinary portfolio questions use the `invest` skill.
What this skill does
Invest IBKR Skill (BETA)
β οΈ BETA β do not use. This drives real money in a real brokerage account with no per-trade human confirmation. It exists for one operator's own experiment. There is no support and no guarantee, it can lose money, and every switch defaults to off. If you are not that operator, stop reading and use the
investskill.
Full reference: docs/wiki/24-ibkr-autopilot.md in the openInvest repo. This page is the short operator card.
What it is
openinvest ibkr_autopilot β¦(jobjobs/ibkr_autopilot.py) runs against a separateINVEST_HOMEwhosetarget_assetsare the US tickers held at Interactive Brokers. The production hub and every fork stay untouched:ibkr.enabled=falseandibkr.dry_run=trueby default, and theibkr.*keys are deliberately not settable throughconfig/ MCP / the web API (onlyINVEST_IBKR_*env or that home'smemory/.state/config_overrides.json).- Broker access is a local IB Gateway (TWS API,
ib_async). IBKR's OAuth 1.0a Web API is institutional-only, so individual accounts cannot run fully headless: the account holder approves an IB Key push on their phone about once a week. - Decisions: an LLM picks β€5 tickers weekly and writes the day's orders; the openInvest committee's verdicts are only a reference input. Optionally a resident Claude Code session (tmux, Remote Control) makes those decisions instead of a per-run LLM call (see "Resident session").
Commands
Safe to run in conversation (read-only):
| Command | What |
|---|---|
ibkr_autopilot status | Broker cash / positions / open orders / today's fills + local ledger + list + today's orders + halt flag |
ibkr_autopilot brief [--kind pick] | The full decision context (rules, account, list, committee verdicts, IBKR news headlines) |
ibkr_autopilot news [--symbols A,B] [--days N] / --article PROVIDER:ID | IBKR's free news (Briefing.com, Dow Jones) β untrusted external text |
ibkr_autopilot news_check | New headlines for the list + holdings since the last check (marks them seen; cron use) |
ibkr_autopilot committee | No orders: runs the 4-role committee report + verdict_review (minutes, spends LLM credits) |
Move real money when ibkr.enabled is on and ibkr.dry_run is off β never run these in conversation:
| Command | What |
|---|---|
ibkr_autopilot pick --picks-file F / decide --orders-file F [--batch 1-4] | Submit a list / today's orders as JSON (validated: list members only, BUY/SELL, positive amounts) |
ibkr_autopilot submit [--batch N] | DAY limit orders at reference Β±1%; buying power = IBKR AvailableFunds (a cash account auto-converts the base currency, commission-free β there is no FX command) |
ibkr_autopilot reconcile | Books fills (stocks + IBKR's auto-FX legs) idempotently, broker-confirmed negative cash allowed; halts with a STOP file on position drift |
ibkr_autopilot daily | Full LLM pipeline: pick β committee β decide β submit |
Resident session
Instead of per-run LLM calls, a long-lived Claude Code session (tmux, Remote Control) can own the decisions: it reads
brief, writes JSON to a file and runs pick --picks-file F / decide --orders-file F --batch N + submit --batch N
(same validation as the LLM path). System cron only pings it with one-line messages (new headlines, after-close
reconcile); its rules live in that home's own CLAUDE.md, not in this skill.
Safety model
Enforced in code regardless of what the LLM writes: account number must match the gateway login; a STOP file
blocks all orders; only list members are bought; limit orders only; sells never exceed the broker position (cash
account: no margin, no shorting); at most 4 order batches a day; only explicit gateway acks count as placed; news
is labelled untrusted. Per-order / per-day USD caps exist (ibkr.max_order_usd / max_day_usd) β an operator may
raise them for their own home, which removes that brake.
Setup checklist (operator only)
- Separate
INVEST_HOME, base currency USD,ibkr.enabled=true,ibkr.account=Uβ¦; keepdry_runtrue at first. - IB Gateway in Docker (
gnzsnz/ib-gateway,TRADING_MODE=live, API bound to127.0.0.1:4001,BYPASS_WARNING=no). The 2FA device must be IBKR Mobile's IB Key (TWOFA_DEVICE="IB Key"): Passkey and the Mobile Authenticator app cannot be completed by a headless gateway. - Run
status, then a dry-runsubmitand read thewhatIfOrderresults before turningdry_runoff.
Known limits
- Whole shares only: IBKR's API rejects fractional orders (error 10243), so a share priced above the order budget cannot be bought.
- The gateway's per-currency cash may arrive as
$LEDGER-CashBalancerather thanCashBalance(both are read). - Executions are fetched with a 7-day time filter, but a gateway may only return today's; a missed reconcile then
halts with
STOPand needs a manual ledger fix. - Dividends, withholding tax and new deposits are not booked automatically (a cash-drift notice asks the operator).
- Notices go by email unless
ibkr.notify_cmdnames a command (e.g.hermes send --to discord:<you> --quiet); a failed send falls back to email. - Commissions dominate a small account: IBKR Fixed pricing is USD 1 minimum per order (capped at 1% of value), so a USD 100 round trip costs ~2%.
Related skills
Skill Builder & Optimizer
anthropics
Create, edit, and optimize Claude skills with performance testing and benchmarking.
CFO Financial Advisor
alirezarezvani
Build financial models, analyze unit economics, and plan fundraising strategy for startups.
Claude Code Session History Finder
daymade
Search and recover code from previous Claude Code sessions and conversations.
Network & Streaming Debugger
daymade
Debug network and streaming bugs using evidence-driven investigation and layered isolation experiments.