StockClaw A deeply optimized multi-agent system for stock research, paper trading, historical backtesting, and Telegram delivery. Quick Sta…
StockClaw A deeply optimized multi-agent system for stock research, paper trading, historical backtesting, and Telegram delivery. Quick Sta…
StockClaw
A deeply optimized multi-agent system for stock research, paper trading, historical backtesting, and Telegram delivery.
Quick Start · What It Does · Architecture · Telegram · Historical Backtesting
[!IMPORTANT] StockClaw is built around one persistent root agent. The root owns the conversation, decides when to use tools, and only spawns specialists when they add signal.
Deep Stock Research
One persistent root coordinates multiple professional analysts for valuation, technicals, sentiment, and risk.
Paper Trading
Structured paper portfolio truth, explicit execution boundaries, and fully auditable state changes.
Historical Backtesting
Frozen datasets, isolated day sessions, strict `T-1` constraints, and agentic context gathering.StockClaw ships with a built-in specialist pool tuned for equity analysis:
The root agent sees this pool, picks only the relevant specialists, and synthesizes the final answer.
StockClaw is designed to avoid baking one provider into the core system.
Imagine you have already set up a portfolio, but you do not know whether it would have held up over the last few trading days, and you do not want to manually gather data or analyze every move yourself.
That is exactly the kind of workflow StockClaw is meant to absorb for you. You can simply say something like:
Help me backtest this portfolio for 7 days.Or:
Backtest my current portfolio for the last 7 trading days.StockClaw can prepare the historical window, run the backtest flow, and return the result with trades, drawdown, and performance summary.
[!CAUTION] Keep backtest windows short unless you really need a long run. Longer date ranges consume much more token budget and tool budget, and the system may take significantly longer to finish.
If you want fresh ideas instead of testing an existing portfolio, you can ask StockClaw to search for investable names and build a shortlist. For example:
Find a few US stocks with strong investment potential and build me a watchlist.Or:
Find several stocks with good value, technical, and sentiment alignment.In that flow, the root agent can search, gather data, and selectively use specialists to narrow the list into names worth deeper follow-up.
If you already have one ticker in mind, StockClaw can go deeper instead of giving you a generic summary. For example:
Do a deep analysis on MSFT.Or:
Analyze whether NVDA still has investment value here.This is where the multi-agent structure matters most: the root can combine valuation, technical structure, sentiment, and risk views into one final synthesis instead of forcing you to stitch the reasoning together yourself.
T-1 constrained context reads.git clone https://github.com/24mlight/StockClaw.git
cd StockClaw
npm install
npm startOn first startup, the app guides local setup for:
config/llm.local.tomlIf the local MCP config file is missing, the app creates an empty one automatically in the background. The setup wizard does not walk you through MCP server credentials.
For LLM setup, you can choose either path:
config/llm.local.tomlconfig/llm.local.toml yourself from config/llm.local.example.tomlThe LLM config uses a single OpenAI-compatible endpoint entry. The only required values are:
modelbaseUrlapiKeyTimeout, context window, and compaction threshold use system defaults unless you add overrides manually.
Telegram is optional:
no if you only want the Web UIyes if you want TelegramIf Telegram is enabled, the startup flow is:
skip there if you want to finish pairing laterAll generated config and runtime state stay local and are ignored by git.
You can also create the local files yourself and manage them manually if you prefer.
Default address:
http://127.0.0.1:8000At runtime startup, StockClaw loads:
Changes to config, skills, and prompts support watcher-driven reload.
flowchart LR
user[User]
web[Web UI]
telegram[Telegram]
router[App Router]
root[Persistent Root Agent]
tools[System Tools]
specialists[Specialist Pool]
state[State Stores]
skills[Skills]
mcp[MCP via mcporter]
backtest[Backtest Runs]
user --> web
user --> telegram
web --> router
telegram --> router
router --> root
root --> tools
root --> specialists
tools --> state
tools --> skills
tools --> mcp
tools --> backtestThe application layer is only the outer router. The real long-lived conversation owner is the persistent root PI session behind it.
| Flow | Behavior |
|---|---|
| Chat | Root handles the turn, uses tools directly for simple tasks, and spawns specialists only when needed |
| Specialist work | sessions_spawn creates isolated ephemeral sessions with profile-specific prompts and tool policies |
| Paper execution | A live quote is resolved, validated, and then used to update structured paper-trading state |
| Backtesting | A job prepares a frozen dataset, runs isolated day sessions, and pushes the final result back to the origin session |
| Telegram | Pairing, reactions, media input handling, file delivery, and chat transport stay inside the Telegram adapter |
The root agent can run backtests for:
Current backtest model:
Telegram is an extension, not the primary UI.
Supported behavior includes:
Current non-text inbound handling is metadata-aware:
/statusHTTP endpoints
GET /GET /healthGET /api/runtimePOST /api/runtime/reloadPOST /api/sessionsGET /api/sessions/:idGET /api/sessions/:id/spawnsPOST /api/sessions/:id/messagesGET /api/sessions/:id/statusGET /api/portfolioPUT /api/portfolioPOST /api/trades/executeGET /api/configPATCH /api/configPOST /api/ops/installIgnored local files and runtime state
The repository ignores local working state such as:
These are machine-local operational files, not repository content.
StockClaw is released under the MIT License. See LICENSE.
No open issues yet, or sync has not completed.