Borrowing it
Nothing to install: this file belongs to xianyu-sheng/Xenon. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/xianyu-sheng/Xenon/main/CLAUDE.mdgit clone --depth 1 https://github.com/xianyu-sheng/XenonWrote 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.
[](https://agentmods.dev/instructions/xianyu-sheng/xenon/claude-md)<a href="https://agentmods.dev/instructions/xianyu-sheng/xenon/claude-md"><img src="https://agentmods.dev/badge/instructions/xianyu-sheng/xenon/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.
<a href="https://agentmods.dev/instructions/xianyu-sheng/xenon/claude-md"><img src="https://agentmods.dev/badge/instructions/xianyu-sheng/xenon/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01481 | $0.01481 |
| Opus 5 | $0.00740 | $0.00740 |
| Sonnet 5 | $0.00296 | $0.00296 |
| Haiku 4.5 | $0.00148 | $0.00148 |
Grade A, and why
Xenon 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md — Xenon 项目规范
Bug 修复原则
深度根因分析,而非逐洞补漏
当发现一个 bug 时,不要只修复眼前的症状。必须追溯数据流全链路, 找到系统性根因,然后一次性修复所有同类问题。
判断标准:如果修复只改了 1 个文件/1 个函数,很可能是"补漏"而非 "治本"。系统性修复通常需要跨 2-4 个文件建立正确的信息流动路径。
方法:
- 画出受影响功能的完整数据流(从用户输入 → 中间层 → 最终输出)
- 找出所有信息断裂点(数据存在但未传递到需要它的地方)
- 设计统一的集成契约(一个接口/一个数据结构/一个生命周期钩子)
- 在所有断点处同时修复,确保端到端信息流通
反例(禁止):
- 发现 LLM 猜错 MCP 工具名 → 只改 system prompt
- 发现 MCP 输出为空 → 只改
_mcp_call返回值 - 发现 MCP 重启丢失 → 只在
/mcp add加保存逻辑
正例(期望):
- 画出 MCP 的完整数据流:注册 → 发现 → 提示注入 → 调用 → 结果提取 → 持久化
- 一次性修复所有断裂点,建立统一的 MCP 集成契约
通用设计,而非特例枚举
绝不使用封闭集合(如正则枚举"天气|高铁|酒店")来分类/路由。 使用基于结构特征的通用规则(如疑问句式、查询动词、时间敏感度)。
反例:
# 每次新增 MCP 工具都要加正则 — 不可持续
r"(?:查|查一下).{0,10}(?:高铁|火车|动车|航班|机票)"
正例:
# 基于语言结构,不依赖领域关键词 — 任何 MCP 工具自动受益
r"(?:查|搜|找|查询).{0,20}" # 通用查询动词
MCP 集成架构
当前问题
MCP 子系统的各项功能(注册、发现、调用、持久化)是孤立实现的, 缺少统一的集成层。导致多个信息断裂点:
- MCP 工具 → LLM 提示词:引擎的 system prompt 构建时不知道 MCP 工具存在
- MCP 结果 → LLM 观察:
_mcp_call的返回值缺少标准化的文本字段 - MCP 配置 → 磁盘:注册表纯内存,无持久化
- MCP 命令 → 解析器:参数解析不支持
--分隔符
目标架构
MCP 集成应遵循一个统一的契约:
MCPRegistry (唯一真相源)
├── 注册/发现 → tool_map {name: (server, tool_def)}
├── 持久化 → credentials.yaml _mcp_servers 段
├── 启动恢复 → _auto_connect_mcp_servers()
├── → 引擎注入: _build_mcp_tools_list() → engine._mcp_tools_list → system_prompt
└── → 结果提取: _mcp_call 返回 dict 包含 "content" 字段 (与 read_file 一致)
各引擎对 MCP 的支持要求
所有引擎(ReAct / PlanExecute / Reflection / PlanReact / PlanReflection /
ReactReflection)在创建后都应调用 _inject_mcp_tools_into_engine(),
确保 LLM 在任意范式下都能看到可用的 MCP 工具列表。
项目结构
xenon/engine/— 引擎层(ReAct/PlanExecute/Reflection 等)xenon/nodes/— 节点层(ToolNode, ToolExecutor)xenon/repl/— REPL 层(命令、模型池、路由、会话)xenon/mcp/— MCP 子系统(transport, client, registry)
修复后必须真实验证
每次自认为修好 bug 后,必须真正启动 xenon 复现原问题场景, 确认修复生效,并跑同类型的其他任务验证无回归。
方法:
- 复现原 bug 的确切输入,确认不再报错且结果正确
- 跑 1-2 个同类型但不同参数/场景的变体任务
- 如果涉及 MCP/工具,确认端到端输出完整(不是"无文本输出")
反例(禁止):
- 改了代码 → 只跑单元测试 → 提交推送
- 单元测试全绿 ≠ 真实场景可用
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.
- 10d ago First seen · 118 lines · 1,481 tokens per session scan A 5a7ea782eff2
Xenon CLAUDE.md is an instructions file published in the GitHub repository xianyu-sheng/Xenon (52 stars, last pushed 11d ago), licensed MIT. It adds 1,481 tokens to every session, about $0.0074 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.
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.
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.
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).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
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).
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.