/bash-command-rejection:bash-chaining-alternativesfrom bash-command-rejection
Provides workarounds for bash command chaining restrictions (&&, |, ;) enforced by security plugins. Teaches sequential calls, file intermediaries, Claude Code tools, and script-based alternatives.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /bash-command-rejection:bash-chaining-alternatives still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
This skill teaches you how to work around the bash command chaining restriction enforced by this plugin.
The bash-command-rejection plugin blocks these operators:
| Operator | Name | Why Blocked |
|---|---|---|
&& | AND chain | Runs cmd2 only if cmd1 succeeds - can't check permissions for conditional execution |
| | Pipe | Streams output to another command - can't review what the receiving command does |
; | Sequential | Runs multiple commands - each should be reviewed separately |
Allowed: || (OR/fallback) is permitted because it's error handling, not output chaining.
Instead of:
npm install && npm run build
Do:
npm install
Then in a separate call:
npm run build
Instead of:
cat file.txt | grep "pattern"
Do:
cat file.txt > /tmp/output.txt
Then use the Grep tool or Read tool to examine the output.
Or if you must use bash:
grep "pattern" /tmp/output.txt
Claude Code has dedicated tools that are safer than bash pipes:
| Instead of | Use |
|---|---|
cat file | grep pattern | Grep tool with file path |
find . -name "*.js" | Glob tool with pattern |
cat file.txt | Read tool |
sed -i 's/old/new/g' file | Edit tool |
For complex multi-step operations, write a shell script:
#!/bin/bash
# deploy.sh - Production deployment script
set -euo pipefail
echo "Running tests..."
npm test
echo "Building..."
npm run build
echo "Deploying..."
rsync -av ./dist/ server:/var/www/app/
Save the script, let the user review it, then:
bash deploy.sh
If chaining is truly necessary and safe, add an acknowledgment comment:
# CHAINED: Building inside docker container, both commands needed atomically
docker build -t myapp . && docker run myapp
Only use this when:
Instead of:
git add . && git commit -m "message" && git push
Do each step separately:
git add .
git commit -m "message"
git push
Instead of:
npm test && npm run build
Run tests:
npm test
If tests pass, build:
npm run build
Instead of:
ls -la | grep "\.js$"
Use the Glob tool with pattern *.js, or:
ls -la > /tmp/files.txt
Then use Grep tool to search /tmp/files.txt.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
None: SKILL.md is the whole skill.
npx claudepluginhub nsheaps/ai-mktpl --plugin bash-command-rejectionOther plugins' skills for the same job