Repository navigation
Open
Description
Summary
I ran about 200 commands and feature probes through the shell MCP tool, trying the commands and idioms an AI agent typically reaches for. This issue lists what's missing or broken, ranked by how often it would trip up an agent.
Agents learned shell from bash and GNU coreutils, so they'll hit the gaps below constantly.
Struck-through items behave correctly on main (verified 2026-11-13).
P0: things that break common agent workflows
A loop or group can't come after a pipe.echo x | while read l; do echo $l; donegivesunexpected 'do'.cmd | ( … )givesOpened parentheses without closing, andcmd | { …; }givesunexpected '}'. Piping into awhile readloop is one of the most common agent idioms. (while read l; do …; done < fileworks.)A parse error anywhere aborts the whole script, and nothing runs. One unsupported token (e.g.arr=(a b)) on line 17 silently drops lines 1–16 as well. Some messages are confusing (Opened parentheses without closing). Either run statement by statement, or report the line and column and say "unsupported syntax". (fix: report the first syntax error in multiline input #197)xargs -n1 CMDandxargs -I{} CMDfail silently.printf 'a b\n' | xargs -n1 catandprintf 'f\n' | xargs -I{} cat {}exit with 127 and print nothing on stderr. Plainxargs CMDworks. (fix(xargs): accept attached option values and stop at the command #208, fix(xargs): forward the command's stderr instead of dropping it #213)- Missing:
diff,patch. Agents need these to check and apply edits. - Missing:
awk. Very widely used for field and column work. sh -c '...'doesn't work.sh -c 'echo hi'gives-c: no such file or directory. (feat(sh): run command strings with sh -c #212)Usage text goes to stdout, with no error.ls -lhandsort -hprint help to stdout, and it gets mixed into piped results. Write unknown-option errors to stderr and exit non-zero, as other commands already do (invalid option '-f').
P1: missing flags agents use all the time
ls:-t,-S,-h(feat(ls): support -h human-readable sizes and -t/-S/-r sorting #228)- find:
-size,-mtime,-newer(feat(find): add -size, -mtime, -mmin and -newer #221)-delete
grep:-P(feat(grep): add -P for Perl regexes, rejecting unsupported constructs #219)head:-n -N(negative counts) (feat(head): print all but the last N lines or bytes with -n -N and -c -N #218)sort:-h(feat(sort): add -h/--human-numeric-sort #216)ln:-f(feat(ln): add -f/--force and link into an existing directory #234)readlink:-f(feat(readlink): add -f, -e, -m canonicalize modes and -n #220)curl:-I(feat(curl): support -I/--head to fetch headers only #209)jq:--arg(also worth adding--argjson,-s,-e) (feat(jq): support --arg and --argjson variables #210)- date:
+%s(prints a literal%s) (fix(date): support %s, %F, %T and other GNU format specifiers #214)-d
printf (fix(printf): interpret hex, octal and unicode escapes like bash #215, fix(printf): apply flags, width and precision to numbers #225):%5.2fprints a literal%f(wrong output, no error)%03dignores the zero padding\x00escapes aren't interpreted
echo:-eis printed literally (fix(echo): accept -e, -E and combined -neE option words #211)
P1: missing commands
- Text:
seqtacrevpastecommnlfoldcolumnsplitod/xxd/hexdump
- Files:
statrealpathdudffiletree
- Archives:
targzip/gunzipzip/unzip
- Hashing and encoding:
base64(feat(base64): add base64 with -d, -i, and -w #281)sha256summd5sum
- Math:
exprbc
- Process and info:
timeoutwhich(feat(which): add which, resolved like command -v #272)uname(feat(uname): add uname #286)whoami(feat(whoami): add whoami #273)id(feat(id): add id #288)hostnamepskillyes
- Builtins:
command -v(agents use it to check whether a tool exists)evalexecexitsource(.works)help
- Optional but very common:
rgwgetegrep
P2: bash-isms agents write by default
Either implement them or make the tool description clearly say "POSIX sh, not bash".
[[ ]](feat(parser): support [[ ]] conditional expressions #325)- arrays (now rejected with a clear
arrays are not supportederror) <(...)process substitution<<<here-strings- brace expansion (
{1..3},a{b,c}) - C-style
for ((;;)) $RANDOM$SHELL
P2: correctness and state gotchas
set -eandpipefailstay on across calls. A later, unrelated call can then stop silently at its first failing command.envlists non-exported shell variables (e.g. loop counters) alongside exported ones. (fix: show only exported variables to the commands the shell runs #285)- Running a missing binary like
lash --helpgivesno such file or directory: <cwd>/--help, which is confusing.
Suggestions for the MCP tool itself
- List the available commands and shell dialect in the tool description. For example: "POSIX-ish sh; commands: …; no python/git/awk; lua available". This alone prevents most wasted calls.
- Return a clear error for unsupported syntax or flags, naming the flag and suggesting an alternative.
- Offer a way to reset session state, or document that state carries over between calls.
- Put the exit code in the text output as well as in
metadata.exit_code. Not every MCP client exposes metadata.
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Language
None yet
Activity
[-]Agent-usability gaps: missing commands, flags, and shell syntax (test report)[/-][+]Agent-usability gaps: missing commands, flags, and shell syntax[/+]pgrayy commentedon Nov 12, 2026
Another missing
lsflag:-d.Claude Code ran
ls -d node_modulesto check for installed dependencies and received:-dshould list the directory itself instead of its contents. #228 adds otherlsflags but does not cover this one.pgrayy commentedon Nov 12, 2026
The proposed tool description should identify the supported dialect and common limits, and show supported ways to check command outcomes.
For example:
This prints
EXIT=instead of Bash'sEXIT=1.PIPESTATUSis a Bash extension; guidance could steer agents toward direct validation commands and their returned exit codes when per-command pipeline statuses are unavailable.pgrayy commentedon Nov 12, 2026
exec -ais unsupported:Bash exits 0. Strands Shell reports
-a: command not foundand exits 127.The
-aoption sets the program'sargv[0]. Plainexec truesucceeds; Shell currently treats-aas the command name.fix(which): check a name with a slash as a path and name a bad long o…
feat(mcp): name silent bash-isms and missing job control in the shell…
fix: look up ${RANDOM-word} once so it draws one value
fix(find): refuse -delete after -exec ; and on paths ending in . or ..
fix(realpath): accept missing middle components with -s and require -…
fix(date): read two-digit years like GNU and reject 'tomorrow ago'
fix(find): point the -delete with -exec ; refusal at an alternative