tradewars: Instructions file for Claude Code

CLAUDE.md

tradewars CLAUDE.md is an instructions file for Claude Code from ed-donner/tradewars. It costs 3,779 tokens per session, scanned A, original, MIT.

Repository instructions for TradeWars, a game where four AI agents trade live US stocks in a timed competition. Each agent starts with a fixed portfolio and uses market data and private notes.

In plain words
What is it for?
Use them when running the trading arena locally, starting its Python backend and Vite frontend, launching the container, or running unit and optional integration tests.
Why use it?
They explain the two-process local setup, how the frontend connects to the backend, how to run the application in a container, and how its tests are divided.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: positional $N argument.

This is ed-donner/tradewars's own configuration. It tells Claude Code how to work on tradewars itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tradewars configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ed-donner/tradewars. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ed-donner/tradewars/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ed-donner/tradewars

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tradewars CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ed-donner/tradewars/claude-md/github.svg)](https://agentmods.dev/instructions/ed-donner/tradewars/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ed-donner/tradewars/claude-md"><img src="https://agentmods.dev/badge/instructions/ed-donner/tradewars/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tradewars CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ed-donner/tradewars/claude-md"><img src="https://agentmods.dev/badge/instructions/ed-donner/tradewars/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,779 This file is loaded in full into every session.
When invoked 3,779 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03779 $0.03779
Opus 5.5 $0.01512 $0.01512
Sonnet 5.5 $0.00756 $0.00756
Haiku 4.5 $0.00378 $0.00378

Measured 2mo ago against content hash dc59b952296d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tradewars CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tradewars

A battle arena where 4 LLM agents day-trade live US equities for a fixed duration. Each trader starts with $1,000,000, sees realtime market data through the Massive (Polygon) MCP, can persist notes via a per-trader Memory MCP, and competes against three rivals running different frontier models. The clock auto-liquidates everyone at the end and the highest portfolio value wins.

Built with the OpenAI Agents SDK (Python, async), FastAPI + SSE, a Vite + vanilla-TS frontend with uPlot charts, and packaged as a single multi-stage Docker image.

Running locally

Dev (fast inner loop):

# terminal 1 — backend
uv run uvicorn --factory backend.api.app:create_app --port 8000

# terminal 2 — frontend (vite proxies /arena/* to :8000)
cd frontend && npm run dev
# → http://localhost:5173

Container (single port, prod-like):

./scripts/start_mac.sh     # builds image, runs with --env-file .env
# → http://localhost:8000
./scripts/stop_mac.sh

Tests:

uv run pytest                 # 82 unit tests (~4 s)
uv run pytest -m integration  # opt-in 90 s real arena via gpt-oss-120b

The integration test is gated behind the integration marker so it doesn't fire on every pytest run — it spawns real MCP subprocesses and hits OpenRouter + Massive.

Required env vars (in .env at repo root): MASSIVE_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY, DEEPSEEK_API_KEY, OPENROUTER_API_KEY.

Repo layout

backend/
  environment/   accounts.py (SQLite), prices.py (Massive REST)
  traders/       templates.py (system prompt), models.py (provider factory),
                 mcp_servers.py (MCP factories), tools.py (get_state/trade),
                 trader.py (decision-cycle loop)
  arena/         arena.py (lifecycle), config.json (model catalog + presets)
  api/           app.py (FastAPI: /arena/start|stop|tick|stream|config)
  test/          pytest suite + opt-in integration test
frontend/
  src/           api.ts, state.ts, theme.ts, topbar.ts, chart.ts (uPlot),
                 heatmap.ts, log.ts, panel.ts, main.ts, styles.css
  index.html     sidebar (clock + duration + slot pickers + presets +
                 start/stop) + 2×2 panels grid
  vite.config.ts dev proxy to :8000
scripts/         start_mac.sh, stop_mac.sh
Dockerfile       multi-stage (node frontend → python+uv runtime)

Read the full file on GitHub · 202 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 202 lines · 3,779 tokens per session scan A dc59b952296d

Subscribe to this mod's changes

tradewars CLAUDE.md is an instructions file published in the GitHub repository ed-donner/tradewars (22 stars, last pushed 5mo ago), licensed MIT. It adds 3,779 tokens to every session, about $0.0151 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

tradewars CLAUDE.md compared with instructions from other repositories

tradewars CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tradewars CLAUDE.mded-donner/tradewarsInstructions file225mo agoMITA3,779Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot