.claude-config/config.json not found when using CLAUDE_CONFIG_DIR

Status Fixed / completed
Maintainer reply ✓ Yes — wolffiex
Activity 6 comments · opened Mar 15, 2025 · closed Mar 25, 2025
💡 Likely answer: A maintainer (wolffiex, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • Claude CLI version: 0.2.45
  • Operating System: macOS 15.3..2
  • Terminal: VS Code terminal (zsh)

Bug Description

Trying to use the different config options described in #261. I set the env var, launch claude, set the text setting, and then get a file not found error.

Steps to Reproduce

export CLAUDE_CONFIG_DIR=./.claude-config
claude

outputs:

  ERROR  ENOENT: no such file or directory, open '.claude-config/config.json'

 node:fs:563:18

 - openSync (node:fs:563:18)
 - oW1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:456:55)
 - P80 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:456:3237)
 - S4 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:456:2620)
 - Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1172:6139)
 -  (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:511:7426)
 - ud (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:21381)
 - AC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:40838)
 -  (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:39053)
 - yw1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:22703)

Expected Behavior

I expect Claude to ask me for auth, although without documentation on how to use CLAUDE_CONFIG_DIR beyond the comment in #261 I'm not positive that is correct. As of 2025-03-15 I don't see any docs under https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/ that mention the config dir.

!Image

View original on GitHub ↗

6 Comments

radoslawkoziol · 1 year ago

I have the same problem, wsl2 + zsh.

I have set CLAUDE_CONFIG_DIR="~/.claude-lp"

I've tried copying ~/.claude.json to ~/.claude-lp/config.json, but I'm getting the error: ERROR ENOENT: no such file or directory, open '~/.claude-lp/config.json'

peterkaminski · 1 year ago

I fumbled around with it a bit, but it's working now for me.

I have export CLAUDE_CONFIG_DIR=~/.claude-kaminski@istori.com.

I believe I created ~/.claude-kaminski@istori.com by hand. With the env var set, running claude caused it to go through initialization, including terminal setup and oauth setup. The new config appears to be stored in ~/.claude-kaminski@istori.com/config.json, which claude created. There are no other files in that dir.

I still have ~/.claude.json which is what gets used when the env var isn't set, and ~/.claude/ which just has statsig files.

macOS 14.7 (M1)
zsh 5.9 (x86_64-apple-darwin23.0)
Claude Code 0.2.48 (upgraded serially from 0.2.32 or perhaps earlier)

peterkaminski · 1 year ago

One thing I would try with the error ERROR ENOENT: no such file or directory, open '~/.claude-foo/config.json' would be to expand ~ to a full path (e.g. /home/foo or whatever) when setting the env var.

radoslawkoziol · 1 year ago
One thing I would try with the error ERROR ENOENT: no such file or directory, open '~/.claude-foo/config.json' would be to expand ~ to a full path (e.g. /home/foo or whatever) when setting the env var.

@peterkaminski Yep, that was the issue, it worked with a full path.

wolffiex collaborator · 1 year ago

yes, thanks for the report. you have to use full path with this environment variable

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.