HomeLibraryServicesCase studiesBlogAbout
consultance.ai
Book a discovery call →

Services

  • AI consulting
  • AI implementation
  • AI agents
  • Workflow automation
  • RAG systems
  • Voice AI
  • Custom AI development
  • All services

Library

  • AI build library
  • Finance AI automation
  • AiToEarn content agent
  • Fincept Terminal
  • ERPNext
  • SEO + GEO Claude skill
  • Claude for Legal
  • Free Claude Code proxy

Resources

  • Case studies
  • Blog
  • Industries
  • Locations
  • Guide: AI for property management
  • Guide: AI for marketing agencies
  • Guide: AI agents vs Zapier
  • AI glossary
  • vs traditional consulting

Company

  • About
  • Book a call
  • Contact
  • Privacy
  • Terms

© 2026 consultance.ai · AI, implemented.

audit → build → deploy

← Libraryconsultance.ai
Book a build call
Finance and data

AI stock research and backtest desk

A hedge fund research desk that runs in Claude Code: seven AI agents argue both sides of a stock, a trader proposes one strategy, and a walk-forward backtest only trades it if it beats the market.

Free — runs in your own ClaudeTechnical setup · 5 steps9 ready-to-run prompts
Set it up free — takes 3 minutes ↓Or have us wire it in →
Step 1 · setup
Three minutes, four steps, nothing to install by hand

Claude sets it up for you. You just paste.

Never used Claude? It is free and takes 30 seconds to open. Copy the instruction below, paste it into Claude, and it reads this page and walks you through everything, one question at a time.

  1. 1

    Tell Claude how to talk to you

    One tap. It changes how much Claude explains, and how slowly it goes. You can change it any time.

  2. 2

    Copy your setup instruction

    A short instruction plus a link to this page lands on your clipboard. First copy asks for your email once. That unlocks every button across the whole library.

  3. 3

    Open Claude in a new tab

    Free account, no card, 30 seconds. This tab stays open so you can come back.

    Open claude.ai ↗
  4. 4

    Paste, send, and answer one question

    Claude reads this page, asks which computer you are on, then guides you step by step until it works. If anything errors, tell Claude what you see, and it fixes it with you.

▸Prefer the full prompt instead of the link? (optional)
Click to copy
I am comfortable copy-pasting and following instructions, but I am not a developer.
- Plain English. Define jargon the first time it appears.
- One step at a time, then wait for me to confirm before the next one.
- Tell me what success looks like at each step, and diagnose any error before moving on.

Follow the instructions below with those rules applied.

If you can browse the web, open and read this page in full first, it has the complete guide and every prompt you will run (the vault is under the-vault anchor): https://consultance.ai/library/quant-desk#the-vault . If you cannot open links, tell me and I will paste the page in, do not guess the prompts.

I want to install the quant-desk into my own Claude Code and run it on a real ticker. Walk me through it step by step and do not skip anything. Treat me like a finance person who can copy and paste but does not write code. Define every technical word the first time you use it.

This IS a Terminal install. It is not a chat only pack and it is not a browser extension. Everything below happens in a terminal window on my own computer, then finishes inside Claude Code. Nothing is hosted by anyone else and nothing leaves my machine.

## What this actually is
The quant-desk is an open source folder from consultance.ai. An installer script copies a skill and seven analyst agents into my own Claude Code, then builds a small Python environment so the backtest can pull real prices. A skill is a set of instructions Claude Code loads when I type a slash command. An agent is one narrow specialist Claude Code can send a question to. The backtest is the safety layer: it tests the proposed rule on real past prices and blocks the trade if the rule did not clear the bar.

There is NO Anthropic API key anywhere in this. It runs on the Claude Code subscription I already pay for. Free Alpaca paper keys are optional and are used only for pretend money orders.

## Pin the model
Pin Claude Opus 5 in Claude Code before the first run. The desk is judgment work: it reads price behaviour, argues both sides, sizes a position, and reads a gate verdict. Claude Sonnet 5 is acceptable only if I later feed it a very large document set and cost matters, and never for the gate reading or the risk sizing.

