Skip to content

Support Custom $CLAUDE_CONFIG_DIR #342

Description

@eabrouwer3

Summary

ucode hardcodes the Claude config directory to ~/.claude and ignores the
CLAUDE_CONFIG_DIR environment variable that Claude Code itself supports:

CLAUDE_CONFIG_DIR = Path.home() / ".claude"
CLAUDE_SETTINGS_PATH = CLAUDE_CONFIG_DIR / "ucode-settings.json"

Impact

I keep two Claude accounts on the same machine — a personal one in ~/.claude
and a work one in ~/.claude-work — and set CLAUDE_CONFIG_DIR automatically
based on the directory I'm in. Because ucode always reads and writes
~/.claude, its Claude configuration and validation steps fail whenever I'm
working under the work account.

Proposed fix

Resolve the config directory from the environment, falling back to the current
default:

CLAUDE_CONFIG_DIR = Path(os.environ.get("CLAUDE_CONFIG_DIR", Path.home() / ".claude"))

This matches Claude Code's own behavior and is backward compatible for anyone
who doesn't set the variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions