Built-in /doctor is unreachable when a plugin registers a command named "doctor"

Resolved 💬 2 comments Opened Jun 17, 2026 by hashimmm Closed Jun 20, 2026

Built-in /doctor is unreachable when a plugin registers a command named doctor

Summary

When an installed plugin ships a command file named doctor.md, that plugin command
shadows the built-in /doctor command. The built-in becomes unreachable: it does not
run via the bare /doctor name, and — critically — it does not run even when you
explicitly highlight the built-in entry in the slash-command autocomplete menu and press
Enter. The plugin's command runs every time.

Environment

  • Claude Code version: 2.1.169
  • Platform: macOS (Darwin 25.5.0)
  • A plugin is installed that includes commands/doctor.md, so it registers a command

named doctor (exposed both as /doctor and as /<plugin>:doctor).

Steps to reproduce

  1. Install any plugin that contains a commands/doctor.md (registers a doctor command).
  2. In the prompt, type /doctor.
  3. Observe the autocomplete suggestion list. Both the built-in doctor

("Diagnose and verify your Claude Code installation") and the plugin's doctor
appear.

  1. Use the arrow keys to highlight the built-in doctor entry.
  2. Press Enter.

Expected behavior

  • The built-in /doctor should always remain reachable.
  • Selecting the built-in entry from the autocomplete menu should run the built-in

command.

  • Ideally, a built-in command and a plugin command with the same bare name should be

disambiguated (e.g. built-in wins on the bare name, or the menu selection is honored),
rather than the plugin silently shadowing the built-in.

Actual behavior

  • Typing /doctor and pressing Enter runs the plugin's doctor command.
  • Even after arrow-keying to highlight the built-in entry and pressing Enter, the

plugin's doctor command still runs. The menu selection is not honored — Enter
resolves to the shadowing plugin command regardless of what is highlighted.

  • There is no way to invoke the built-in /doctor while the plugin is installed, short

of removing/disabling the plugin's doctor.md file.

Impact

  • Built-in commands can be made completely unreachable by third-party plugins that happen

to reuse a built-in command name.

  • The autocomplete menu is misleading: it presents the built-in as a selectable option,

but selecting it does nothing different.

Suggested fixes

  • Honor the highlighted autocomplete selection on Enter.
  • Reserve / always-resolve built-in command names to the built-in (or require plugin

commands to be invoked via their namespace when they collide with a built-in).

  • At minimum, surface the collision and provide a reliable way to invoke the built-in.

Workaround

Temporarily move the plugin's command file out of the way:

mv "<plugin-path>/commands/doctor.md" "<plugin-path>/commands/doctor.md.disabled"

This is undone whenever the plugin updates/reinstalls.

View original on GitHub ↗

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