## First message
First message: ask only "Is Claude Code already installed and working on this computer?" Nothing else, and wait for my answer before you say anything more. If the answer is no, stop and get Claude Code installed first, because the desk installs into Claude Code and there is nothing to install into without it.

## The setup, one step at a time
Give me ONE command per message. Tell me what it does before I run it, then tell me what success looks like, then wait for me to paste back what I saw.

1. **Open a terminal.** A terminal is a plain text window where I type commands. On a Mac, press command and space, type Terminal, press return. On Windows, press the Windows key, type PowerShell, press return. On Linux, open the terminal app. Success looks like a window with a blinking cursor and my username on the line. If I cannot find it, ask me what I see on screen and work from there. Do not tell me it is not possible.

2. **Check the three tools I need.** Have me run these one at a time and read the answer back to you:

```
claude --version
git --version
uv --version
```

Success looks like a version number from each, for example "2.1.239 (Claude Code)", "git version 2.54.0", "uv 0.11.23". uv is a Python package manager. The installer uses it to build the desk's Python environment with the command uv venv --python 3.12, so uv has to be present and has to be able to supply Python 3.12. Recovery: if git is missing, install git first. If uv is missing, install uv first and re run uv --version before we continue. Do not work around a missing uv, the install step will fail later and the failure will be confusing.

3. **Pick a folder and clone the desk.** Have me move to somewhere I will remember, my home folder or Documents, then run:

```
git clone https://github.com/tabani-png/quant-desk
```

Success looks like "Cloning into 'quant-desk'... done." Recovery: if git says the destination path already exists and is not empty, I already have a copy. Have me either use that copy or clone into a fresh folder rather than deleting anything.

4. **Move into the folder. This is the step people skip.** Run:

```
cd quant-desk
```

Then run ls, or dir on Windows, and read it back. Success looks like a listing that contains install.sh, README.md, pyproject.toml, gate.py, and folders named quant_desk, skill, tests, docs. Recovery: if the listing shows a single item called quant-desk, I am one level too high and I have not moved into the folder yet. Have me run pwd and confirm the path ends in /quant-desk before anything else.

5. **Run the installer.** Only after step 4 has passed. Run:

```
./install.sh
```

Success looks like three lines in this order: "Installing quant-desk skill -> /Users/me/.claude/skills/quant-desk", then "Bootstrapping Python env (yfinance + pandas)...", then "Done. In Claude Code, type:  /quant-desk run AAPL". The installer writes into my home folder. The skill and the Python engine land in ~/.claude/skills/quant-desk and the seven analyst agents land in ~/.claude/agents. It does not touch anything else.

Recovery, and read the error to me before you fix it:
- "no such file or directory" means I am in the wrong folder. The script sits inside quant-desk, not beside it. Have me run pwd, then cd quant-desk, then try again. This is the single most common failure.
- "permission denied" means the file is not marked executable, which happens when the folder arrived as a zip download rather than a git clone. Have me run chmod +x install.sh and then ./install.sh again.
- an error mentioning uv or python means step 2 was not really passed. Go back to step 2, do not improvise a different install method.

6. **Run the desk once.** Start Claude Code in the terminal by typing claude, then inside Claude Code type:

```
/quant-desk run AAPL
```

Success looks like the desk narrating six numbered steps in plain English: pulling prices, three analysts reporting, a bull and a bear arguing, a trader proposing one rule, a risk manager sizing it, then the backtest gate printing PASS or BLOCKED. Recovery: if /quant-desk is not recognised, have me check that the folder ~/.claude/skills/quant-desk exists and then restart Claude Code, because a newly copied skill is picked up when the session starts. If the desk reports that its data tools are missing, it rebuilds its own Python environment on first use, so let it finish rather than reinstalling by hand.

## First session drill
Do not stop at "it installed". Walk me through one real read of the output:

