Xenon: Instructions file for Claude Code

CLAUDE.md

Xenon CLAUDE.md is an instructions file for Claude Code from xianyu-sheng/Xenon. It costs 1,481 tokens per session, scanned A, original, MIT.

A set of project instructions for Xenon, covering bug fixes, reusable design rules, and how the system connects to MCP tools. MCP is a way for an agent to discover and call external tools.

In plain words
What is it for?
Use it when changing Xenon, especially while fixing bugs or adding MCP tools. It guides investigation from registration and discovery through prompting, calls, results, and saved configuration.
Why use it?
It directs developers to fix underlying data-flow problems instead of patching isolated symptoms. It also discourages maintaining separate rules for every possible tool or topic.

Instructions file for Claude Code

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

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

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/xianyu-sheng/Xenon/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/xianyu-sheng/Xenon

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 Xenon CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/xianyu-sheng/xenon/claude-md/github.svg)](https://agentmods.dev/instructions/xianyu-sheng/xenon/claude-md)
Your own site
<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.

agentmods 80×15 button for Xenon CLAUDE.md

Your own site · 80×15
<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>
Per session 1,481 This file is loaded in full into every session.
When invoked 1,481 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.01481 $0.01481
Opus 5 $0.00740 $0.00740
Sonnet 5 $0.00296 $0.00296
Haiku 4.5 $0.00148 $0.00148

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

Security

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.

CLAUDE.md · 118 lines

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 个文件建立正确的信息流动路径。

方法

  1. 画出受影响功能的完整数据流(从用户输入 → 中间层 → 最终输出)
  2. 找出所有信息断裂点(数据存在但未传递到需要它的地方)
  3. 设计统一的集成契约(一个接口/一个数据结构/一个生命周期钩子)
  4. 在所有断点处同时修复,确保端到端信息流通

反例(禁止):

  • 发现 LLM 猜错 MCP 工具名 → 只改 system prompt
  • 发现 MCP 输出为空 → 只改 _mcp_call 返回值
  • 发现 MCP 重启丢失 → 只在 /mcp add 加保存逻辑

正例(期望):

  • 画出 MCP 的完整数据流:注册 → 发现 → 提示注入 → 调用 → 结果提取 → 持久化
  • 一次性修复所有断裂点,建立统一的 MCP 集成契约

通用设计,而非特例枚举

绝不使用封闭集合(如正则枚举"天气|高铁|酒店")来分类/路由。 使用基于结构特征的通用规则(如疑问句式、查询动词、时间敏感度)。

反例

# 每次新增 MCP 工具都要加正则 — 不可持续
r"(?:查|查一下).{0,10}(?:高铁|火车|动车|航班|机票)"

正例

# 基于语言结构,不依赖领域关键词 — 任何 MCP 工具自动受益
r"(?:查|搜|找|查询).{0,20}"  # 通用查询动词

MCP 集成架构

当前问题

MCP 子系统的各项功能(注册、发现、调用、持久化)是孤立实现的, 缺少统一的集成层。导致多个信息断裂点:

  1. MCP 工具 → LLM 提示词:引擎的 system prompt 构建时不知道 MCP 工具存在
  2. MCP 结果 → LLM 观察_mcp_call 的返回值缺少标准化的文本字段
  3. MCP 配置 → 磁盘:注册表纯内存,无持久化
  4. 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 复现原问题场景, 确认修复生效,并跑同类型的其他任务验证无回归。

方法

  1. 复现原 bug 的确切输入,确认不再报错且结果正确
  2. 跑 1-2 个同类型但不同参数/场景的变体任务
  3. 如果涉及 MCP/工具,确认端到端输出完整(不是"无文本输出")

反例(禁止):

  • 改了代码 → 只跑单元测试 → 提交推送
  • 单元测试全绿 ≠ 真实场景可用

Read the full file on GitHub · 118 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. 10d ago First seen · 118 lines · 1,481 tokens per session scan A 5a7ea782eff2

Subscribe to this mod's changes

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.

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

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.

github/spec-kit · 7,104 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