[BUG] /doctor PATH check is a false positive on Debian/Ubuntu systems with standard .bashrc guard

Open 💬 1 comment Opened Jun 13, 2026 by ahimsauzi

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?

Summary:
/doctor reports "~/.local/bin is not in your PATH" even when it already is — and the suggested fix is both a duplicate and ineffective.

Root cause:
On Debian/Ubuntu, the standard .bashrc has a non-interactive early-return guard near the top:
case $- in
i) ;;
*) return;;
esac
/doctor probes PATH in a non-interactive shell. If the PATH export sits anywhere after this guard, /doctor never sees it — even though interactive shells work perfectly.

Impact:

  • False alarm burns user time chasing a non-problem.
  • The suggested fix (append to ~/.bashrc) makes it worse: it creates a duplicate export that is also unreachable by non-interactive shells for the same reason.

Suggested fix:
Either probe PATH in an interactive shell (bash -ic 'echo $PATH'), or check ~/.profile / ~/.bash_profile in addition to ~/.bashrc, since those run for non-interactive login shells and are the correct place for PATH exports on Debian/Ubuntu.

What Should Happen?

When /doctor probes PATH in a non-interactive shell. If the PATH export sits anywhere after this guard, /doctor should see it instead of alerting the user to fix that issue, hence creating a duplicate line in .bashrc.

  • /doctor should not report a false positive when claude is installed and functional.
  • If a warning is shown, the suggested fix should actually work.

Error Messages/Logs

⚠ Native installation exists but ~/.local/bin is not in your PATH
Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc then open a new terminal or run: source ~/.bashrc

Steps to Reproduce

Environment: Debian/Ubuntu, native Claude Code install (~/.local/bin/claude)

  1. Install Claude Code natively.

The installer appends to ~/.bashrc:
export PATH="$HOME/.local/bin:$PATH"
This lands after the standard Debian/Ubuntu non-interactive guard that ships in every default ~/.bashrc:
case $- in
i) ;;
*) return;; # non-interactive shells bail here
esac

  1. Launch Claude Code — e.g. from an SSH session, a tmux session, or any shell where .local/bin was not yet in PATH at launch time (common immediately after install, before opening a fresh interactive terminal).
  1. Run /doctor. Observe the warning:

▎ Native installation exists but ~/.local/bin is not in your PATH

  1. Follow the suggested fix — append the export to ~/.bashrc:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

  1. Run /doctor again. Warning persists.
  1. Run source ~/.bashrc in the terminal, then run /doctor again. Warning still persists.

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.173

Claude Code Version

2.1.177

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

iTerm2

Additional Information

Anthropic should consider credits for /doctor recommendations that lead the user to spend tokens in an attempt to address a false positive.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