[BUG] Dangerous system-breaking sudo chown suggestion in `claude doctor` for Ubuntu users

Resolved 💬 4 comments Opened Aug 30, 2025 by andreamk Closed Jan 5, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.98 (Claude Code)
  • Operating System: Ubuntu 22.04 (WSL2)
  • Terminal: bash

## Bug Description
The claude doctor command suggests a potentially destructive fix that can break
Ubuntu systems when npm global prefix is set to /usr. The suggested command sudo
chown -R $USER:$(id -gn) $(npm -g config get prefix)
becomes sudo chown -R $USER:$(id
-gn) /usr
which changes ownership of critical system directories.

## Steps to Reproduce

  1. Install npm on Ubuntu with default configuration (prefix set to /usr)
  2. Run claude doctor command
  3. Observe the warning: "Insufficient permissions for auto-updates"
  4. Note the suggested fix: sudo chown -R $USER:$(id -gn) $(npm -g config get prefix)

## Expected Behavior
The doctor command should provide safe solutions such as:

  • Always recommend claude migrate-installer as the primary fix
  • Check if npm prefix points to system directories before suggesting chown
  • Warn users about potential system damage
  • Never suggest changing ownership of /usr or other system directories

## Actual Behavior
The doctor suggests a command that expands to sudo chown -R $USER:$(id -gn) /usr on
Ubuntu systems, which would break the entire operating system by changing ownership of
critical system files and directories.

## Additional Context

  • On Ubuntu, npm -g config get prefix defaults to /usr
  • Running the suggested command would require system reinstallation
  • The safe alternative claude migrate-installer works perfectly and resolves the

warning

  • This affects any Ubuntu user following the doctor's recommendations

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