[BUG] Command history dispatch matches wrong skill when one skill name is a prefix of another

Resolved 💬 3 comments Opened Mar 10, 2026 by OsBlaineOra Closed May 4, 2026

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?

When two skills are installed where one name is a prefix of the other, recalling a command from history via the up-arrow key causes the wrong (longer-named) skill to be dispatched — even though the input box displays the correct command before Enter is pressed.

What Should Happen?

foo is dispatched with argument 123.

Error Messages/Logs

Steps to Reproduce

  1. Install two skills where one name is a prefix of the other, e.g.:
  • foo
  • foo-bar
  1. Run /foo 123 by typing it and pressing Enter. It works correctly.
  2. Press the up-arrow key to recall /foo 123 from history. The input box displays exactly /foo 123.
  3. Press Enter.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

I'm using the VS Code extension version - 2.1.72

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

Environment

Extension: Claude Code (VS Code)
OS: RHEL 9

  • The substitution happens at dispatch time, after the user submits the (correct) command. The input box shows the right text.
  • Typing /foo 123 fresh and pressing Enter always works correctly.
  • The bug only reproduces when the command is recalled from history via up-arrow.
  • Likely cause: history replay re-resolves the skill name by prefix match rather than replaying the exact skill name that was originally invoked. The longer match (foo-bar) wins over the exact match (foo).

View original on GitHub ↗

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