Tips & Tricks (更新: 2026/5/23)

Claude Codeで使うCLAUDE.mdテンプレート7選 | 実案件にそのまま貼れる例

個人開発、コンテンツサイト、API、チーム開発、レガシー改修向けに、そのまま使えるCLAUDE.mdテンプレート7本をまとめました。

Claude Codeで使うCLAUDE.mdテンプレート7選 | 実案件にそのまま貼れる例

CLAUDE.md の解説記事は多いですが、実際の現場で困るのは「何を書くべきかが具体化されていない」ことです。技術スタックを書くだけでは、Claude Code はまだ同じミスを繰り返します。

このページでは、初心者向けガイドCLAUDE.md Best Practices の間を埋めるために、そのまま貼って使えるテンプレートを 7 本に絞って紹介します。

最短ルートは次です。

  1. 無料の Claude Code Quick Reference Cheatsheet を横に置く
  2. 自分のリポジトリに近いテンプレを 1 つ選ぶ
  3. 「やること」より先に「やってはいけないこと」を 3 つ足す
  4. より完成度の高い例や hooks / permissions まで欲しければ The Complete Claude Code Setup & Configuration Guide を使う
  5. チーム運用に落とし込みたいなら 導入相談 へ進む

良い CLAUDE.md がやっていること

強い CLAUDE.md は、次の 3 つの失敗を減らします。

  • 編集場所は合っているのにローカル規約を外す
  • 修正はできたが、必要な検証を飛ばす
  • リポジトリ境界が曖昧で探索範囲が広がりすぎる

そのため、最低限ほしい項目は次です。

  • 技術スタックと主要コマンド
  • ディレクトリの役割
  • プロジェクト固有ルール
  • 作業手順
  • 禁止事項

特に効くのは後ろ 2 つです。Claude Code は「どう進めるか」と「何をするな」を書いた瞬間に安定します。

1. 個人開発の Web アプリ向け

# Project Overview

Customer-facing Astro site with a small Node API.

## Tech Stack

- Frontend: Astro 5 + TypeScript
- Styling: Tailwind CSS
- Backend: Node.js 22
- Tests: Vitest

## Key Directories

- `site/src/pages/` route entrypoints
- `site/src/components/` reusable UI
- `site/src/content/` blog and docs content
- `scripts/` operational scripts

## Common Commands

- Build: `cd site && npm run build`
- Test: `npm run test`
- Search content: `rg "keyword" site/src/content`

## Working Rules

- Prefer minimal diffs over wide refactors
- Keep copy changes aligned with existing brand tone
- When editing UI, verify mobile width before calling the task done

## Do Not

- Do not rename routes unless required
- Do not delete analytics or SEO fields
- Do not claim deploy success without checking the public URL

ここで重要なのはスタック説明より、モバイル確認と公開 URL 確認を成功条件にしていることです。

2. 記事・PDF・商品導線があるコンテンツサイト向け

# Project Overview

Multilingual Claude Code content site with free PDF lead magnet, Gumroad products, and consultation funnel.

## Business Goal

- Priority 1: free PDF registration
- Priority 2: Gumroad product clicks and purchases
- Priority 3: consultation inquiries

## Content Rules

- Every new article must include internal links
- Every article must include free PDF, product, and consultation CTA paths
- Use the same slug across all locales when publishing multilingual posts

## Verification Workflow

1. Build the site
2. Deploy the site
3. Open the public URL
4. Check mobile layout
5. Confirm CTA destination links

## Do Not

- Do not publish only one locale when the article requires all locales
- Do not treat build success as release success
- Do not prioritize pageviews over conversion path quality

収益導線があるサイトでは、一般的な開発用テンプレだけだと弱すぎます。PV ではなく CTA 品質を優先すると明記した方が実運用に効きます。

3. バックエンド API 向け

# Project Overview

Internal TypeScript API for billing and account management.

## Tech Stack

- Node.js 22
- Fastify
- PostgreSQL + Prisma
- Zod
- Vitest

## Directory Map

- `src/routes/` HTTP handlers
- `src/services/` business logic
- `src/repositories/` DB access
- `src/lib/` shared utilities

## Required Workflow

1. Read the route or service first
2. Check for existing schema and tests
3. Make the smallest safe change
4. Run unit tests or type checks
5. Summarize risk in plain English

## Do Not

- Do not bypass Zod validation
- Do not edit migrations casually
- Do not touch billing logic without tests

Summarize risk in plain English の 1 行は強力です。Claude Code に「直した」だけで終わらせず、影響範囲を言語化させられます。

4. チーム開発向け

# Team Workflow

- Work on the current branch only
- Do not revert changes you did not make
- Call out uncertainty before making broad edits
- Prefer review-friendly patches over large rewrites

