Skip to content

respect CLAUDE_CONFIG_DIR env for credentials path#1

Open
Lilbfan wants to merge 1 commit into
raine:mainfrom
Lilbfan:fix/credentials-claude-config-dir
Open

respect CLAUDE_CONFIG_DIR env for credentials path#1
Lilbfan wants to merge 1 commit into
raine:mainfrom
Lilbfan:fix/credentials-claude-config-dir

Conversation

@Lilbfan
Copy link
Copy Markdown

@Lilbfan Lilbfan commented Apr 17, 2026

Summary

  • Extract a credentials_path() helper to resolve the .credentials.json location
  • If CLAUDE_CONFIG_DIR is set and $CLAUDE_CONFIG_DIR/.credentials.json exists, that path is used
  • Otherwise fall back to the original ~/.claude/.credentials.json

Test plan

  • Set CLAUDE_CONFIG_DIR=/some/dir with a valid credentials file — should use that path
  • Set CLAUDE_CONFIG_DIR pointing to a dir without the file — should fall back to ~/.claude/.credentials.json
  • Unset CLAUDE_CONFIG_DIR — behaviour unchanged from before

Check $CLAUDE_CONFIG_DIR/.credentials.json first when the env var is
set and the file exists, falling back to the original
~/.claude/.credentials.json otherwise.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant