claude-code - 💡(How to fix) Fix [Bug] CLAUDE_CONFIG_DIR env var ignored; still loads ~/.claude/CLAUDE.md [1 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#47056Fetched 2026-04-13 05:42:38
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/sam/.local/share/claude/versions/2.1.104 (expected in multi-process scenarios)\n at Tc_ (/$bunfs/root/src/entrypoints/cli.js:2836:2153)\n at Se6 (/$bunfs/root/src/entrypoints/cli.js:2836:1233)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T17:46:28.611Z"}]

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/sam/.local/share/claude/versions/2.1.104 (expected in multi-process scenarios)\n    at Tc_ (/$bunfs/root/src/entrypoints/cli.js:2836:2153)\n    at Se6 (/$bunfs/root/src/entrypoints/cli.js:2836:1233)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T17:46:28.611Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description if I set CLAUDE_CONFIG_DIR to something other than ~/.claude , claude code still reads ~/.claude/CLAUDE.md
I would expect anything in ~/.claude/ to be ignored as per the docs: https://code.claude.com/docs/en/claude-directory\
ex:
❯ can you read the CLAUDE_CONFIG_DIR env var

⏺ Bash(echo "$CLAUDE_CONFIG_DIR")
⎿ /Users/sam/x

⏺ The CLAUDE_CONFIG_DIR environment variable is set to /Users/sam/x.
❯ have read any CLAUDE.md files in the session
⏺ I haven't explicitly read any CLAUDE.md files with the Read tool, but the
system automatically loaded one into my context:

  • /Users/sam/.claude/CLAUDE.md — This was injected as part of the "claudeMd" system context at the start of the session. It contains instructions about code implementation, testing, logging, research (llms.txt), and Python
    projects (use uv).
    Notably, since CLAUDE_CONFIG_DIR is set to /Users/sam/x, there might also be a CLAUDE.md at /Users/sam/x/CLAUDE.md that could be relevant. Want me to check if one exists there?

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.104
  • Feedback ID: 60e32b27-3d39-4494-96d9-06ce821db75d

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/sam/.local/share/claude/versions/2.1.104 (expected in multi-process scenarios)\n    at Tc_ (/$bunfs/root/src/entrypoints/cli.js:2836:2153)\n    at Se6 (/$bunfs/root/src/entrypoints/cli.js:2836:1233)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T17:46:28.611Z"}]

extent analysis

TL;DR

The issue can be resolved by ensuring that the CLAUDE_CONFIG_DIR environment variable is correctly set and that the claude code is updated to respect this variable when reading configuration files.

Guidance

  • Verify that the CLAUDE_CONFIG_DIR environment variable is set to the desired directory (/Users/sam/x) before running the claude code.
  • Check if there are any default or fallback configurations that are causing the claude code to read from ~/.claude/CLAUDE.md instead of the specified directory.
  • Review the documentation at https://code.claude.com/docs/en/claude-directory to ensure that the expected behavior is correctly understood.
  • Consider checking for any existing CLAUDE.md files in the specified directory (/Users/sam/x/CLAUDE.md) to ensure that the correct configuration is being used.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

The issue may be related to a bug or incorrect implementation in the claude code, and further investigation may be required to determine the root cause.

Recommendation

Apply workaround: Set the CLAUDE_CONFIG_DIR environment variable to the desired directory and verify that the claude code is respecting this variable. This may involve updating the claude code or configuration to correctly handle the specified directory.

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