TradingAgents-astock: Instructions file for Claude Code

CLAUDE.md

TradingAgents-astock CLAUDE.md is an instructions file for Claude Code from simonlin1212/TradingAgents-astock. It costs 3,359 tokens per session, scanned A, original, Apache-2.0.

Project instructions for TradingAgents-Astock, a Python system in which several AI roles examine Chinese A-share stocks, debate opposing views, and produce an investment report. It also documents the market-data sources and version files.

In plain words
What is it for?
Use them when changing stock-data retrieval, analyst roles, Chinese ticker handling, investment-report generation, or release-version references.
Why use it?
They explain the project's specialized stock-market terms, data flow, agent roles, and versioning checks so changes fit the existing system.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions Claude Code.

This is simonlin1212/TradingAgents-astock's own configuration. It tells Claude Code how to work on TradingAgents-astock 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 TradingAgents-astock configures →

About the project

TradingAgents-Astock is a multi-agent investment research framework adapted for China’s A-share market, where several AI analysts examine market, news, sentiment, policy, fundaments, trading activity, and other factors before debating and assessing risk. It is intended for investment research, study, and teaching rather than providing investment advice or services. The catalogue instruction relates to using this A-share-focused research workflow.

simonlin1212/TradingAgents-astock · 3,222 stars · on GitHub · arxiv.org

Reuse

Borrowing it

Nothing to install: this file belongs to simonlin1212/TradingAgents-astock. 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/simonlin1212/TradingAgents-astock/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/simonlin1212/TradingAgents-astock

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 TradingAgents-astock CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/simonlin1212/tradingagents-astock/claude-md/github.svg)](https://agentmods.dev/instructions/simonlin1212/tradingagents-astock/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/simonlin1212/tradingagents-astock/claude-md"><img src="https://agentmods.dev/badge/instructions/simonlin1212/tradingagents-astock/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 TradingAgents-astock CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/simonlin1212/tradingagents-astock/claude-md"><img src="https://agentmods.dev/badge/instructions/simonlin1212/tradingagents-astock/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,359 This file is loaded in full into every session.
When invoked 3,359 The same file — it is already loaded in full.
Security scan A 1 finding. 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.03359 $0.03359
Opus 5 $0.01680 $0.01680
Sonnet 5 $0.00672 $0.00672
Haiku 4.5 $0.00336 $0.00336

Measured 4d ago against content hash b6f4a4bec143, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

TradingAgents-astock CLAUDE.md scanned grade A with 1 finding 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 4d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

`a_stock.py` 里所有指向 `eastmoney.com` 的请求(push2 / push2his / datacenter-web / search-api / np-weblist 共 7 个调用点)统一走节流入口 `_em_get()`:模块级时间戳串行限流(默认间隔 `EM_MIN_INTERVAL=1.0s`,可用同名环境变量覆盖)+ 0.1~0.5s 随机抖动 + 复用 `requests.Session`(Ke
CLAUDE.md · 151 lines

How it starts

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

TradingAgents-Astock

项目概述

基于 TauricResearch/TradingAgents(65K Stars)的 A 股深度特化 fork。多 Agent 投研框架,7 个 Analyst 角色通过 Bull/Bear 辩论 + 三方风险辩论生成投资报告。

  • 仓库: https://github.com/simonlin1212/TradingAgents-astock
  • 协议: Apache 2.0
  • Python: >=3.10
  • 当前版本: 0.5.17(2026-09-05 发布) ⚠️ 改版本号时三处要一起改pyproject.toml / CHANGELOG.md / 这一行。漏了这行会让后续 agent 和发版流程读到旧版本(tests/test_version_consistency.py 会拦)。

架构

数据层(v0.2.5 全部直连 HTTP,零第三方数据库依赖)

来源 协议 数据
mootdx TCP 7709 OHLCV K线、财务快照、F10 文本
腾讯财经 HTTP (qt.gtimg.cn) PE/PB/市值/换手率
东方财富 datacenter HTTP (datacenter-web) 龙虎榜、限售解禁、板块行情
东方财富 push2/push2his HTTP (push2.eastmoney) 实时行情、个股信息、板块列表、资金流(分钟+日级)
东方财富 np-weblist HTTP 滚动新闻
新浪财经 HTTP (money.finance.sina) K线历史、财报三表
同花顺 10jqka HTTP EPS 一致预期、热股题材
财联社 cls.cn HTTP 全球财经快讯
百度股市通 HTTP (gushitong.baidu) 概念板块归属(资金流已迁移至东财push2)

Agent 角色(7 个)

原版 4 个(市场/情绪/新闻/基本面)+ A 股特化 3 个(政策分析师/游资追踪/解禁监控)

关键路径

  • tradingagents/dataflows/a_stock.py — A 股数据 vendor,所有数据获取入口
  • tradingagents/dataflows/utils.pysafe_ticker_component 路径安全校验 + 中文 ticker 自动解析
  • tradingagents/agents/ — 7 个 Analyst + Bull/Bear 辩论逻辑
  • web/ — Streamlit Web UI
  • cli/ — CLI 入口

中文股票名解析链路

用户/LLM 输入 → safe_ticker_component 检测中文 → resolve_ticker()_build_name_code_map()(mootdx 全市场映射,缓存)→ 返回 6 位代码

已知问题与注意事项

依赖冲突(v0.2.6 已缓解)

mootdx 钉死 httpx>=0.25,<0.26,与 langchain-google-genai 所需的 httpx>=0.28.1 结构性冲突(该区间内每个 google-genai 版本都要 0.28.1,无解)。

v0.3.1 起 [google] extra 已移除(#87):uv 构建覆盖所有 extra 的 universal lock,extra 存在就让所有人uv sync 失败。留空更糟(pip install .[google] 静默装空)。需要 Gemini 时显式装 pip install --no-deps "langchain-google-genai>=4.0.0" + pip install "google-genai>=1.53.0" "httpx>=0.28.1"google_client.py 导入失败会打印这两条命令。⚠️ 新增依赖后务必跑 uv lock --dry-run 验证——pip 能装通不代表 uv 能锁

akshare 已移除(v0.2.5)

v0.2.5 起完全移除 akshare 依赖,所有数据通过直连 HTTP API 获取。

Read the full file on GitHub · 151 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. 4d ago Changed b6f4a4bec143
  2. 7d ago Changed 6ea2357e3e99
  3. 9d ago First seen · 151 lines · 3,359 tokens per session scan A 074c18da4139

Subscribe to this mod's changes

TradingAgents-astock CLAUDE.md is an instructions file published in the GitHub repository simonlin1212/TradingAgents-astock (3,222 stars, last pushed 4d ago), licensed Apache-2.0. It adds 3,359 tokens to every session, about $0.0168 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens