Claude Code

公式

リンク

みんなのClaude.md

関連プロダクト

Best practices

1. Customize your setup

a. Create CLAUDE.md files

  • Claude セッション開始時に自動で読み込まれる特殊ファイル
  • /init コマンドで、初期構成として Claude が自動で生成してくれる
    • 途中でやると現状に合わせて更新はしてくれる
  • 以下のような情報をドキュメント化しておく
    • よく使う bash コマンド
    • 主要なファイルやユーティリティ関数
    • コードスタイルのガイドライン
    • テスト手順
    • リポジトリのエチケット(ブランチ命名ルール、マージ vs リベース など)
    • 開発環境セットアップ(pyenv の使用方法やコンパイラ設定など)
    • プロジェクト固有の注意点や警告事項
    • その他、Claude に「覚えておいてほしい」情報全般
  • フォーマットは自由だが、わかりやすく簡潔にまとめるのが望ましい

b. Tune your CLAUDE.md files

c. Curate Claude's list of allowed tools

  • システムに変更を加える可能性のある操作は確認を求められる
  • 許可しても問題ない操作の許可設定をおこない効率化する
      1. セッション中に表示されるプロンプトで「Always allow(常に許可)」を選択する
      1. Claude Code 起動後に /permissions コマンドを使用して、ツールの追加・削除を行う
      1. .claude/settings.json または ~/.claude.json を手動で編集する
      1. --allowedTools CLI フラグを使って、セッションごとに許可を設定する

d. If using GitHub, install the gh CLI

  • GitHub CLIをインストールしておけば、それを使ってくれる

2. Give Claude more tools

a. Use Claude with bash tools

b. Use Claude with MCP

c. Use custom slash commands

3. Try common workflows

a. Explore, plan, code, commit

b. Write tests, commit; code, iterate, commit

c. Write code, screenshot result, iterate

d. Safe YOLO mode

e. Codebase Q&A

f. Use Claude to interact with git

g. Use Claude to interact with GitHub

h. Use Claude to work with Jupyter notebooks

4. Optimize your workflow

a. Be specific in your instructions

b. Give Claude images

c. Mention files you want Claude to look at or work on

d. Give Claude URLs

e. Course correct early and often

f. Use /clear to keep context focused

g. Use checklists and scratchpads for complex workflows

h. Pass data into Claude

5. Use headless mode to automate your infra

a. Use Claude for issue triage

b. Use Claude as a linter

6. Uplevel with multi-Claude workflows

a. Have one Claude write code; use another Claude to verify

b. Have multiple checkouts of your repo

c. Use git worktrees

d. Use headless mode with a custom harness

作成日: 2025-06-27 19:37
更新日: 2025-07-08 22:11