«

StockClaw A deeply optimized multi-agent system for stock research, paper trading, historical backtesting, and Telegram delivery.

emer Published on Views: 43 Finance


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.

What It Does

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.

Product Philosophy

Specialists

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.

Data And Extension Model

StockClaw is designed to avoid baking one provider into the core system.

Example Use Cases

1. Backtest a Portfolio You Already Built

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.

2. Find Stocks Worth Studying

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.

3. Deep Analysis on a Single Stock

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.

Why This Layout

Quick Start

git clone https://github.com/24mlight/StockClaw.git
cd StockClaw
npm install
npm start

On first startup, the app guides local setup for:

If 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:

The LLM config uses a single OpenAI-compatible endpoint entry. The only required values are:

Timeout, context window, and compaction threshold use system defaults unless you add overrides manually.

Telegram is optional:

If Telegram is enabled, the startup flow is:

  1. Paste your bot token
  2. Send any message to your bot in Telegram
  3. Copy the pairing code from Telegram
  4. Paste that code into the local terminal prompt
  5. Type skip there if you want to finish pairing later

All 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:8000

What It Loads On Startup

At runtime startup, StockClaw loads:

Changes to config, skills, and prompts support watcher-driven reload.

Architecture

Core Flows

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

Historical Backtesting

The root agent can run backtests for:

Current backtest model:

Telegram

Telegram is an extension, not the primary UI.

Supported behavior includes:

Current non-text inbound handling is metadata-aware:

Context And Compaction

API

HTTP endpoints * `GET /` * `GET /health` * `GET /api/runtime` * `POST /api/runtime/reload` * `POST /api/sessions` * `GET /api/sessions/:id` * `GET /api/sessions/:id/spawns` * `POST /api/sessions/:id/messages` * `GET /api/sessions/:id/status` * `GET /api/portfolio` * `PUT /api/portfolio` * `POST /api/trades/execute` * `GET /api/config` * `PATCH /api/config` * `POST /api/ops/install`

Local State

Ignored local files and runtime state The repository ignores local working state such as: * local config * portfolio and session state * backtest artifacts * runtime logs * local memory files These are machine-local operational files, not repository content.

License

StockClaw is released under the MIT License. See LICENSE.


Scan QR code to view on mobile.