Skip to content

CLAUDE.md: 「どこに記録するか」(CLAUDE.md/docs vs Claude memory) の指針節を追加 - #53

Merged
thawk105 merged 1 commit into
masterfrom
claude-md-recording-policy
May 13, 2026
Merged

CLAUDE.md: 「どこに記録するか」(CLAUDE.md/docs vs Claude memory) の指針節を追加#53
thawk105 merged 1 commit into
masterfrom
claude-md-recording-policy

Conversation

@thawk105

Copy link
Copy Markdown
Owner

#52 の follow-up。

動機

Claude には per-project の private memory (~/.claude/projects/.../memory/) があり、CLAUDE.md / docs とは届く範囲が違う:

  • memory: 1 Claude インスタンス + 1 ローカル環境のみ。リポを clone した他人や他の Claude には届かない
  • CLAUDE.md / docs: 全 contributor + 全 Claude 共通

この区別を「私 = Claude」しか知らないと、別の Claude セッションや別の contributor が ユーザーの個人的な好みを CLAUDE.md に commit してしまう ような事故が起こりうる (= shared repo を一個人の taste で汚染する)。

今回のレビューでユーザー本人から「使い分けノウハウを repo にも記録しないと困らない?」と直接指摘されて気付いた。memory に書いただけだと、私の中では予防できても他の Claude には伝わらない。

変更

CLAUDE.md に「Where to record what you learn (CLAUDE.md / docs vs Claude memory)」節を追加。

判断軸:

カテゴリ 行き先
Repository facts (architecture, build flow, protocol matrix) CLAUDE.md / docs
Coding conventions adopted by the project CLAUDE.md / docs
Decision rationale that future maintainers will need CLAUDE.md / docs
User preferences (返信言語、commit trailer 抑止) Claude memory
Claude's own behavioral heuristics (subagent parallelization rules etc.) Claude memory
"Last time I made mistake X" — Claude が自分用に残すリマインダ Claude memory

ルール: 「a new contributor cloning the repo would need this?」 → yes なら repo、no なら memory

Test plan

`.md` の追加のみ。CI 動作に影響なし。

Claude には per-project の private memory があり、CLAUDE.md / docs と
ターゲットが違う。memory は個人 (1 Claude インスタンス) の収納庫で、
repo を clone した他人や他の Claude には届かない。

どっちに書くか迷わない指針を CLAUDE.md に明文化:

- リポジトリ全員が知るべき事実・規約 → CLAUDE.md / docs
- ユーザー個人の好み (返信言語、commit trailer 抑止) や、Claude 自身
  の行動ヒューリスティック (subagent 並列度、prompt パターン) → memory
- 個人化情報を CLAUDE.md に commit して repo を汚染しないこと

これがないと、別の Claude や別の人が「memory の存在を知らずに個人的な
好みを CLAUDE.md に押し込む」事故が起こりうる。今回のレビューでユーザー
本人から指摘されて気付いた点 (= memory にだけ書いておくと再発)。
@thawk105
thawk105 merged commit 704da55 into master May 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant