Claude researches, Jev decides, you approve
A simulation-only trading research loop: Claude writes the analysis, TypeSafe’s Jev answers TRADE, WAIT or REJECT, a risk check sizes the plan, and nothing happens until a person says yes. Its script was run against both SDKs, so the crash on Claude Opus 5.5 is fixed and the risk check it leaves out is written
A trading research system that never places a trade. Claude reads only the market data you give it and writes facts, assumptions, gaps, a thesis and risks. Jev, TypeSafe’s decision model, turns that into TRADE, WAIT or REJECT with probabilities and a confidence. A risk check sizes any TRADE inside your own limit, and every decision is saved as a JSON file that waits for a person to approve it. This is the whole guide: setup, script, four prompts, a worked example, safety rules, troubleshooting and a final checklist. Its script was also run against both SDKs. On Claude Opus 5.5 it crashes whenever Claude thinks before answering, the risk limits it sets are never read, and its safety checks vanish under python -O. The fixed script and a working risk check are below.
AI cannot guarantee profits, and this system is built so that nothing is ever executed without a human saying yes. No live trading is enabled anywhere in this guide. Start in a simulated or sandbox account, and stay there until you have reviewed many logged decisions.
Claude does the research. Jev makes a typed decision: TRADE, WAIT or REJECT. A risk check sizes it. You approve it. Everything is logged. Low-confidence or incomplete setups are rejected by design, and every decision is saved to a file for you to read. Simulation only, with human approval required.
What you build, and what you supply
There is no repository or download for this system. You build it in an empty folder from the files on this page. Jev is a model from TypeSafe AI, which calls it a “System One” model: it answers structured questions with a typed decision, a probability for each option and a confidence. Jev is not a trading product; here it plays the decision agent.
Everything platform-specific is a placeholder you fill in: [YOUR DATA SOURCE] for the market data, and your platform’s paper-trading or demo mode for the simulated account. The system never connects to either.
What held up, on 1 October 2026
The guide says it was checked against both companies’ docs on 30 September 2026. This re-check used the same docs, and ran its script with the real SDK packages (anthropic 1.11.0, typesafe-sdk 0.7.2) against mocked API replies. No live keys were used.
System overview
Market data → Claude research → Jev decision → Risk check → Human approval → Review.
What you need
Never paste API keys, seed phrases, passwords or financial credentials into a Claude or Jev chat. Keys live in a local .env file that stays on your machine.
Quick setup
Placeholders in [BRACKETS] are yours to fill. The install lines were run on 1 October 2026.
Create the project folder
There is no repository to download, so create a folder instead, with the first line below.
Install the requirements
Create a virtual environment and install the three packages, with the second and third lines. On Windows, activate it with .venv\Scripts\activate instead.
Create the environment file
Save the .env.example below, copy it to .env, and add .env to .gitignore.
Add credentials securely
Paste your two keys into .env only. Both SDKs read them from the environment, as ANTHROPIC_API_KEY and TYPESAFE_API_KEY. Never put them in a prompt, a screenshot or a repository.
Select sandbox or simulation mode
MODE=simulation is the default and the only mode this guide uses. Your platform’s paper account stays separate: this system never connects to it.
Configure risk limits
Edit the two MAX_* lines. The risk check in part 4 refuses any size above the per-trade limit.
Start the system
Save Prompt 1 from part 4 as prompts/claude_research.txt first, since the script reads it. Then save the script below as run.py and start it with the command shown after it.
Run one test analysis
Paste a short block of market notes when prompted, or use the fictional sample in part 5.
Review the output manually
Open decisions/ and read the JSON that was written.
Confirm that no live trade can execute without approval
Search run.py: there is no order function and no broker import, and it refuses to start unless REQUIRE_HUMAN_APPROVAL=true. Its last line prints “AWAITING HUMAN APPROVAL”.
run.py
The guide’s script with six fixes, each explained in the table above. The mode and approval checks are plain ifs that run before any API call. max_tokens is 16,000, because thinking counts toward it, and a reply that was cut off or declined stops the script. The research is read from text blocks by type, not from content[0]. The evidence levels describe situations. A TRADE under 0.7 confidence becomes REJECT, with Jev’s own answer kept as jev_choice. Still no order placement anywhere in the file.
The guide runs the risk check (Prompt 3) as a second Claude call on any TRADE, to add once the first loop works. Its rule: position size is always bounded by MAX_RISK_PER_TRADE_PCT from your .env, never chosen by the AI alone. Nothing in the guide enforces that rule yet; the risk-check script in part 4 does.
Copy-and-paste agent prompts
Save Prompt 1 as prompts/claude_research.txt. Use the others in the Claude app, or as further calls.
Prompt 1: Claude research
Prompt 2: Jev decision
The Choice instructions in run.py, written out in full; also usable as a plain prompt with any custom decision agent. Through the SDK, Jev returns the choice, the confidence and the probabilities; the reasons come from running this as a plain prompt.
Prompt 3: Risk check
Prompt 3 as a script
Claude proposes the prices; code does the arithmetic, as TypeSafe advises for Jev and the guide promises for the AI in general. Add SIM_ACCOUNT_SIZE=10000, the size of your simulated account, to .env. Save this as risk_check.py and run it on a TRADE with python risk_check.py decisions/<file>.json. It writes a risk_plan into that file and leaves human_approval at PENDING. It rejects when a price is not in the data, when the stop or target sits on the wrong side of the entry, or when R:R is below 2.
The arithmetic, on fictional numbers
What risk_check.py computes for a long setup with the 0.5% rule from .env.example. A short works the same way, mirrored.
Prompt 4: Post-trade review
“Helio Grid Robotics (HGRB)” does not exist. Every number is invented. Simulation only: no balances, no profits, no results implied.
Example workflow
Market data supplied (fictional)
HGRB, daily chart. Close 17.60. 20-day average 17.10. 20-day range 16.20–18.90. Volume today 1.4× the 20-day average. Note: “Q3 results scheduled Oct 2 (per IR page).” No news pasted.
Claude’s research summary (condensed)
FACTS: close above the 20-day average; volume elevated; results Oct 2. ASSUMPTIONS: elevated volume may reflect pre-earnings positioning. MISSING: no earnings expectations, no sector context, no intraday levels. THESIS: price is holding above its average into a known catalyst; the setup depends on the catalyst, which is unknown. RISKS: binary earnings move; thin evidence. CONFIDENCE NOTE: low, one price fact and one date.
Jev’s decision (condensed)
Decision: WAIT. Confidence: 0.81. Supporting: price above average, volume elevated. Conflicting: none stated. Missing: earnings expectations, sector context. Risk warnings: the catalyst is binary, and the sample of facts is small.
Risk check
Not run: the decision was WAIT, so no plan is produced. Had it been TRADE, the risk desk would have required an entry, an invalidation level, a stop beyond it, a target, R:R and a size within the user’s 0.5% rule, or returned REJECT.
Human approval step
The file decisions/2026-09-30T14-02-11.json shows "decision": "WAIT" and "human_approval": "PENDING". The human reads it, agrees, and writes "human_approval": "AGREE — revisit after Oct 2 with the transcript". Nothing is placed.
Final review (after Oct 2, fictional)
Thesis: hold above the average into the catalyst. Decision: WAIT at 0.81. Plan: none. Outcome: user notes only. Mistakes: none in process; the data was thin and the system said so. Next time: add sector context and expectations before the run.
Safety rules
Read before running.
Quick troubleshooting
Final checklist
A research and decision log, not a trading bot. No broker or order integration is claimed or included, and nothing in it can place an order. Your data source and paper-trading account are yours to supply. Claude is a product of Anthropic and Jev a product of TypeSafe AI. HGRB is fictional. Educational only, not financial advice.