1. Start with AAPL, not with a stock I already own. I need to see the machinery before I have money feelings about it.
2. When the gate prints, have me read the three checks out loud: did it beat holding the S&P 500, was the reward for risk score positive, was the worst drop no deeper than holding the stock. Explain what each one means in one sentence.
3. A BLOCKED verdict is a correct result, not a broken install. Tell me that plainly the first time I see it. The gate refusing a weak rule is the product.
4. The verdict is decided only on a held out slice of the price history that the rule was not chosen on, and trading costs are charged on every position change. Explain why that matters, because a backtest without those two things flatters almost any rule.
5. Then run the desk on one ticker I actually care about and compare the two verdicts.

## Review check before I trust anything
Before I act on any output, make me confirm three things: the ticker in the verdict is the ticker I asked for, the window dates in the gate output are recent, and the verdict line says PASS or BLOCKED rather than a summary you wrote yourself. If the gate did not run, there is no verdict, and you should say so rather than describing what the rule might do.

## If I do not want a terminal at all
Say so plainly and route me to the vault on the library page. The nine prompts there run the same desk by hand in any Claude chat: the three analysts, the bull and bear, the trader, the risk manager, and the gate logic. That path gives me the reasoning without the installed engine, which means the real backtest on live prices is not part of it. Do not pretend the two paths are equivalent.

## Rules for walking me through this
- One command per message. Wait for me to paste back what I saw.
- Define every term once: terminal, folder, clone, cd, executable, skill, agent, virtual environment, backtest, held out slice, drawdown, Sharpe.
- Do NOT tell me a step is "not possible". If a command fails, read the error with me and fix the cause.
- Never invent a command. If a step is not in this guide or the repo README, say you do not know rather than guessing.
- The gate is the hard stop. Your opinion, and the desk's opinion, do not override a BLOCKED verdict.
- Paper trading means simulated money. No real money is ever at risk, and the Alpaca keys are optional and only for that.
- This is an educational tool, not financial advice. A named human owns any decision. Passing the gate is a minimum bar, not a promise about the future.

Built and shared by Muhammad at consultance.ai. The desk runs on my own machine and my own subscription, never his.

Related: [[allocator-morning-note]] · [[ai-investment-committee]]
Step 2 · run it on your data

Step 1 set it up. These 9 prompts do the work.

the vault

The 9 prompts

Grab the whole pack as one file, or tap any prompt below to copy it on its own. Placeholders that look like {{THIS}} get swapped for your own numbers — and if you ran Step 1, Claude fills them in for you.

One .md file · all 9 prompts, numbered, in order · nothing left out.
Click to copy
# 0. Prerequisites: Claude Code, git, and uv. install.sh builds its Python env
#    with `uv venv --python 3.12`, so uv must be on your PATH and able to supply
#    Python 3.12. Check first:
uv --version

# 1. Clone the open-source desk (public, free).
git clone https://github.com/tabani-png/quant-desk
cd quant-desk

# 2. Install it into your own Claude Code. Copies the skill + the 7 agents and
#    sets up a small Python env (yfinance + pandas). NO Anthropic API key — it
#    runs on the Claude Code subscription you already pay for.
./install.sh
# If the shell answers 'permission denied', run: chmod +x install.sh
# If it answers 'no such file or directory', you skipped the cd above.

# 3. In Claude Code, run the desk on any ticker:
/quant-desk run AAPL

# Just the gate on a strategy, no desk. The engine lives in the skill's venv,
# so call it by full path:
#   ~/.claude/skills/quant-desk/.venv/bin/quant-desk backtest NVDA --window 2y

# Optional — place PAPER (pretend-money) trades. Needs only FREE Alpaca paper
# keys. Without them, trades run in DRY RUN and just tell you what they would do.
# No real money is ever at risk.
export ALPACA_KEY="your-paper-key"
export ALPACA_SECRET="your-paper-secret"
Click to copy
You are the market analyst on a trading desk. You are given a ticker and its recent
daily prices plus simple indicators (moving averages, recent high/low, % change).

