QuantClaw

Open-source campaign-driven agent harness for quantitative trading.

TWELVE CREWMATES·ONE TRADING FLOOR·PAPER-FIRST SAFETY

THE ROSTER

Twelve Crewmates on the Floor

Every agent has a scoped job declared in a single manifest. The planner reads it, the dispatcher runs it, and you watch it on the trading floor.

Click any crewmate to see what it does

CAPABILITIES

What the Harness Actually Does

AGENTS

12 Specialists, One Floor

Each agent has a scoped job, declared inputs/outputs, and a matching crewmate on the dashboard trading floor — complete with breathing, blinking, and species-specific idle animations.

ROUTING

Multi-Provider LLM Routing

Anthropic, OpenAI, Google Gemini, and local Ollama — swap providers in config, not code. OAuth via a Node.js sidecar means Claude Code / Codex / Gemini CLI logins just work.

CAPITAL SAFETY

Paper-First Campaigns

Broad goals like "go make me cash" compile into a paper-first state machine. The campaign only advances to paper after a held-out validation gate, and pauses on drawdown breach — not arbitrary cycle limits.

CODE SAFETY

Sandboxed Factor Execution

LLM-generated factor and training code runs in subprocess-isolated sandboxes with AST-enforced import whitelists, blocked dunder access, env-var stripping, and resource caps.

DATA

20 Built-in Data Sources

Twelve free (Yahoo Finance, FRED, SEC EDGAR, World Bank, IMF, BLS, Treasury, ECB, BIS, CFTC, OpenInsider, Stooq) plus eight API-key sources (Alpha Vantage, Finnhub, FMP, SimFin, Tiingo, Twelve Data, Nasdaq, EIA). One range-aware parquet cache shared across them all.

DISCOVERY

Shadow Search in Paper Phase

While one strategy runs in paper, the discovery pipeline continues in the background every Nth cycle. The allocator arbitrates incumbent-vs-challenger on each rebalance, so you never stop looking for better alpha.

OBSERVABILITY

Typed Event Bus & Cost Tracking

Every agent action is a typed event. Router tracks LLM tokens per call, per agent, per model — fires cost.budget_warning on threshold cross, routed to Telegram / Discord / Slack by urgency.

PERSISTENCE

Append-Only Memory with Compaction

Playbook is a JSONL log every agent writes to. Compaction keeps latest-per-key snapshots and archives the tail to gzip so restart stays fast no matter how long the campaign runs.

ARCHITECTURE

Eight Cooperating Layers

The LLM is one tool inside the system. Everything around it is the harness.

01

Mission

CampaignManager compiles broad goals into phase state machines

02

Orchestration

OODA + Planner + Dispatcher + LLMRouter + OAuth sidecar

03

Agent

Twelve specialists declared in a single manifest

04

Execution

Sandbox for LLM code, narrow Strategy contract, paper runner

05

Portfolio

DeploymentAllocator with active / watchlist / retired tiers

06

Memory

Append-only Playbook JSONL + queryable SQLite state DB

07

Observability

Typed events, urgency-routed Telegram / Discord / Slack sinks

08

Interface

Next.js dashboard — trading floor, plan approvals, stop button

GET STARTED

From npm install to “go make me cash”

01

Install

npm install -g quantclaw; quantclaw start launches the backend, sidecar, and Next.js dashboard on your machine.

02

Authenticate

Sign in via Claude Code / Codex / Gemini CLI OAuth, or set an API key. Local models via Ollama work too — no network required.

03

Set a goal

Chat naturally. Broad goals like "go make me cash" or "find alpha" compile into a standing profit campaign.

04

Watch the floor

Twelve crewmates work in real time on the trading floor. Approve plans, hit the stop button, adjust risk limits — you stay CEO.

05

Paper, then live

Campaigns run paper-first. Drawdown breach and executor-failure streaks auto-pause. Promote to live only when you choose.

BUILT WITH

Tech Stack

Engine

Python 3.12FastAPIasyncioSQLiteaiosqlite

ML

pandasnumpyscikit-learnxgboostlightgbm

Interface

Next.js 16React 19TypeScriptTailwind 4WebSocket

Sidecar

Node.js@anthropic-ai/sdkopenai@google/genai

Assemble Your Own Crew

MIT-licensed, runs on your own machine, every agent visible, inspectable, and yours.

Get Started on GitHub