claude-code-best-practice-zh: Instructions file for Claude Code

CLAUDE.md

claude-code-best-practice-zh CLAUDE.md is an instructions file for Claude Code from rongxinzy/claude-code-best-practice-zh. It costs 2,048 tokens per session, scanned B, original, MIT.

A set of instructions for Claude Code, an AI coding assistant, showing recommended ways to organize commands, agents, and skills in a repository.

In plain words
What is it for?
Use it as a reference when designing Claude Code skills, subagents, hooks, commands, and a sample weather workflow.
Why use it?
It gives an agent and its users a shared map of the project, so they can understand how automated workflows are connected.

Instructions file for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is rongxinzy/claude-code-best-practice-zh's own configuration. It tells Claude Code how to work on claude-code-best-practice-zh 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 claude-code-best-practice-zh configures →

Reuse

Borrowing it

Nothing to install: this file belongs to rongxinzy/claude-code-best-practice-zh. 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/rongxinzy/claude-code-best-practice-zh/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/rongxinzy/claude-code-best-practice-zh

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 claude-code-best-practice-zh CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/rongxinzy/claude-code-best-practice-zh/claude-md"><img src="https://agentmods.dev/badge/instructions/rongxinzy/claude-code-best-practice-zh/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,048 This file is loaded in full into every session.
When invoked 2,048 The same file — it is already loaded in full.
Security scan B 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.02048 $0.02048
Opus 5 $0.01024 $0.01024
Sonnet 5 $0.00410 $0.00410
Haiku 4.5 $0.00205 $0.00205

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

Security

Grade B, and why

claude-code-best-practice-zh CLAUDE.md scanned grade B 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 9d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

5. `~/.claude/settings.json`:全局个人默认值
CLAUDE.md · 126 lines

How it starts

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

CLAUDE.md

本文件为 Claude Code (claude.ai/code) 在处理此仓库代码时提供指导。

仓库概述

这是一个 Claude Code 配置的最佳实践仓库,展示了技能 (Skills)、子代理 (Subagents)、钩子 (Hooks) 和命令 (Commands) 的模式。它作为参考实现而非应用程序代码库。

关键组件

天气系统(示例工作流)

通过 命令 → 代理 → 技能 (Command → Agent → Skill) 架构演示两种不同的技能模式:

  • /weather-orchestrator 命令 (.claude/commands/weather-orchestrator.md):入口点 —— 询问用户摄氏度/华氏度,调用代理,然后调用 SVG 技能
  • weather-agent 代理 (.claude/agents/weather-agent.md):使用预加载的 weather-fetcher 技能获取温度(代理技能模式)
  • weather-fetcher 技能 (.claude/skills/weather-fetcher/SKILL.md):预加载到代理中 —— 从 Open-Meteo 获取温度的指令
  • weather-svg-creator 技能 (.claude/skills/weather-svg-creator/SKILL.md):技能 —— 创建 SVG 天气卡片,写入 orchestration-workflow/weather.svgorchestration-workflow/output.md

两种技能模式:代理技能(通过 skills: 字段预加载)vs 技能(通过 Skill 工具调用)。参见 orchestration-workflow/orchestration-workflow.md 查看完整流程图。

技能定义结构

.claude/skills/<name>/SKILL.md 中的技能使用 YAML frontmatter:

  • name:显示名称和 /slash-command(默认为目录名)
  • description:何时调用(推荐用于自动发现)
  • argument-hint:自动完成提示(例如 [issue-number]
  • disable-model-invocation:设为 true 以防止自动调用
  • user-invocable:设为 false 以在 / 菜单中隐藏(仅作为后台知识)
  • allowed-tools:技能激活时无需权限提示即可使用的工具
  • model:技能激活时使用的模型
  • context:设为 fork 以在隔离的子代理上下文中运行
  • agentcontext: fork 的子代理类型(默认:general-purpose
  • hooks:此技能作用域内的生命周期钩子

演示系统

参见 .claude/rules/presentation.md —— 所有演示工作都委托给 presentation-curator 代理。

钩子系统

.claude/hooks/ 中的跨平台声音通知系统:

  • scripts/hooks.py:Claude Code 钩子事件的主处理器
  • config/hooks-config.json:共享团队配置
  • config/hooks-config.local.json:个人覆盖(git 忽略)
  • sounds/:按钩子事件组织的音频文件(通过 ElevenLabs TTS 生成)

.claude/settings.json 中配置的钩子事件:PreToolUse、PostToolUse、UserPromptSubmit、Notification、Stop、SubagentStart、SubagentStop、PreCompact、SessionStart、SessionEnd、Setup、PermissionRequest、TeammateIdle、TaskCompleted、ConfigChange。

特殊处理:git 提交触发 pretooluse-git-committing 声音。

关键模式

子代理编排

子代理 不能 通过 bash 命令调用其他子代理。使用 Agent 工具(在 v2.1.63 中从 Task 重命名;Task(...) 仍可作为别名使用):

Agent(subagent_type="agent-name", description="...", prompt="...", model="haiku")

Read the full file on GitHub · 126 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. 9d ago First seen · 126 lines · 2,048 tokens per session scan B 69795f4fd255

Subscribe to this mod's changes

claude-code-best-practice-zh CLAUDE.md is an instructions file published in the GitHub repository rongxinzy/claude-code-best-practice-zh (6 stars, last pushed 5mo ago), licensed MIT. It adds 2,048 tokens to every session, about $0.0102 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

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