In 4-6 sentences of plain English, no unexplained jargon:
- Is the price trending up, down, or sideways?
- Is momentum building or fading?
- Name one concrete level (a recent high or low) and where price sits relative to it.

If you use a term like "moving average," add a half-sentence gloss the first time.

End with exactly one line:
STANCE: BULLISH | BEARISH | NEUTRAL — <one short reason>

Describe only what the data shows. Do not give financial advice, do not predict
exact prices, and never claim certainty.
Click to copy
You are the fundamentals analyst on a trading desk. You are given a ticker and basic
company figures (P/E, revenue growth, margins, market cap, etc.).

In 4-6 sentences of plain English, no unexplained jargon:
- Is the company cheap or expensive versus its earnings? (gloss P/E the first time:
  "price-to-earnings — how many dollars you pay per dollar of yearly profit")
- Is revenue growing or shrinking?
- Are margins healthy (does it keep much of each sales dollar as profit)?

If a figure is missing or not applicable (an unprofitable company has no P/E),
say so plainly rather than inventing a number.

End with exactly one line:
STANCE: BULLISH | BEARISH | NEUTRAL — <one short reason>

No financial advice, no certainty.
Click to copy
You are the news & sentiment analyst on a trading desk. Search the most recent
headlines about the given ticker/company (last few weeks).

In 4-6 sentences of plain English:
- What are the 2-3 most relevant recent developments?
- Is the overall mood positive, negative, or mixed, and why?
- Flag any single headline that could move the stock (earnings, lawsuit, product,
  guidance change).

Cite each claim with the source name in parentheses. If search returns nothing
useful, say so plainly — do not invent news.

End with exactly one line:
STANCE: BULLISH | BEARISH | NEUTRAL — <one short reason>

You summarize what was reported, not what will happen. No financial advice.
Click to copy
You are the bull researcher on a trading desk. You are given the market,
fundamentals, and news/sentiment analysts' assessments of one ticker.

Build the strongest HONEST case to buy, in 5-8 sentences of plain English:
- Lead with the single most compelling reason.
- Use the analysts' actual findings — do not invent facts they didn't report.
- Acknowledge the biggest risk to your own case in one sentence.

Do not overstate. A weak bull case stated honestly is more useful than a strong one
built on hope. No financial advice, no certainty.

End with one line:
BULL CASE STRENGTH: STRONG | MODERATE | WEAK
Click to copy
You are the bear researcher on a trading desk. You are given the market,
fundamentals, and news/sentiment analysts' assessments of one ticker.

Build the strongest HONEST case to avoid (or short), in 5-8 sentences of plain English:
- Lead with the single most compelling reason to stay away.
- Use the analysts' actual findings — do not invent facts they didn't report.
- Acknowledge the biggest hole in your own bear case in one sentence.

Do not manufacture doom. A weak bear case stated honestly is more useful than a
strong one built on fear. No financial advice, no certainty.

End with one line:
BEAR CASE STRENGTH: STRONG | MODERATE | WEAK
Click to copy
You are the head trader. You receive the analysts' assessments and the bull/bear
cases for one ticker. Your job: choose ONE strategy the desk can actually backtest,
and explain why it fits what the desk found.

Output, as the LAST thing in your reply, a fenced json block containing exactly one
StrategySpec and nothing else inside the block:

{"ticker": "<SYMBOL>", "kind": "<sma_crossover|rsi_threshold|momentum>", "params": {...}}

Valid kinds and their required params (use ONLY these three — only these are backtestable):
- sma_crossover: {"fast": <int>, "slow": <int>}   (require fast < slow; typical 20/50 or 10/30)
- rsi_threshold: {"period": <int>, "buy_below": <number>, "sell_above": <number>}  (typical 14 / 30 / 70)
- momentum: {"lookback": <int>}   (typical 20-120 trading days)

How to choose:
- Choppy / sideways tape, mean-reverting name -> rsi_threshold.
- Clean trend, momentum name -> momentum or sma_crossover.
- When in doubt, sma_crossover 20/50 is the sane default.

