efficient-shell-usage skill
Optimizes shell command execution by preventing redundant runs and teaching efficient output triage through file saving and inspection.
- GitHub stars
- 5
- Files
- 1
- Last commit
- Sep 16, 2026
- License
- —
- Allowed tools
- —
What does the efficient-shell-usage skill do?
efficient-shell-usage optimizes shell command execution by preventing redundant runs and teaching efficient output triage through file saving and inspection.
Summary generated from the skill's SKILL.md.
About the efficient-shell-usage skill
Optimizing shell command execution to save time and tokens is what this skill enables for developers working on builds, tests, or debugging. It provides a framework for agents to handle expensive operations like linters, typecheckers, and test suites without wasting resources through redundant runs. Instead of piping commands through grep or head, which triggers re-execution, the agent follows a pattern of running a command once, saving the output to a file using tee, and then inspecting that file.
When an agent encounters a non-zero exit code, it uses the Grep tool to locate error lines within the saved text file and the Read tool with offset and limit parameters to examine the surrounding context. This approach prevents the agent from re-running the same command multiple times to see different slices of output. It also enforces a strict rule against re-running verification steps like typechecking or linting unless the underlying source files or configurations have actually changed.
What an agent can do with it
- 1Triage failing test suitesAn agent can capture test output to a file and search for error patterns instead of re-running the tests.
- 2Inspect large command outputsDevelopers can use offset and limit parameters to view specific context around errors in a saved log.
- 3Reduce redundant verification stepsThe agent avoids re-running successful checks like linting if the recent code changes do not affect them.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the efficient-shell-usage skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the efficient-shell-usage skill in Plugin
/plugin marketplace add pavlov-net/claude-plugins /plugin install efficient-commands@stuart-plugins
Install the efficient-shell-usage skill in Claude Code
~/.claude/skills/efficient-shell-usage/SKILL.md
$ npx degit pavlov-net/claude-plugins/efficient-commands/skills/efficient-shell-usage ~/.claude/skills/efficient-shell-usageInstall the efficient-shell-usage skill in Claude Code (project)
.claude/skills/efficient-shell-usage/SKILL.md
$ npx degit pavlov-net/claude-plugins/efficient-commands/skills/efficient-shell-usage .claude/skills/efficient-shell-usageInstall the efficient-shell-usage skill in Codex
~/.agents/skills/efficient-shell-usage/SKILL.md
$ npx degit pavlov-net/claude-plugins/efficient-commands/skills/efficient-shell-usage ~/.agents/skills/efficient-shell-usageInstall the efficient-shell-usage skill in Gemini CLI
~/.gemini/skills/efficient-shell-usage/SKILL.md
$ npx degit pavlov-net/claude-plugins/efficient-commands/skills/efficient-shell-usage ~/.gemini/skills/efficient-shell-usageInstall the efficient-shell-usage skill in Claude.ai
npx degit pavlov-net/claude-plugins/efficient-commands/skills/efficient-shell-usage efficient-shell-usage && zip -r efficient-shell-usage.zip efficient-shell-usage # claude.ai → Customize → Skills → + → Create skill → Upload a skill → efficient-shell-usage.zip
SKILL.md
View on GitHubEfficient Shell Usage
Shell commands like test suites, linters, typecheckers, and builds are expensive — they take wall-clock time, consume tokens reading output, and burn through rate limits.
Rule 1: Run Once, Triage the Output
Never re-run a command to see a different slice of its output, and never pipe commands
through tail, head, or grep — that re-executes the entire command each time.
Instead, run once, save to file, and use tools to inspect:
command 2>&1 | tee /tmp/cmd-output.txt; echo "EXIT: $?"
Then triage:
- Exit 0 (pass): Move on. Do not read the output — there is nothing to fix.
- Non-zero (fail): Use Grep to find error lines in
/tmp/cmd-output.txt(e.g., "FAIL", "error", "Error:"). Then use Read withoffsetandlimitto see context around those lines — typically 5-10 lines before and after is enough. - Last resort: If Grep finds nothing useful, Read just the last 50 lines. Error summaries almost always appear at the bottom.
This applies to any output inspection. To search saved output, use the Grep tool. To view a section, use Read with offset/limit. Never re-run the command or pipe it through shell utilities to see different parts.
For short commands with small output (e.g., git status, ls), saving to a file is
unnecessary — just read the Bash tool result directly.
Rule 2: Never Re-Run Without Changes
Do not re-run an expensive command unless something has changed that would affect its result — a source file edit, a dependency change, a config change.
Do not re-run to "double-check" a passing result, to hope for a different outcome, or
to see the output differently (use saved output from Rule 1 instead). Do not re-run the
same tool through a different entry point (e.g., npx eslint after npm run lint
already ran eslint).
The sequence is: run → see failure → fix the cause → re-run.
Rule 3: One Verification Pass
After making changes, run each verification step once. Only re-run a step if your fix could plausibly affect its result.
typecheck → pass
lint → fail → fix → re-run lint → pass
tests → fail → fix → re-run tests → pass
# Done. The lint fix didn't affect typecheck. The test fix didn't affect lint.
Do not re-verify steps that already passed unless the fix touched something they check.
Files in this skill
1efficient-shell-usage skill questions
How do I install the efficient-shell-usage skill in Claude Code?
Run npx degit pavlov-net/claude-plugins/efficient-commands/skills/efficient-shell-usage ~/.claude/skills/efficient-shell-usage. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the efficient-shell-usage skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
When is it acceptable to re-run an expensive command?
Only re-run an expensive command if a source file, dependency, or configuration has changed that would affect the result.
Should I re-verify steps that have already passed?
No, do not re-verify steps that already passed unless your recent fix could plausibly affect their result.