claude-code - 💡(How to fix) Fix CLAUDE.md not loaded when vault path differs from session cwd — no warning, no override setting [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48053Fetched 2026-04-15 06:34:37
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

Claude Code loads CLAUDE.md exclusively from the session's working directory and its parents. If a user's primary vault/context directory differs from the session cwd (common when launching from a project subfolder, IDE, or a synced cloud directory), CLAUDE.md silently fails to load with no warning.

Error Message

User has a vault at /Users/[user]/Documents/Obsidian Cloud/ containing CLAUDE.md with session-start instructions, context files, and skill definitions. Session cwd was a different directory. CLAUDE.md was never loaded. No error, no warning — silent failure.

Root Cause

Users who maintain structured Obsidian/markdown vaults as their AI context layer (a documented and encouraged pattern) are silently broken any time they launch Claude Code from a directory other than the vault root. The failure is invisible and the workaround (always cd to vault root first) is fragile.

Fix Action

Fix / Workaround

Why this matters

Users who maintain structured Obsidian/markdown vaults as their AI context layer (a documented and encouraged pattern) are silently broken any time they launch Claude Code from a directory other than the vault root. The failure is invisible and the workaround (always cd to vault root first) is fragile.

RAW_BUFFERClick to expand / collapse

Summary

Claude Code loads CLAUDE.md exclusively from the session's working directory and its parents. If a user's primary vault/context directory differs from the session cwd (common when launching from a project subfolder, IDE, or a synced cloud directory), CLAUDE.md silently fails to load with no warning.

Observed behavior

User has a vault at /Users/[user]/Documents/Obsidian Cloud/ containing CLAUDE.md with session-start instructions, context files, and skill definitions. Session cwd was a different directory. CLAUDE.md was never loaded. No error, no warning — silent failure.

The model had full access to the vault files the entire time and could have read them. But without CLAUDE.md bootstrapping, it didn't know to.

Expected behavior / feature request

One or both of:

  1. A user-level setting (~/.claude/settings.json) to declare a persistent vault path whose CLAUDE.md always loads regardless of session cwd
  2. A warning when Claude Code starts without finding any CLAUDE.md — prompting the user to confirm this is intentional

Why this matters

Users who maintain structured Obsidian/markdown vaults as their AI context layer (a documented and encouraged pattern) are silently broken any time they launch Claude Code from a directory other than the vault root. The failure is invisible and the workaround (always cd to vault root first) is fragile.

extent analysis

TL;DR

To fix the silent failure of CLAUDE.md loading, consider adding a user-level setting to declare a persistent vault path or implement a warning when Claude Code starts without finding any CLAUDE.md.

Guidance

  • Investigate the feasibility of introducing a vault_path setting in ~/.claude/settings.json to allow users to specify the location of their CLAUDE.md file.
  • Consider adding a warning mechanism to notify users when Claude Code starts without finding a CLAUDE.md file, prompting them to confirm if this is intentional.
  • Review the current directory traversal logic to understand why CLAUDE.md is not being loaded from the vault directory when the session cwd differs.
  • Evaluate the potential impact of changing the default behavior to load CLAUDE.md from the vault directory instead of the session cwd.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a accurate example.

Notes

The proposed solution relies on the assumption that introducing a user-level setting or warning mechanism is feasible and aligns with the existing architecture of Claude Code. Further investigation is required to determine the best approach.

Recommendation

Apply a workaround by always launching Claude Code from the vault root directory until a permanent solution is implemented, as this ensures CLAUDE.md is loaded correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING