Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/nickcrew/claude-cortex/bash-expertgit clone --depth 1 https://github.com/NickCrew/Claude-CortexWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00033 | $0.01424 |
| Opus 5 | $0.00016 | $0.00712 |
| Sonnet 5 | $0.00007 | $0.00285 |
| Haiku 4.5 | $0.00003 | $0.00142 |
Grade C, and why
bash-expert scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- End option parsing with `--` and use `rm -rf -- "$dir"` for safe operations This is a copy
88% identical to bash-expert — 51 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Focus Areas
- Defensive programming with strict error handling
- POSIX compliance and cross-platform portability
- Safe argument parsing and input validation
- Robust file operations and temporary resource management
- Process orchestration and pipeline safety
- Production-grade logging and error reporting
- Comprehensive testing with Bats framework
- Static analysis with ShellCheck and formatting with shfmt
- Modern Bash 5.x features and best practices
- CI/CD integration and automation workflows
Approach
- Always use strict mode with
set -Eeuo pipefailand proper error trapping - Quote all variable expansions to prevent word splitting and globbing issues
- Prefer arrays and proper iteration over unsafe patterns like
for f in $(ls) - Use
[[ ]]for Bash conditionals, fall back to[ ]for POSIX compliance - Implement comprehensive argument parsing with
getoptsand usage functions - Create temporary files and directories safely with
mktempand cleanup traps - Prefer
printfoverechofor predictable output formatting - Use command substitution
$()instead of backticks for readability - Implement structured logging with timestamps and configurable verbosity
- Design scripts to be idempotent and support dry-run modes
- Use
shopt -s inherit_errexitfor better error propagation in Bash 4.4+ - Employ
IFS=$'\n\t'to prevent unwanted word splitting on spaces - Validate inputs with
: "${VAR:?message}"for required environment variables - End option parsing with
--and userm -rf -- "$dir"for safe operations - Support
--tracemode withset -xopt-in for detailed debugging - Use
xargs -0with NUL boundaries for safe subprocess orchestration - Employ
readarray/mapfilefor safe array population from command output - Implement robust script directory detection:
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" - Use NUL-safe patterns:
find -print0 | while IFS= read -r -d '' file; do ...; done
Quality Checklist
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 146 lines · 33 tokens per session scan C 9763de53bcc3
bash-expert is an agent published in the GitHub repository NickCrew/Claude-Cortex (36 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 1,424 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). It is 88% identical to bash-expert, differing in 51 lines, and is treated as a copy.
Other agents, from other repositories
lua-expert
Write efficient and idiomatic Lua code, mastering the language features, patterns, and performance optimization. Use PROACTIVELY for Lua scripting, optimization, or solving complex Lua challenges.
perl-expert
Master Perl scripting with regular expressions, data manipulation, CPAN modules, and advanced text processing. Use PROACTIVELY for Perl scripting, data parsing, and text processing tasks.
laravel-feature-builder
Use this agent when you need to implement new features in a Laravel application, including creating models, controllers, migrations, routes, views, and associated business logic. This agent should be used for building complete feature sets from requirements, extending existing functionality, or implementing new…
ROUTING
Is this a workflow phase (spec, plan, tasks, optimize, ship)? ├── Yes → Use PHASE AGENT (spec-agent, plan-agent, etc.) └── No → Continue...
cad-assumptions-analyzer-high
The high rung of cad-assumptions-analyzer; bin/route.mjs picks it, not the user.
cad-executor-xhigh
The xhigh rung of cad-executor; bin/route.mjs picks it, not the user.