[BUG] False positive "Config mismatch" warning when installation method matches
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code's /status command shows a config mismatch warning even when both the runtime and config agree on the installation method.
What Should Happen?
No config mismatch warning should appear when both runtime and config show the same installation method.
Error Messages/Logs
Shows warning: "Config mismatch: running npm-global but config says npm-global"
Steps to Reproduce
- Install Claude Code via npm: npm install -g @anthropic-ai/claude-code
- Set config: claude config set -g installMethod npm-global
- Run /doctor command
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.108
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
/status
⎿ (no content)
System Diagnostics • /doctor
⚠ Config mismatch: running npm-global but config says unknown
● I'll help you diagnose the system configuration issue. Let me check the current status and configuration.
● Bash(which claude)
⎿ /home/bnason/.nvm/versions/node/v20.18.1/bin/claude
● Bash(claude --version)
⎿ 1.0.108 (Claude Code)
● Bash(npm list -g @anthropics/claude)
⎿ Error: /home/bnason/.nvm/versions/node/v20.18.1/lib
└── (empty)
● Bash(npm list -g claude)
⎿ Error: /home/bnason/.nvm/versions/node/v20.18.1/lib
└── (empty)
● The issue is that Claude Code is installed and running from /home/bnason/.nvm/versions/node/v20.18.1/bin/claude but npm doesn't show it in
the global package list. This suggests Claude Code may have been installed via a different method (like a standalone installer) rather than
npm install -g.
To fix the config mismatch:
- If you want to use the npm version: Uninstall the current version and reinstall via npm:
npm install -g @anthropics/claude
- If you want to keep the current installation: The mismatch warning shouldn't affect functionality, but you can verify everything works by
running claude --help.
The current installation appears to be working (version 1.0.108), so the mismatch is likely just a detection issue rather than a functional
problem.
> npm install -f -g @anthropic-ai/claude-code
npm warn using --force Recommended protections disabled.
npm error code ENOTEMPTY
npm error syscall rename
npm error path /home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/claude-code
npm error dest /home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/.claude-code-1eqr7mpi
npm error errno -39
npm error ENOTEMPTY: directory not empty, rename '/home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/claude-code' ->
'/home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/.claude-code-1eqr7mpi'
npm error A complete log of this run can be found in: /home/bnason/.npm/_logs/2025-09-06T00_12_34_303Z-debug-0.log
● The npm install is failing because there's already a Claude Code installation that can't be overwritten. Let's fix this by cleaning up the
existing installation first:
● Bash(npm uninstall -g @anthropic-ai/claude-code)
⎿ Error: npm error code ENOTEMPTY
npm error syscall rename
npm error path /home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/claude-code
npm error dest /home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/.claude-code-1eqr7mpi
npm error errno -39
npm error ENOTEMPTY: directory not empty, rename '/home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/claude-code' ->
'/home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/.claude-code-1eqr7mpi'
npm error A complete log of this run can be found in: /home/bnason/.npm/_logs/2025-09-06T00_14_00_702Z-debug-0.log
● Let's manually remove the problematic directory:
● Bash(rm -rf /home/bnason/.nvm/versions/node/v20.18.1/lib/node_modules/@anthropic-ai/claude-code)
⎿ (No content)
● Bash(npm install -g @anthropic-ai/claude-code)
⎿ added 12 packages in 1s
11 packages are looking for funding
run npm fund for details
● Now let's verify the installation:
● Bash(claude --version)
⎿ 1.0.108 (Claude Code)
● Perfect! Claude Code has been successfully reinstalled via npm. The config mismatch should now be resolved since it's properly installed
through npm's package management system.
/doctor
⎿ (no content)
/status
⎿ (no content)
System Diagnostics • /doctor
⚠ Config mismatch: running npm-global but config says unknown
● The config mismatch is still showing. Let me check Claude Code's configuration and fix this:
● Bash(claude config --help)
⎿ Usage: claude config [options] [command]
Manage configuration (eg. claude config set -g theme dark)
… +11 lines (ctrl+r to expand)
● Bash(claude config list)
⎿ {
"allowedTools": [],
"hasTrustDialogAccepted": true,
… +2 lines (ctrl+r to expand)
● The config is missing the installation method. Let me set it to indicate npm-global installation:
● Bash(claude config set installMethod npm-global)
⎿ Error: Cannot set 'installMethod'. Only these keys can be modified: allowedTools, hasTrustDialogAccepted, hasCompletedProjectOnboarding,
ignorePatterns. Did you mean --global?
● The installMethod config is not user-modifiable. Let me try with the global flag:
● Bash(claude config set -g installMethod npm-global)
⎿ (No content)
● Bash(claude config list -g)
⎿ {
"installMethod": "npm-global",
"autoUpdates": true,
… +39 lines (ctrl+r to expand)
● Perfect! The config now shows "installMethod": "npm-global" which should resolve the mismatch. The doctor should now show the installation
method correctly aligned with how Claude Code is actually running.
/status
⎿ (no content)
/status
⎿ (no content)
System Diagnostics • /doctor
⚠ Config mismatch: running npm-global but config says npm-global
● The diagnostic is now showing "Config mismatch: running npm-global but config says npm-global" - this indicates that both the runtime and
config agree on the installation method (npm-global), but there's still a mismatch being detected.
This appears to be a false positive in Claude Code's diagnostic system. Since both sides show "npm-global", the actual configuration is
correct. The warning can likely be ignored as it's not indicating a real functional issue.
The system is working properly - Claude Code is installed via npm and the config correctly reflects this.
report that as a bug to anthropic
● I'll help you report this bug to Anthropic. You can report it at https://github.com/anthropics/claude-code/issues.
Here's the bug report information to include:
Title: False positive "Config mismatch" warning when installation method matches
Description:
Claude Code's /doctor command shows a config mismatch warning even when both the runtime and config agree on the installation method.
Steps to reproduce:
- Install Claude Code via npm: npm install -g @anthropic-ai/claude-code
- Set config: claude config set -g installMethod npm-global
- Run /doctor command
Expected behavior:
No config mismatch warning should appear when both runtime and config show the same installation method.
Actual behavior:
Shows warning: "Config mismatch: running npm-global but config says npm-global"
Environment:
- Claude Code version: 1.0.108
- Platform: Linux 6.8.0-79-generic
- Node.js version: v20.18.1
- Installation method: npm global
Additional context:
The diagnostic correctly identifies both sides as "npm-global" but still flags it as a mismatch, suggesting an issue with the comparison
logic in the diagnostic system.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