tradewars 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.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ed-donner/tradewars/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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.01889 $0.01889
Sonnet 5 $0.00756 $0.00756
Haiku 4.5 $0.00378 $0.00378

Measured 6d ago against content hash dc59b952296d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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. 6d 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 3mo ago), licensed MIT. It adds 3,779 tokens to every session, about $0.0189 per session on Opus 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

Other instructions, from other repositories

unity-code-style-guide AGENTS.md

Instructions for krogh-jacobsen/unity-code-style-guide, covering agents.md — unity 6 c, project setup — edit this block, never do these — they corrupt the project, deprecated in unity 6 and if you read nothing else.

krogh-jacobsen/unity-code-style-guide · 4,528 tokens

nes-php-glfw copilot-instructions.md

Instructions for oliverearl/nes-php-glfw, covering github copilot development guidelines for nes emulator, agent document source of truth, project overview, code style & standards and documentation.

oliverearl/nes-php-glfw · 2,719 tokens

game-and-watch-retro-go-sd CLAUDE.md

Claude Code instructions for sylverb/game-and-watch-retro-go-sd, covering claude.md, what this project is, build / flash workflow, architecture and three storage tiers, one elf.

sylverb/game-and-watch-retro-go-sd · 2,946 tokens

base-building-trap-defense-design-agent-skill CLAUDE.md

Instructions for dungnotnull/base-building-trap-defense-design-agent-skill, covering claude.md — skill 250: base-building-trap-defense-design, skill identity, problem this skill solves, harness flow summary and sub-skills.

dungnotnull/base-building-trap-defense-design-agent-skill · 1,910 tokens

trident-mcp AGENTS.md

Instructions for mordor-forge/trident-mcp, covering agents.md, what this is, build and test, single-file verification and e2e tests.

mordor-forge/trident-mcp · 1,465 tokens

unreal-mcp-additional-tools CLAUDE.md

Claude Code instructions for nodormu/unreal-mcp-additional-tools, covering claude.md, what this is, commands, architecture and transports (src/transports/).

nodormu/unreal-mcp-additional-tools · 1,727 tokens