tw-stock-mod
Reviewed
at commit 244f66c
Caution: Launches whatever Python interpreter a project's .claude/stock-band.json names for a broker route, so opening an untrusted repository with that file can run its code without asking.
Sends data to Yahoo Finance (query1.finance.yahoo.com), Pionex (api.pionex.com), CoinGecko (api.coingecko.com), and opt-in: Taiwan Stock Exchange MIS (mis.twse.com.tw), Sinopac and Capital broker servers
Watchlist band above the Claude Code prompt: Taiwan hours show the Taiwan list (紅漲綠跌), US hours show the US list (綠漲紅跌), in a broker-style table with a Solari…
0 upvotes
Log in to upvote or save- Made by
- Darrell Wang
- Pinned commit
-
244f66caa4ad6f197b7c77867cf7c68d18457c28 - What we checked
-
Draws a stock watchlist above the prompt with live Taiwan, US and crypto prices and an optional profit-and-loss view of your holdings. Prices come from Yahoo Finance, Pionex and CoinGecko for your listed symbols; if you opt in, it starts a read-only Sinopac or Capital broker script that logs in with your saved credentials and stores quotes and positions in ~/.claude/stock-band. It never reads prompts.
Review details
Static review of the source at the pinned commit; not run. register.tsx registers session.start, ui.render (AbovePrompt, terminal only) and ui.message (click hit-tests posted by the hooks/board.tsx Client, validated against the drawn rows). Runtime calls: $.fs.read (its own plugin.json, ~/.claude/stock-band.json, <project>/.claude/stock-band.json, stock-quotes.json and stock-holdings.json in the project .claude/ and in the runtime dir ~/.claude/stock-band/<project-slug>/), $.fs.write (only a heartbeat file in that runtime dir), $.env.get (HOME, USERPROFILE only), $.session.cwd, $.clock.every/now, $.http.fetch, $.process.run, $.ui.resolve/invalidate/log. No $.model calls, no prompt or tool hooks. Network: Yahoo spark/chart endpoints with the watchlist plus held symbols (browser User-Agent), Pionex public tickers (bare GET, filtered locally) and CoinGecko coins/markets (coin ids, at most hourly) only when the crypto board is on screen, and the TWSE MIS endpoint when twSources lists mis; requests are rate-budgeted with backoff, and failures keep the last snapshot or fall back to clearly labelled demo prices. Broker routes are off by default: when twSources lists shioaji or capital, the band runs scripts/fetch-quotes-shioaji.py (via /bin/sh -c nohup ... &) or scripts/fetch-quotes-capital.py (self-detaching DETACHED_PROCESS) with the configured python, passing project, runtime dir, watchlist codes, heartbeat and pidfile; respawn at most once a minute, and the script exits when the heartbeat is older than 90 s. The scripts read SINOBON_API_KEY/SECRET_KEY or CAPITAL_USER_ID/PASSWORD from an env file (default ~/.sinobon.env or ~/.capital.env), log in, read quotes and positions (Shioaji list_positions; Capital GetUserAccount, ReadCertByID and GetProfitLossGWReport for unrealized P&L) and write stock-quotes.json, stock-holdings.json (code, quantity, cost), logs, a pid file and the SDK logs into the runtime dir; neither script places, changes or cancels orders, and credentials are never printed or sent anywhere but the broker login. Config merge is {...user, ...project}, so a project's .claude/stock-band.json overrides twSources, shioaji.python, capital.python, env and dll paths despite the docs recommending the user-level file; that is the reason for the warning. The shioaji wrapper also interpolates the runtime log path (derived from the project path) into a shell string, a minor quoting weakness for unusual directory names. The /stock-band-setup command and the stock-quote-sources skill only guide editing the config and checking symbols against Yahoo; no allowed-tools or permission settings.
- What it uses
-
- Reads your prompts: no
- Sees tool calls: no
- Blocks or changes tool calls: no
- Reads or writes files: yes
- Runs programs on your machine: yes
- Calls the model (uses tokens): no
- Sends data over the network: yes
- Stores data: yes
- Shows something on screen: yes
- Hooked events
Watchlist band above the Claude Code prompt: Taiwan hours show the Taiwan list (紅漲綠跌), US hours show the US list (綠漲紅跌), in a broker-style table with a Solari split-flap footer, plus a 損益 mode (P&L view) for your holdings. 20 symbols a market, 10 on screen at a time. Live prices from Yahoo by default, no key and no account; 永豐 Shioaji (macOS/Linux) and 群益 Capital (Windows) are opt-in real-time routes the band runs itself, tried in your own preference order (twSources) - keep that order and any broker paths in a user-level ~/.claude/stock-band.json so a shared project config stays neutral. Needs function hooks (early access) and an interactive terminal. Zero model tokens.
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/tw-stock-mod/)