Quant · 2026 · Running weekly

Adversarial-LLM Stock Screener

Once a week the script picks a list of small-cap stocks, hands the same data to two Claude sessions — one told to argue bull, one bear — and a third Claude reconciles their cases into a buy/sell/hold. The recommendation lands in a Gmail draft. I read it and decide.

Quant · AI Python Claude CLI yfinance Gmail API
CadenceWeekly
AgentsBull · Bear · PM
UniverseUS small caps
OutputGmail draft

What it is

Asking one AI for stock advice is a recipe for confident-sounding nonsense — it'll find a way to rationalise whatever you point it at. So instead, every week the script splits the work in three: one Claude argues why each stock is a buy, a separate Claude argues why it's a sell, and a third Claude (the "PM") sees both arguments and writes a recommendation. If the PM can't reconcile them, the call is do nothing.

Output is a Gmail draft sitting in my inbox by Monday. I read it, decide whether I agree, and either trade or don't. The script doesn't move money — it argues with itself so I don't have to.

How it works

Five stages, run by a single Python orchestrator on a weekly schedule:

  • Screen. yfinance pulls the small-cap universe and filters on valuation, momentum, and volume.
  • Build prompt. Market context, overnight news, current portfolio state, and screener output get assembled into a single brief.
  • Bull session. A Claude CLI subprocess is told to argue the bull case for each shortlisted ticker.
  • Bear session. A separate Claude subprocess gets the same prompt with no access to the bull session's output — independent reasoning.
  • PM session. A third Claude subprocess receives both theses (full text, not summaries — session IDs are piped through), the current holdings, and conviction labels. It writes the recommendation.

Email goes to Gmail via the Gmail API. State sits in portfolio.json; trades are journaled to trades_log.json. run_weekly.bat on a Windows scheduler.

Where it's at

Running weekly. The pipeline is the easy part — execution discipline (actually following the recommendations or not) is what determines whether it ever shows up as performance. Honest read: right now it's a forced-disagreement journal, not a strategy.