claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] `LS` vs `List` - lack of clarity

Open hesreallyhim opened this issue 6 months ago • 0 comments

The documentation for Claude's tools shows a tool called "LS", and this is the name of the tool that CC appears to interface with. But if you watch Claude's tool usage, it actually uses a tool called "List", but if you ask it about "List" it doesn't seem to know about. Maybe this is a harmless thing where the name was changed except in one part of the codebase. But in any case, worth clearing up IMO.

Second problem - List does a recursive traversal, which is counter-intuitive, probably costly, and probably confusing if anyone is assuming that "List" is basically the same API as Bash "ls". I.e. if you ask Claude "What are the contents of the current directory", it will list every sub-directory and every file therein, in some cases breaking the tool response because it's too long. This is plainly counter-intuitive and bad UX IMO.

Finally, it's kind of hard to implement restrictions on "LS" because if you disallow it then it will just run "Bash(ls)" if you query it. I guess this is harder to deal with, cuz it can prob come up with clever ways to get around a lot of restrictions just using Bash, but maybe it's worth considering from a security POV.

hesreallyhim avatar Jun 12 '25 20:06 hesreallyhim