[BUG] With CLAUDE_CONFIG_DIR set, starting in $HOME records a project-scope install of every user plugin
What's wrong
When CLAUDE_CONFIG_DIR points anywhere other than ~/.claude and Claude Code starts with cwd = $HOME, it treats ~/.claude/settings.json as $HOME's project settings. A multi-account setup symlinks $CLAUDE_CONFIG_DIR/settings.json to ~/.claude/settings.json, so the user settings are read a second time as project settings. At startup, before authentication, Claude Code writes a scope: "project", projectPath: "$HOME" record in installed_plugins.json for every plugin in enabledPlugins, all with the session's start timestamp as installedAt.
The records duplicate the user installs. claude plugin update <id> without --scope updates only the scope it auto-detects, so the two copies drift, and sessions started in $HOME load the stale one. Removing the duplicates with claude plugin uninstall --scope project from $HOME edits the shared settings file and disables the plugin at user scope.
Expected
~/.claude/settings.json is not read as $HOME's project settings, at least when it resolves to the same file as the active user settings. No project-scope records are written just because a session started.
Observed
Claude Code 2.1.282 and 2.1.274, Linux. Two hosts each gained 7 project records for $HOME, all with an installedAt equal to the start of one session in $HOME (a /login session under CLAUDE_CONFIG_DIR=~/.claude-alt).
Repro
Clean Ubuntu VM, Claude Code 2.1.282, not logged in (the record is written even though -p exits with "Not logged in"):
export HOME=$(mktemp -d); mkdir -p ~/.claude; cd ~
claude plugin marketplace add anthropics/claude-plugins-official
claude plugin install code-simplifier@claude-plugins-official --scope user
mkdir ~/.claude-alt
for f in settings.json settings.local.json plugins projects history.jsonl; do ln -s ~/.claude/$f ~/.claude-alt/$f; done
CLAUDE_CONFIG_DIR=~/.claude-alt claude -p hi
jq -c '[.plugins[][]|{scope,projectPath}]' ~/.claude/plugins/installed_plugins.json
| Variant | Records after the session |
| --- | --- |
| No CLAUDE_CONFIG_DIR, cwd $HOME | user only |
| Symlinked CLAUDE_CONFIG_DIR, cwd $HOME | user + project at $HOME |
| Symlinked CLAUDE_CONFIG_DIR, cwd $HOME/work | user only |
| CLAUDE_CONFIG_DIR with a copied (not linked) settings.json, cwd $HOME | user + project at $HOME |
Related: #79892, #82830 (both closed as not planned).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