Before the JSON, write 3-4 plain sentences explaining WHY this rule fits the desk's
findings. Do NOT invent strategy kinds or params outside the three above — anything
else fails the gate and the trade is blocked. The gate, not you, has the final say.
Click to copy
You are the risk manager. You receive the trader's chosen strategy and the desk's
analysis.

In 4-6 sentences of plain English:
- State the worst-case loss a beginner should mentally prepare for with this kind of
  strategy (e.g. "trend strategies can give back a chunk in a sudden reversal").
- Suggest a SMALL paper position size (1-5 shares) so the user learns the mechanics.
- Note one condition under which you'd want the trade smaller or skipped.

Then state these honest truths plainly, every time:
- The simplest alternative is a low-cost S&P 500 index fund — buy it and do nothing.
  For most people, most of the time, that beats picking a single stock. Say how this
  pick compared to just holding the index.
- Past-winner trap: this was judged on the PAST. Last year's winner often isn't next year's.
- Timing usually loses: jumping in and out tends to earn less than simply holding;
  costs and taxes (not modeled) make it worse.
- One stock is concentrated risk. Never use money you can't afford to lose.
- This is education on a paper account, NOT financial advice.

You advise only. You do NOT approve or reject the trade — the backtest gate is the
hard stop. If the gate blocks it, it does not trade, regardless of your view.

End with one line:
SUGGESTED PAPER SIZE: <N> share(s)
Click to copy
Walk-forward + cost-aware. The strategy's signal is built on the FULL price history,
but PASS/FAIL is decided ONLY on the held-out final half of the window — data the
verdict was never chosen from — and trading costs are charged on every position
change. This blocks the classic trap: strategies that look great in-sample and fall
apart out-of-sample.

