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

CLAUDE.md

claude-code-best-practice-cn CLAUDE.md is an instructions file for Claude Code from clxzl/claude-code-best-practice-cn. It costs 1,807 tokens per session, scanned B, original, MIT.

A Chinese-language set of instructions showing how Claude Code projects can organize skills, subagents, hooks, and commands. Claude Code is a coding assistant that can follow repository-specific instructions and call specialized workflows.

In plain words
What is it for?
Use it as a reference when defining skills, preloading skills into agents, creating slash commands, or building a small example workflow such as fetching and displaying weather data.
Why use it?
It gives contributors a concrete structure for connecting commands, agents, and reusable skills without having to design that organization from scratch.

Instructions file for Claude Code

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/clxzl/claude-code-best-practice-cn/claude-md"><img src="https://agentmods.dev/badge/instructions/clxzl/claude-code-best-practice-cn/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,807 This file is loaded in full into every session.
When invoked 1,807 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.01807 $0.01807
Opus 5 $0.00903 $0.00903
Sonnet 5 $0.00361 $0.00361
Haiku 4.5 $0.00181 $0.00181

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

Security

Grade B, and why

claude-code-best-practice-cn 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 · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 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 的模式。它作为参考实现,而非应用代码库。

关键组件

天气系统(示例工作流)

通过 命令 → Agent → Skill 架构演示两种不同的 Skill 模式:

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

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

Skill 定义结构

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

  • name:显示名称和 /slash-command(默认为目录名)
  • description:何时调用(建议用于自动发现)
  • argument-hint:自动补全提示(如 [issue-number]
  • disable-model-invocation:设为 true 可防止自动调用
  • user-invocable:设为 false 可从 / 菜单中隐藏(仅作为背景知识)
  • allowed-tools:Skill 激活时无需权限提示即可使用的工具
  • model:Skill 激活时使用的模型
  • context:设为 fork 可在隔离的 subagent 上下文中运行
  • agentcontext: fork 的 subagent 类型(默认:general-purpose
  • hooks:此 Skill 作用域内的生命周期 Hooks

演示系统

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

Hooks 系统

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

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

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

特殊处理:git commit 会触发 pretooluse-git-committing 声音。

关键模式

Subagent 编排

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

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

Read the full file on GitHub · 115 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 · 115 lines · 1,807 tokens per session scan B 2ad3f19610fb

Subscribe to this mod's changes

claude-code-best-practice-cn CLAUDE.md is an instructions file published in the GitHub repository clxzl/claude-code-best-practice-cn (127 stars, last pushed 4mo ago), licensed MIT. It adds 1,807 tokens to every session, about $0.0090 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-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

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