Home · Learn · Claude Trading Bot
How to Build a Claude Trading Bot With Claude Code
People looking up a Claude trading bot want Claude in the loop on a trade. Sometimes Claude Code writes a program you run. Sometimes it stays in the conversation and calls tools that can read a market and place an order. A third setup adds trading skills: written checklists the model loads when the task fits. This page explains all three, the safety pattern public projects share, and one Solana setup that uses the Claude Code CLI.
You can use the first half if you never open Moby. The Moby steps are one way to give Claude Code a wallet with server-side caps. They are not the only way to wire a bot.
What is a Claude trading bot?
A Claude trading bot is a setup where Anthropic's Claude helps decide or place trades. Most people use Claude Code in one of three ways: it writes a bot in code, it acts as the agent through an MCP server that can trade, or it follows trading skills. Your risk limits still need enforcing outside Claude.
Claude Code is Anthropic's agentic coding tool. It runs in your terminal and can call tools you connect. It holds no wallet. Anything it trades is a call to another system: code it wrote against an API, or a tool server you added. The table is the map of claude trading setups people actually publish.
| Approach | What Claude does | What you need | Where risk is enforced |
|---|---|---|---|
| Claude writes the bot | Generates the code that calls an exchange or broker API | A runtime, API keys, and a machine that keeps the process running | In the program you run: size limits, stops, and the checks you shipped |
| Claude Code as the agent | Calls tools on an MCP server, and can place orders when that server allows it | Claude Code in your terminal, plus a trading MCP server | On that server, or in a separate risk program. The model does not enforce the cap |
| Claude skills | Loads a written trading process when the task matches a skill | Skill folders Claude Code can read | In the skill's checklist, and on any server it calls. A skill is instructions, not a lock |
How to use Claude for trading (three approaches)
Skills can sit on top of either of the first two. Claude AI trading, in all three rows, still needs a tool or a program outside the chat.
Claude writes the bot
Here Claude Code generates a program, often Python, that calls an exchange or broker API. You read it, you run it, and you keep it running. After the process starts, Claude is the author, not the operator, unless you built a loop that calls the model on every tick. You still need an account at the venue, API credentials stored outside the chat, and a host for the process. A retry that double-sends, or a size off by a decimal, will not catch itself. A tool-neutral version of that build is how to build an AI trading bot.
Claude Code as the trading agent through MCP
The Model Context Protocol is an open way for an AI app to call tools on a server you connect. Claude Code's MCP docs show how to add that server from the terminal and call its tools in the same session where you type.
Trading MCP servers already exist, and they are not the same product. Alpaca's MCP server is a broker example. On Solana, Jupiter's trading MCP is one public trading server, and Moby MCP is the server this site documents for a Moby Agent. The add command looks similar. The permissions do not. Read the server's tool list before you point a wallet at it. The model proposes a call. The server accepts it, rejects it, or waits for your yes.
Claude skills for trading process
Claude Code skills are folders of instructions the tool loads when a task matches the skill's description. The format is in the Claude Code skills docs. A skill can say "size the position, then run the pre-trade gate, then journal the result." It cannot, by itself, refuse an API call that some other script makes with your key.
Claude Trading Skills by tradermonty is a public pack of more than 70 skills, including position sizing, a pre-trade discipline gate, and a drawdown circuit breaker. Read the source before you install a folder, and skip any skill that expects a data key you do not have.
The safe pattern most Claude trading projects use
Public repos for this search share one pattern. The worked example is the Alzarak trading-bot Claude Code plugin. It trades through Alpaca, with paper trading by default. Claude acts as the analyst. A deterministic Python risk manager, a circuit breaker, and mandatory stops make the final checks. Other public Alpaca skills put it in one line: treat the model's analysis as advisory only. A paper-trading guide in that set of results says research, then propose, then paper trade, then go live.
Copy the order, whichever venue you use:
- Claude is the analyst. It reads, explains, and proposes. A separate layer decides whether an order may leave.
- Hard caps live outside the prompt. Max size and max daily buys should fail closed in code or on the server. "Be careful" is not a cap.
- Stops are mandatory, and they are their own orders. If you want an exit, require it. Do not assume the entry created one.
- Paper or approval first. Start where a bad call cannot spend funds, or where you have to say yes first.
- Keep logs. Save the proposal, the check that passed or blocked it, and the order id.
The rule set behind those caps is covered in risk management. Use it before you raise any size.
What Claude can and cannot do in a trading bot
With a tool connected, Claude can:
- Read data through tools. Prices and positions come from the tool, not from memory.
- Apply written rules. A skill, a prompt, or generated code can set the order of checks.
- Explain its reasoning. It can say why it wants a trade. That explanation is not a check.
- Place orders when a connected tool allows it. If the server exposes an order tool and the call is permitted, Claude Code can send it.
On its own, Claude cannot:
- See live prices without a data tool. With no feed connected, a number it offers is not a quote.
- Guarantee it will follow a rule. Models skip steps, misread a field, and sound sure while doing it.
- Stop a model error from becoming a trade, unless limits are enforced elsewhere. If the only control is the conversation, a bad call can still go out. The block has to live in your program or on the server that accepts the order.
The SEC, NASAA, and FINRA investor alert is titled "Do Not Rely Solely on AI-Generated Information". The CFTC published a separate advisory on AI trading bots. A fluent rationale is not a reason to skip the cap.
Set up a Claude Code trading agent on Solana with Moby
This is the Moby path for a Claude Code trading bot, and it uses the Claude Code command-line tool. One agent per user, with its own wallet, separate from the main in-app wallet. The agent trades Solana tokens with USDC, including tokenized stocks. Agent trading on Base, BNB Chain and Robinhood Chain is coming soon.
Moby Agent for Claude Code has the full setup and troubleshooting. The short version is below.
-
Create a key. In the Moby app, open the Agent tab, tap Connect, and create a key. It starts with
moby_agent_. That string is an agent API key, not a wallet private key. You can revoke it in the app. Do not paste it into the chat. -
Add the server. Replace the placeholder with your key on your machine, then run:
claude mcp add --transport http moby https://mcp.moby.win/mcp --header "Authorization: Bearer moby_agent_..." --scope user -
Verify. Run
claude mcp list, or type/mcpinside Claude Code. You should see the server named moby. - Answer the setup questions. On first connect the agent reads your trading profile and asks a short set of setup questions, including approval mode. Leave approval on until you have watched a few proposals. You set your agent's limits on max per trade, daily buy volume and market-cap range from the Moby app, and Moby checks them server-side on every buy your agent makes.
Before you ask for a trade, give Claude Code the Moby Knowledge skill, the reference for how the tools behave and what a buy spends.
Example prompts
These are prompts, not results. The amounts are small and illustrative. Nothing below is a fill, a backtest, or a recommendation. On Moby, a buy spends USDC from the agent wallet only after you approve it.
Show me what whales bought in the last hour, with a rug check on each.
Ask for the read before any order. A rug check reads risk signals and holder concentration, then gives a low, medium, or high verdict.
Prepare a buy of 10 USDC of NVDAx and wait for my yes.
NVDAx is one of the tokenized stocks on Solana. The prompt tells Claude Code to prepare the order and stop. Say yes only after the token and the size match the limits in the app.
After any buy, place a stop-loss 15% below entry.
Moby attaches no exit orders to a buy. If you want a stop-loss, the agent places it with an order after the buy. The entry does not create that exit for you. Say so in the same session if you want it.
Pause all trading.
A pause blocks new trades. Reads can still work. If you want the connection gone, revoke the key in the Agent tab, Connect.
A scheduled scan repeats a watch on a timer and messages you when something changed.
Claude for stock trading and crypto trading
Claude stock trading, in the way people use the phrase, is two different pipes.
Broker orders. A broker MCP server, such as Alpaca's, lets Claude Code place broker orders under that broker's rules. This page does not set up that account.
Tokenized stocks on Solana. A Moby Agent trades tokenized stocks on Solana, paid in USDC, inside the limits you set. Tickers on the liquid list include AAPLx, NVDAx, TSLAx, SPYx, and QQQx. They are tokenized stocks. The agent wallet holds the token, and the trade is a Solana swap.
Claude crypto trading. The same agent trades Solana tokens, including pump.fun coins before graduation and after graduation. For the curve and the pool, see buy pump.fun coins. AI agents on Solana covers the wider agent setup. Agent trading on Base, BNB Chain and Robinhood Chain is coming soon.
FAQ
Can Claude trade crypto for me?
Claude cannot trade by itself. In Claude Code, it can place trades when you connect a trading MCP server, such as Moby MCP for Solana tokens, within the limits that server enforces.
Is a Claude trading bot profitable?
No tool can promise profit. Results depend on the strategy, costs and markets, and AI models make mistakes.
Do I need to code to build a Claude trading bot?
Not with the agent approach. You run one command to connect an MCP server, then give instructions in plain language.
Can Claude trade stocks?
Through a broker's MCP server it can place broker orders. Through a Moby Agent it trades tokenized stocks on Solana, such as AAPLx and SPYx.
How do I keep a Claude trading bot safe?
Start with trade approval, set spending caps the platform enforces, require stop-losses, and keep a way to pause and revoke keys.
What is the difference between Claude and Claude Code for trading?
Claude Code is Anthropic's agentic coding tool that runs in your terminal and can use MCP servers; Moby setup uses Claude Code.
Can Claude withdraw money from a Moby agent wallet?
No. The agent's tools can trade and place orders but cannot withdraw, transfer or send funds.
Try it with a Moby Agent
This is the Claude Code piece of agentic trading on Moby.
- Download and open the Agent tab. Download Moby and open the Agent tab. One agent per user, with its own wallet.
- Set the limits. Set max per trade, daily buy volume and market-cap range. You set your agent's limits on max per trade, daily buy volume and market-cap range from the Moby app, and Moby checks them server-side on every buy your agent makes.
- Connect Claude Code. Create a key and run the
claude mcp addcommand in Claude Code. Moby Agent for Claude Code has that command and the checks. - Fund the wallet. Fund the agent wallet with USDC.
- Approve the first idea. Ask Claude Code for a trade idea and approve it before it executes.
A 0.75% swap fee (minimum $0.90 per swap), plus onchain fees.
10% of the Moby fee back in $MOBY on every swap, 20% after your first swap, up to 30% as you climb tiers.
Moby Agents also work with Codex and Grok.
Connect Claude Code to Moby
Set up a Moby Agent with its own wallet and your spending guardrails, then connect it to the AI you use.
Not financial, legal, or tax advice. Trading can lose money. No model, skill, or agent can promise a profit. Published by Moby on November 2, 2026.