{"slug": "claude-trading-bot-prompts-that-keep-real-money-safe", "title": "Claude trading bot prompts that keep real money safe", "summary": "A developer who built Polyphemus, a Polymarket trading bot, published five copy-ready Claude prompts designed to stop Anthropic's Claude from breaking money-protection code rather than to pick trades, including a roughly 300-token CLAUDE.md hard-rules file, a /preflight slash command, a plan-before-code prompt and a six-question review. The author reports that the bugs that cost real money came from code that ran fine and did the wrong thing — one call overwrote an allowance with zero so every sell failed silently, and a dollars-versus-cents mix-up cost a real trade. The prompts enforce that every order path calls RiskGate.check(), that live keys are never read while DRY_RUN is true, and that decision-log entries are written before orders.", "body_md": "A good Claude trading bot prompt does not ask Claude to find trades. It tells Claude what it must never do with your money. I use five prompts. Each has one job and a clear point where Claude has to stop.\n\nThese five prompts came from building Polyphemus, my Polymarket bot. The build story is in [how I built the Polymarket bot in Python](https://chudi.dev/blog/how-i-built-polymarket-trading-bot). The Claude Code side is in [the production trading bot guide](https://chudi.dev/blog/claude-code-production-trading-bot). This post is only the prompts, ready to copy.\n\nNone of these prompts holds a strategy. They do not tell Claude what to buy. They stop Claude from breaking the parts that protect your money.\n\n## Why most Claude trading bot prompts fail\n\nMost prompts you find online ask Claude to act as a trader. They give it a schedule, a few rules and a goal like finding good entries. Then the riskiest choice happens inside a chat: when to spend money.\n\nThe bugs that cost me money did not come from bad trade ideas. They came from code that ran fine and did the wrong thing. One call overwrote my allowance with zero, so every sell failed without an error. One mix-up between dollars and cents cost a real trade.\n\nA prompt cannot catch a bug like that by being clever. It catches it by making Claude check the same things every time.\n\n## Prompt 1: the hard rules file (CLAUDE.md)\n\nClaude Code reads a file called CLAUDE.md at the start of every session. Put your rules there, not in chat. Chat rules fade as the session gets long. File rules load every time.\n\n```\n# CLAUDE.md\n\n## Hard rules\n1. Never remove or weaken the risk gate. Every order path must call\n   RiskGate.check() before it places an order. Do not add a second\n   path that places an order without this call.\n2. Never read live keys while DRY_RUN is true.\n3. Write the decision log entry before the order, never after.\n   A crash mid-order must still leave a record of intent.\n4. Never commit a real .env file.\n5. Never call a change safe to run live until it passes both gates.\n\n## What this repo does not do\n- It holds no trading strategy and makes no claim about returns.\n- Live order placement is off by design until I turn it on.\n```\n\nKeep it short. Mine for Polyphemus was about 300 tokens. A long rules file gets skimmed, by Claude and by you.\n\n## Prompt 2: the preflight check\n\nRun this before every start. Save it as a slash command so you do not have to retype it. In Claude Code, a file at `.claude/commands/preflight.md` becomes `/preflight`.\n\n```\nRun the preflight check and report the result.\n\n1. Run the preflight script from the repo root.\n2. Report every finding, not only the exit code.\n3. If the exit code is 2, name the exact field that failed and\n   quote the message. Do not start the bot.\n4. If the exit code is 1, list the warnings and ask me whether\n   they are expected before you go on.\n5. If the exit code is 0, say clearly that it is safe to start.\n\nNever suggest weakening a check to make a finding go away.\nFix the .env value instead.\n```\n\nThe last line matters most. When a check fails, the fastest fix for Claude is to loosen the check. This line takes that option away.\n\n## Prompt 3: plan first, then code\n\nUse this for any change that touches more than two files. It makes Claude show its plan before it writes code.\n\n```\nRead src/botkit/risk.py and src/botkit/executor.py first.\nDo not write code yet.\n\nGive me a plan for this change: [one sentence on the change].\nFor each file you would edit, say what changes and why.\nThen answer: does any step add a way to place an order\nthat skips RiskGate.check()? If yes, stop and tell me.\n```\n\nName the files to read. If you say “update the order code,” Claude will guess what is in a file it has not read. If you say “read executor.py, then update the retry logic,” it works from the real code.\n\n## Prompt 4: the six-question review\n\nTests prove what you thought to test. This review is the manual gate after the tests pass. Paste it after Claude finishes a change to the risk gate, the order code or the feed.\n\n```\nBefore I merge this, answer each question with proof from the code:\n\n1. What is the one behavior this change should produce?\n2. What test proves it, or what new test did you add?\n3. If the risk gate denies this action, does the code still\n   write a decision log entry?\n4. If the websocket drops mid-change, is the reconnect and\n   backoff logic unchanged?\n5. Can this change ever read live keys while DRY_RUN is true?\n6. Can this change ever create a second path to place an order\n   that skips RiskGate.check()?\n\nIf you cannot confirm an answer, say so. Do not guess.\n```\n\n“Do not guess” is the line that does the work. Without it, Claude fills a gap with a confident answer. With it, you see the gap.\n\n## Prompt 5: shadow to live\n\nThis is the last prompt before real money. Shadow mode means the bot runs on live market data but places no real orders. It logs what it would have done.\n\n```\nReview whether this change is ready to leave shadow mode.\n\n1. Run the full test suite and show me the full result.\n2. Confirm each of the six review questions has a written answer.\n   Stop if any is missing.\n3. Read data/decisions.jsonl from the shadow period. Count the\n   completed decision cycles. Say whether the count meets my\n   threshold of 50. Count the denied orders and any errors.\n4. Say \"ready\" or \"not ready\" and give the exact reason.\n\nNever call a change ready on passing tests alone.\n```\n\nCount decision cycles, not hours. A bot that trades twice in a quiet hour has barely been tested. Fifty cycles across busy and quiet markets tells you much more. Pick your own number, but write it down before the shadow period starts.\n\n## How the five prompts fit together\n\nEach prompt covers one step, so the order matters. Here is the order I run them in for any change that can touch an order.\n\n1. CLAUDE.md is always on. I never paste it. Claude Code loads it at the start of every session, so the hard rules are there before I type anything.\n2. Plan first. I run Prompt 3 before any change that touches more than two files. I read the plan before Claude writes a line of code. If the plan adds a new order path, I stop there.\n3. Code and tests. Claude writes the change and the tests. I run the full suite myself, because a summary of a test run is not the same as the run.\n4. Six-question review. I paste Prompt 4 when the tests pass. Any answer of “I cannot confirm” goes back to step 2.\n5. Preflight. I run `/preflight` before the bot starts in shadow mode. It catches a bad`.env` value before the bot reaches a live market.\n6. Shadow to live. I let the bot run in shadow mode until it reaches my cycle count. Then I run Prompt 5. Only a “ready” answer with a reason I can check moves the change to real money.\n\nThe first two steps are cheap. The last step is slow on purpose. If I skip a step to save time, I skip a slow one, and that is the step that would have caught the bug.\n\n## How to adapt these prompts to your own bot\n\nYou do not need my code to use these prompts. You need three things your bot probably already has.\n\n- One function every order goes through. Mine is `RiskGate.check()` . Yours might be a check inside your order function. Put its real name in Prompts 1, 3 and 4. A prompt that names a function Claude can find is much stronger than a prompt that says “the risk logic.”\n- A log of decisions. Mine writes one line per decision cycle. If your bot only logs filled orders, add a line for every decision, including the ones it skips. Prompt 5 cannot count cycles that were never written down.\n- A switch for real orders. Mine is `DRY_RUN` . If your bot has no switch like this, add one before you use any of these prompts. Without it, there is no shadow mode, so there is no safe way to test.\n\nThen change the file paths in Prompt 3 to your own. Set your own cycle count in Prompt 5. Keep the stop lines exactly as they are. The stop lines do most of the work. “Stop and tell me” and “Do not guess” are two of them. If you cut anything, cut words around them, not the stop lines.\n\n## What these prompts do not do\n\nThey do not make a strategy profitable. A prompt cannot fix a signal with no edge or a bet sized too large. The sizing math is in [how Kelly sizing fixed my Polymarket bets](https://chudi.dev/blog/directional-betting-binary-markets-math), and you can test your own numbers with the [Kelly criterion calculator](https://chudi.dev/tools/kelly-criterion).\n\nThey also do not replace reading the code. They make Claude show its work, so you know where to look.", "url": "https://wpnews.pro/news/claude-trading-bot-prompts-that-keep-real-money-safe", "canonical_source": "https://chudi.dev/blog/claude-trading-bot-prompts", "published_at": "2026-11-04 15:00:00+00:00", "updated_at": "2026-11-04 19:54:24.703381+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["Claude", "Anthropic", "Polyphemus", "Polymarket", "Claude Code", "RiskGate.check()"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/claude-trading-bot-prompts-that-keep-real-money-safe", "markdown": "https://wpnews.pro/news/claude-trading-bot-prompts-that-keep-real-money-safe.md", "text": "https://wpnews.pro/news/claude-trading-bot-prompts-that-keep-real-money-safe.txt", "jsonld": "https://wpnews.pro/news/claude-trading-bot-prompts-that-keep-real-money-safe.jsonld"}}