## Pull Request Expectations

- Mention user-facing behavior changes
- Mention test coverage gaps
- Flag security, permissions, and deploy risks first

## Approval Boundaries

- Ask before deploy commands
- Ask before editing CI, infra, or secrets-related files
- Ask before changing lockfiles unless required

チームで問題になりやすいのは、生産性不足よりレビューしづらい差分です。そこを CLAUDE.md で先回りします。

5. レガシーコード向け

# Legacy Repo Notes

- This codebase has inconsistent patterns
- Prefer compatibility over elegance
- Preserve behavior unless the task explicitly allows change

## Investigation First

1. Explain current behavior
2. Locate the smallest responsible file set
3. Identify risks before editing

## Do Not

- Do not rename public methods casually
- Do not introduce new frameworks
- Do not rewrite files only to match modern style

レガシー案件では、compatibility over elegance が最重要になることが多いです。きれいさより事故防止を優先します。

6. 自動化・運用スクリプト向け

# Automation Rules

- Dry-run whenever the script supports it
- Log intended side effects before executing
- Prefer idempotent operations
- Keep secrets out of logs and generated files

## Required Checks

- Confirm environment variables used
- Confirm target environment
- Confirm output path or destination service

## Do Not

- Do not send emails, deploy, or publish without explicit approval
- Do not delete generated assets unless cleanup is requested

メール送信、デプロイ、外部 API 書き込みがあるなら、このタイプの CLAUDE.md が最初の候補です。

7. モノレポ向け

# Monorepo Map

- `apps/web/` customer app
- `apps/admin/` internal admin tool
- `packages/ui/` shared UI
- `packages/config/` lint and tsconfig presets

## Ownership Rules

- Web UI work should stay inside `apps/web/` unless the task clearly needs a shared component change
- Shared package edits require checking downstream usage
- Avoid version or config churn unless necessary

## Verification

- Run the narrowest relevant build or test command first
- Describe cross-package impact before editing shared code

モノレポでは「どの package が責任を持つか」を先に書くだけで、横断編集の事故がかなり減ります。

よくある失敗

失敗 1. 会社 Wiki みたいに長く書く

説明が長いほど良いわけではありません。CLAUDE.md は運用ファイルです。長文背景より、短い行動ルールの方が効きます。

失敗 2. コマンドだけ書いて手順を書かない

npm run test より、billing を触ったら test を必ず回す の方が強いです。

失敗 3. 禁止事項がない

.env を触るな公開 URL 未確認で deploy 成功と言うなforce push するな のような一文が事故を止めます。

失敗 4. 更新しない

Claude Code が同じ失敗を 3 回繰り返したら、たいてい CLAUDE.md 側の粒度が足りません。

どのテンプレを選ぶべきか

  • UI やプロダクト中心なら個人開発テンプレ
  • 記事・PDF・Gumroad 導線があるならコンテンツサイトテンプレ
  • 整合性重視なら API テンプレ
  • 調整コストが高いならチーム or モノレポテンプレ
  • 事故コストが高いならレガシー or 自動化テンプレ

7 本を全部混ぜる必要はありません。1 本を土台にして、行動が変わるルールだけ足してください。

次にやること

  1. いちばん近いテンプレを CLAUDE.md に貼る
  2. 自分の案件用の Do Not を 3 行足す
  3. 「何を確認したら完了か」を 1 行で入れる

まずは無料の Claude Code Quick Reference Cheatsheet を手元に置き、より完成度の高いテンプレ、hooks、permissions、運用例が必要なら The Complete Claude Code Setup & Configuration Guide を使ってください。チーム標準化や導入フロー設計まで一緒に詰めたい場合は 導入相談 が最短です。

関連記事

#claude-code #CLAUDE.md #template #workflow #productivity
無料プレゼント

無料PDF: Claude Code はじめてのチートシート

まずは無料PDFで基本コマンドと最初の使い方をまとめて確認してください。登録後はそのままテンプレート集や導入相談にも進めます。

スパムは送りません。登録情報は厳重に管理します。

Claude Codeを仕事で使える形にしませんか?

無料PDFで基礎を固めたあと、すぐ使えるテンプレート集で試し、必要なら業務自動化や導入相談まで進められます。

Masa

この記事を書いた人

Masa

現役DX室長|Claude Code でゼロから多言語AI技術メディア運営中。実務直結の自動化、AI開発相談・研修受付中。

PR

関連書籍・参考図書

この記事のテーマに関連する書籍を楽天ブックスで探せます。

※ 当サイトは楽天市場のアフィリエイトプログラムに参加しています。上記リンクから商品をご購入いただくと、運営者に紹介料が支払われる場合があります。