Claude Code should more aggressively reject nonexistent commands
I had had one instance of Claude Code open for a while — so long that it had not been updated in days and therefore did not recognize the /context comment. When I typed /context <enter> (without really looking), Claude selected the top match, /clear (I assume because it has “context” in its description), and then executed it. All my context gone, not because I mistyped a command, but because Clause accepted a nonexistent command.
Ideally, when typing out a command that doesn't exist, Claude at most autocorrects it to one that does, then asks for confirmation from the user. It should never execute a /command that doesn't exactly match one in its toolkit (at least not a destructive one like /context — /help is probably fine) any more than your shell should try to guess which command you meant to run.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