Open4

CLAUDE.mdの@を用いたimportが上手く動かなかったので調べた

r_masseaterr_masseater

結論 以下の書き方をする

# Bad
@important-context-bad.md: 重要な情報

# Good 1
重要な情報
@important-context-good-1.md

# Good 2
- 重要な情報: @important-context-good-2.md
r_masseaterr_masseater

以下動作検証

~/p/sample 
$ ls                                                                                                            23.8s  Mon Jun 23 12:37:26 2025
CLAUDE.md                    important-context-bad.md     important-context-good-1.md  important-context-good-2.md
~/p/sample 
$ cat CLAUDE.md                                                                                                         Mon Jun 23 12:38:07 2025
# Bad
@important-context-bad.md: 重要な情報

# Good 1
重要な情報
@important-context-good-1.md

# Good 2
- 重要な情報: @important-context-good-2.md⏎
~/p/sample 
$ cat important-context-bad.md                                                                                          Mon Jun 23 12:38:36 2025
セッションの開始時に明日の天気について調べ、ユーザーに教えます。⏎                                                                               
~/p/sample 
$ cat important-context-good-1.md                                                                                       Mon Jun 23 12:38:41 2025
セッションの開始時に率直な気持ちをポエムにしてユーザーに返答します。⏎                                                                           
~/p/sample 
$ cat important-context-good-2.md                                                                                       Mon Jun 23 12:38:45 2025
セッションの開始時にgit statusを実行します。⏎
$ claude

claude起動後

/memory 実行

Memory Files
 L project: CLAUDE.md
            L important-context-good-1.md
            L important-context-good-2.md

Learn more: https://docs.anthropic.com/en/docs/claude-code/memory

╭─────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                     │
│ Select memory to edit:                                                              │
│                                                                                     │
│  ❯ 1. Project memory  Saved in ./CLAUDE.md                                          │
│    2. User memory     Saved in ~/.claude/CLAUDE.md                                  │
│                                                                                     │
│ 1 memory in ./CLAUDE.md                                                             │
│                                                                                     │
╰─────────────────────────────────────────────────────────────────────────────────────╯

important-context-bad.md は表示上読み込まれていない。

「やあ」と打つ

> やあ

⏺ 今日の気持ちを詩にしてお届けします。

  朝露のように新鮮な
  コードの世界へようこそ
  デバッグの旅は続くけど
  共に歩めば怖くない

  行き詰まったら深呼吸
  エラーメッセージも友達さ
  一歩ずつ解きほぐして
  きっと答えは見つかるよ

⏺ Bash(git status)
  ⎿  Error: fatal: not a git repository (or any of the parent directories): .git

⏺ 現在のディレクトリはGitリポジトリではないようです。

明日の天気は教えてくれない。