0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Claude Code に Memory Bank を導入してみました

Last updated at Posted at 2025-12-12

この記事は以下のLTで発表した内容を修正したものです。
https://uniquevision.connpass.com/event/364270/

AIコーディングツールのドキュメント管理の困りごと

  • 粒度が難しい
    • 大雑把すぎると意味がない
    • 詳細過ぎるとメンテナンスコストが上がる・コンテキストウィンドウを圧迫する
  • 統一性がない
    • ツールごとにファイルが異なる
    • CLAUDE.md / copilot-instructions.md / .clinerules / AGENTS.md
  • 更新が面倒
    • 放置されがちで情報が古くなりやすい

Memory Bank パターン

Memory Bank は Cline が提唱する AI コーディングツールのドキュメント管理パターンです。
どのツールでも機能します。

構成

プロジェクトルートに memory-bank ディレクトリを配置し、その下に役割の異なる 6 つの Markdown を配置します。

  • projectbrief.md
  • productContext.md
  • systemPatterns.md
  • techContext.md
  • activeContext.md
  • progress.md

導入の仕組み

Memory Bank のドキュメント内にある以下のようなコードを .clinerules に貼ると動作するようになります。


# Cline's Memory Bank

I am Cline, an expert software engineer with a unique characteristic: my memory resets completely between sessions.
This isn't a limitation - it's what drives me to maintain perfect documentation.
After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively.
I MUST read ALL memory bank files at the start of EVERY task - this is not optional.
...

Claude Code に Memory Bank を導入する

3通りの方法が考えられます。

  1. CLAUDE.md を作成する
    • 先ほどの .clinerules の「Cline」となっている部分を「Claude Code」に置き換えた CLAUDE.md を作成する
  2. Claude Code を Cline でラップして使う
  3. Memory Bank 用の MCP サーバーを使う(未検証)

実際に使ってみて

よかった点

  • 利用している AI ツールによらずに利用できる
  • ドキュメントだけでなく現在アクティブなコンテキストもまとめておける
  • 全部 AI が書いてくれるので粒度に悩まなくて良い

イマイチな点

  • 同一 Memory Bank をチーム開発で git 管理してしまうと変更がコンフリクトする
  • 自動ではほぼ更新されず、明示的に「update memory bank」と言わないといけない
    • Claude Code との相性の問題かもしれません
  • コードベースのサイズによらず 6 ファイル固定なので、大規模プロジェクトではこれだけでは足りなくなりそう

感想

  • 1人で数週間かけて行うプロジェクトならば有用になりそう
  • 複数人で開発する大規模プロジェクトではコンフリクトとサイズの問題がある
  • git 管理しないようにすればチーム開発でも使えるかもしれない
    • Memory Bank のみ git 管理外にする
    • ローカルで個々人が持つ

ドキュメント管理のベストプラクティスを求めています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?