Trading loop where code vetoes trades and Jev scores forks
A 5-minute paper-trading loop lets Sonnet propose and a PreToolUse hook block orders, while Jev resolves 1,301 forks at 0.90 sharpness and waits on split sizing calls.
THIS IS ACTUAL F*CKING GOLD Anthropic just shared one of the best tricks for Claude Code: a trading loop where the model proposes and the code decides. every 5 minutes it reads signals, proposes a trade, and a hook sitting outside the model either lets it through or blocks it. claude > /loop 5m read signals, propose paper trades here's the split: ▸ Sonnet 5.5 reads 5 minute bars and proposes, it never places anything itself ▸ a PreToolUse hook checks every order against hard limits written in code ▸ exit 2 blocks the order, and the model cannot argue with it ▸ the account is paper, simulated fills, not a cent of real money the limits are the whole system: max $500 per order, max 3 open, day stop at -$200. those live in code, not in the prompt. a limit written in a prompt is a suggestion, a limit written in a hook is a wall. the loop expires after 7 days on its own, so a forgotten agent cannot still be running in three weeks. and the part the file says out loud: a backtest is not tomorrow, and none of this is advice. paper first, always. the model proposes. the code disposes. the account is fake until you prove the edge is not. JEV engineering is the same move one layer down: 1,301 forks this run - trade or wait, size, exit or hold - resolved in code at 0.90 sharpness, and the split ones (size, at 0.54) just wait instead of guessing the full tree ▸ a scheduled loop ticks every 5 minutes and reads the signals ▸ Sonnet 5.5 proposes a trade with the reason attached, nothing more ▸ a PreToolUse hook validates it against limits that live in code ▸ exit 2 blocks the order outright, no override, no retry ▸ every fill is simulated and every decision is logged ▸ JEV resolves micro-forks in code and waits on anything split paste the tree and this prompt into Claude Code ↓ "Rebuild my trading setup around this tree: 1. Run a scheduled loop that reads signals and proposes trades, never executes them directly. 2. Put every limit in a PreToolUse hook in code: max order size, max open positions, daily stop. The model must not be able to change them. 3. Any order that breaks a limit exits 2 and is blocked, with no retry and no resizing around it. 4. Paper account only, simulated fills, until I explicitly say otherwise. 5. Log every proposal, every block and the reason, including the trades that were skipped. 6. Give the loop an expiry date so it cannot run forever unattended. Show me every change as a diff first. No edits until I say go." ↳ http://code.claude.com/docs/en/model-config save it, the hook is the only part of this that protects your money.
This post quotes another post: x.com/sprytixl/status/2107763347097534680