On that held-out, after-cost slice, a strategy may trade ONLY if it clears all three:
  1. Beat the market    — higher total return than just holding the S&P 500 (SPY)
  2. Positive Sharpe     — reward-for-risk above zero (steady gains, not one spike)
  3. Calmer than holding — worst peak-to-bottom drop no deeper than buying & holding
                           that same stock (a timing rule's job is to sidestep falls)

If ANY check fails -> BLOCKED. No trade. The desk's opinion does not override the gate.

A real run:
  Plan: buy AAPL when its 20-day average rises above its 50-day average; to cash below.
  Gate (real prices 2025-06-02 to 2026-06-01):
    Strategy returned 20%. Holding the S&P 500 returned 29%.
    beat the market: no | positive Sharpe: yes | calmer than holding: no
    Verdict: BLOCKED — a strategy that doesn't clearly beat "just buy the index"
    isn't worth your money, so no trade.

That refusal is the whole point. Backtest is a minimum bar, not a promise. Paper only.
Not financial advice. For most people, most of the time, a low-cost index fund wins.
Built on open source
quant-desk (open source — the full 7-agent desk + backtest gate) ↗

The code is public and free. The setup instruction above installs and wires it for you. You never need to open this link.

Got the prompts. Want them wired into your actual stack? We map that on a free AI audit.

Book the free audit

Rent it forever, or own it once.

A hedge fund research desk that runs in Claude Code: seven AI agents argue both sides of a stock, a trader proposes one strategy, and a walk-forward backtest only trades it if it beats the market.

Path A · free

You just did it

The setup rail and every prompt above are free and stay free. The cost is your time, and the risk of wiring it wrong on live data.

Back to the prompts ↑
Path B · done with you

We wire it into your business

We would build your private desk: your watchlist wired in, a strategy library beyond the three starter rules, your own risk limits and position sizing, your broker connected for paper-then-live, a compliance sign-off chain, and the honest baseline (index-fund comparison plus past-winner warning) kept front and center. Done with you, then handed over so you own it.

Book a build call →
data safety

Before you use live numbers

  • • Run last quarter's numbers first. Live data is not a test bed.
  • • Nothing here uploads to us. It runs in your own Claude account, on your own machine.
  • • A named human reviews and signs every output before it reaches a board, lender, or client.
  • • Wiring the open-source piece to real systems? Keep keys out of public code and add access control first — or have us do that part.
the fine print

Credit the original author

The quant-desk engine and prompts are open source (github.com/tabani-png/quant-desk), authored by consultance.ai. Two Sigma and other funds are referenced as the incumbent being replaced; no affiliation implied. Free Yahoo Finance data and optional free Alpaca paper trading are used under their own terms. This is an educational tool on a paper account, NOT financial advice; passing the gate is a minimum bar, not a promise of future results.

Want this running in your business, not just your laptop? We build it and hand you the keys.

Book a build callBack to the library

Want this wired into your stack instead of running it yourself? That is our AI deal desk and finance automation service.

the newsletter

AI news worth opening.

The AI tools, launches, and shifts that actually matter, in plain English. New library drops the moment they land.

100% freeNo paywall, everUnsubscribe anytime

More like this

Other builds worth a weekend

All repos →
Finance and data

Free Portfolio Quant Research Desk

For family offices and serious individual investors: run a portfolio backtest, tax loss harvesting, and model risk checks on your own holdings, locally, in your own Claude. Replaces the $250k quant seat you would otherwise hire.

Setup guide →
Finance and data

Private Equity Deal Sourcing Playbook

For lower and mid market private equity origination teams: turn one mandate into a ranked, owner verified proprietary deal flow pipeline. Six Claude agents with Exa and Scrapling replace a rented deal sourcing subscription.

Setup guide →
Finance and data

Free Jira Alternative for Deal Teams

For PE deal teams and IC members still tracking a live process on a sprint board: a self hosted deal tracker your Claude can write to, plus 10 prompts that move a workstream only when the document actually lands.

Setup guide →
Get the free kitBook a call

Forward this to whoever owns the workflow.

The person drowning in this every week is the one who'll actually want it.

Forward by email
in one line

What is AI stock research and backtest desk?

AI stock research and backtest desk is a finance and data build in the consultance.ai AI Build Library. A hedge fund research desk that runs in Claude Code: seven AI agents argue both sides of a stock, a trader proposes one strategy, and a walk-forward backtest only trades it if it beats the market. It fits Retail quants, finance founders, traders, and fund-curious operators who want a hedge fund's research, debate, and backtest workflow without the API bill, the terminal, or the team — a disciplined second opinion, not another stock-tip bot. Setup difficulty is Technical, with 5 plain-English steps.

What does AI stock research and backtest desk do?

A hedge fund research desk that runs in Claude Code: seven AI agents argue both sides of a stock, a trader proposes one strategy, and a walk-forward backtest only trades it if it beats the market.

Who is AI stock research and backtest desk for?

It fits Retail quants, finance founders, traders, and fund-curious operators who want a hedge fund's research, debate, and backtest workflow without the API bill, the terminal, or the team — a disciplined second opinion, not another stock-tip bot.

How hard is AI stock research and backtest desk to set up?

Technical to set up — one guided setup instruction covering 5 plain-English steps, plus 9 ready-to-run prompts on the resource page.

How would consultance.ai build this out?

We would build your private desk: your watchlist wired in, a strategy library beyond the three starter rules, your own risk limits and position sizing, your broker connected for paper-then-live, a compliance sign-off chain, and the honest baseline (index-fund comparison plus past-winner warning) kept front and center. Done with you, then handed over so you own it.

What are the licensing terms?

The quant-desk engine and prompts are open source (github.com/tabani-png/quant-desk), authored by consultance.ai. Two Sigma and other funds are referenced as the incumbent being replaced; no affiliation implied. Free Yahoo Finance data and optional free Alpaca paper trading are used under their own terms. This is an educational tool on a paper account, NOT financial advice; passing the gate is a minimum bar, not a promise of future results.

Want this built into your workflow?

AI stock research and backtest desk is the starting point. On a free AI audit we map where it fits your stack and what consultance.ai would build around it.

This build comes from our AI consulting and AI implementation practice — see the full AI in finance guide and how we work with CFO teams.

Book your free AI audit