Prompts2026年4月6日·1 分钟阅读

Awesome CLAUDE.md — Project Config Best Practices

Community collection of CLAUDE.md templates and best practices for configuring Claude Code per-project. Includes templates for monorepos, web apps, Python projects, and team workflows. 3,000+ stars.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Prompt
安装
Single
信任
信任等级:Community
入口
Awesome CLAUDE.md — Project Config Best Practices
先审查命令
npx -y tokrepo@latest install e0565f2a-21a4-4f82-8ba2-1f77ac970144 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
A curated collection of CLAUDE.md templates that tell Claude Code your project conventions, tech stack, and architecture.
§01

What it is

Awesome CLAUDE.md is a community-maintained collection of CLAUDE.md templates and best practices for configuring Claude Code on a per-project basis. A CLAUDE.md file in your project root tells Claude Code about your codebase conventions, tech stack, architecture decisions, and team preferences so it generates code that fits your project from the first interaction.

The collection targets developers and teams using Claude Code who want to reduce repetitive instructions. Instead of explaining your project setup in every conversation, you write it once in CLAUDE.md and Claude Code follows it automatically.

§02

How it saves time or tokens

Without a CLAUDE.md, every Claude Code session starts from zero -- you explain your stack, naming conventions, forbidden patterns, and architecture before getting useful output. A well-written CLAUDE.md eliminates this setup overhead. The model reads it at the start of each session and generates code that conforms to your standards immediately.

The token estimate for this workflow is approximately 2,600 tokens. Templates are designed to be concise enough that they fit within Claude Code's context without consuming excessive token budget.

§03

How to use

  1. Create a CLAUDE.md file in your project root:
# CLAUDE.md
§04

Project Overview

This is a Next.js 14 app with TypeScript, Tailwind CSS, and Prisma ORM.

§05

Commands

  • npm run dev -- Start dev server
  • npm run test -- Run tests
  • npm run lint -- Run ESLint + Prettier
§06

Code Style

  • Functional components only, no class components
  • Use Server Components by default
  • State: Zustand for client, React Query for server
  • Naming: PascalCase components, camelCase functions, kebab-case files
§07

Do NOT

  • Do not use Redux or Context API for state
  • Do not create CSS modules -- use Tailwind only
  • Do not add comments explaining obvious code

2. Open Claude Code in your project directory. It reads CLAUDE.md automatically.

3. Start working. Claude Code follows your documented conventions without being told.
§08

Example

A CLAUDE.md for a Go backend project:

# CLAUDE.md
§09

Stack

Go 1.22 + Chi router + sqlc + PostgreSQL

§10

Architecture

  • cmd/server/ -- Entry point
  • internal/handler/ -- HTTP handlers
  • internal/service/ -- Business logic
  • internal/repo/ -- Database queries (sqlc generated)
§11

Rules

  • All errors must be wrapped with fmt.Errorf('operation: %w', err)
  • No global variables except logger
  • Tests use testcontainers-go for database tests
  • Run 'make lint' before committing
§12

Related on TokRepo

§13

Common pitfalls

  • CLAUDE.md files that are too long consume token budget that could go toward actual work. Keep templates under 500 words and focus on decisions, not documentation.
  • Conflicting instructions (e.g., 'use Tailwind' in one section and 'use CSS modules' in another) confuse the model. Review for consistency before committing.
  • CLAUDE.md is not a substitute for proper documentation. It tells the AI how to work in your project; it does not replace README.md or architecture docs for human readers.

常见问题

Where should I put the CLAUDE.md file?+

Place it in your project root directory, next to your package.json or go.mod. Claude Code automatically discovers and reads CLAUDE.md files when you open a session in that directory.

Can I have multiple CLAUDE.md files in a monorepo?+

Yes. Place a root CLAUDE.md with shared conventions and additional CLAUDE.md files in subdirectories for package-specific rules. Claude Code reads the most relevant one based on your working context.

Does CLAUDE.md work with other AI coding tools?+

CLAUDE.md is specific to Claude Code. Other tools may have their own configuration files (like .cursorrules for Cursor). The templates in this collection are designed for Claude Code but the concepts apply broadly.

How long should a CLAUDE.md be?+

Aim for 200-500 words. Cover your tech stack, key commands, naming conventions, architecture, and explicit prohibitions. Longer files work but consume more of Claude Code's context budget per session.

Should I commit CLAUDE.md to version control?+

Yes. CLAUDE.md documents project conventions and is valuable for all team members using Claude Code. Commit it alongside your code so everyone gets the same AI behavior.

引用来源 (3)
🙏

来源与感谢

Community-maintained collection. Licensed under MIT.

awesome-claude-md — ⭐ 3,000+

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产