Skip to content

Remaining CLAUDE_CONFIG_DIR gaps: user-scope MCP config and plugin cache #375

@pjdoland

Description

@pjdoland

Summary

Follow-up to #373 / PR #374, which made the session history, skills, and spinner-verbs lookups honor CLAUDE_CONFIG_DIR. Two adjacent surfaces still hardcode home-relative paths, and each needs slightly different relocation logic than the shared util.get_claude_config_dir() helper provides, which is why they were excluded from that PR.

Remaining gaps

  1. User-scope MCP config: claude_mcp_manager.py line 145 pins Path.home() / ".claude.json". The CLI's default location for this file is the home directory itself (not inside ~/.claude), but when CLAUDE_CONFIG_DIR is set the CLI relocates it to $CLAUDE_CONFIG_DIR/.claude.json. So the path needs branch logic: Path(os.environ["CLAUDE_CONFIG_DIR"]) / ".claude.json" when set, else Path.home() / ".claude.json". Today, on an override deployment, NBI's reads (user-scope servers, disabledMcpServers) hit the wrong file while writes via the inherited-env claude mcp add land in the relocated one, so reads and writes diverge.
  2. Plugin cache: plugin_manager.py lines 243-247 fall back to Path.home() / ".claude" / "plugins" (after its own CLAUDE_CODE_PLUGIN_CACHE_DIR override). The CLI keeps the plugin cache under the config dir, so the fallback should be Path(get_claude_config_dir()) / "plugins".

Docs touch-ups to ride along

  • docs/admin-guide.md (Kubeflow/KubeSpawner persistent-volume note, near the filesystem table): "ensure ~/.jupyter and ~/.claude are inside that mount" deserves a clause covering a CLAUDE_CONFIG_DIR that points outside the home mount.
  • The ~/.claude.json / ~/.claude/plugins/ mentions in the admin guide should gain the override note once the code above actually follows it (adding the note first would overclaim).

Refs #373

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions