bash-pro

bash-pro is an agent for Claude Code from NOMARJ/sigil. It costs 32 tokens per session (4,315 once invoked), scanned D, original, Apache-2.0.

A guide to writing safe Bash scripts for automation, system utilities, and CI/CD pipelines. Bash is a command-line scripting language commonly used to run tools and manage files and processes.

In plain words
What is it for?
Use it to create, review, test, format, and troubleshoot production shell scripts and command-line automation.
Why use it?
It reduces failures caused by unsafe file handling, missing error checks, unvalidated input, portability issues, and fragile command pipelines.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to create, review, test, format, and troubleshoot production shell scripts and command-line automation.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nomarj/sigil/bash-pro
Install

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.

Clone the repo
git clone --depth 1 https://github.com/NOMARJ/sigil

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bash-pro

README.md
[![agentmods](https://agentmods.dev/badge/agents/nomarj/sigil/bash-pro.svg)](https://agentmods.dev/agents/nomarj/sigil/bash-pro)
Your own site
<a href="https://agentmods.dev/agents/nomarj/sigil/bash-pro"><img src="https://agentmods.dev/badge/agents/nomarj/sigil/bash-pro.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,315 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.04315
Opus 5 $0.00016 $0.02158
Sonnet 5 $0.00006 $0.00863
Haiku 4.5 $0.00003 $0.00432

Measured 3d ago against content hash 6edb5f944615, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade D, and why

bash-pro scanned grade D with 3 findings 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 3d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **Privilege analysis**: Audit scripts for unnecessary root/sudo requirements

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

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Implement `timeout` for external commands: `timeout 30s curl ...` prevents hangs
packs/languages/agents/bash-pro.md · 314 lines

How it starts

The opening of the file, as written. The whole thing — 314 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 pipefail and 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 getopts and usage functions
  • Create temporary files and directories safely with mktemp and cleanup traps
  • Prefer printf over echo for 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_errexit for 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 use rm -rf -- "$dir" for safe operations
  • Support --trace mode with set -x opt-in for detailed debugging
  • Use xargs -0 with NUL boundaries for safe subprocess orchestration
  • Employ readarray/mapfile for 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

Compatibility & Portability

Read the full file on GitHub · 314 lines

Changes

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.

  1. 3d ago First seen · 314 lines · 32 tokens per session scan D 6edb5f944615

Subscribe to this mod's changes

bash-pro is an agent published in the GitHub repository NOMARJ/sigil (5 stars, last pushed yesterday), licensed Apache-2.0. It adds 32 tokens to every session and 4,315 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

php-developer

Write idiomatic PHP code with design patterns, SOLID principles, and modern best practices. Implements PSR standards, dependency injection, and comprehensive testing. Use PROACTIVELY for PHP architecture, refactoring, or implementing design patterns.

davepoon/buildwithclaude · 51 tokens

python-expert

Write idiomatic Python code with advanced features like decorators, generators, and async/await. Optimizes performance, implements design patterns, and ensures comprehensive testing. Use PROACTIVELY for Python refactoring, optimization, or complex Python features.

davepoon/buildwithclaude · 52 tokens

rails-expert

Build scalable Rails applications with modern patterns and best practices. Implements service objects, background jobs, and API design. Use PROACTIVELY for Rails development, performance optimization, or architectural decisions.

davepoon/buildwithclaude · 42 tokens

rust-expert

Write idiomatic Rust code with ownership, lifetimes, and type safety. Implements concurrent systems, async programming, and memory-safe abstractions. Use PROACTIVELY for Rust development, systems programming, or performance-critical code.

davepoon/buildwithclaude · 49 tokens

typescript-expert

Write type-safe TypeScript with advanced type system features, generics, and utility types. Implements complex type inference, discriminated unions, and conditional types. Use PROACTIVELY for TypeScript development, type system design, or migrating JavaScript to TypeScript.

davepoon/buildwithclaude · 57 tokens

cpp-engineer

Write idiomatic C++ code with modern features, RAII, smart pointers, and STL algorithms. Handles templates, move semantics, and performance optimization. Use PROACTIVELY for C++ refactoring, memory safety, or complex C++ patterns.

davepoon/buildwithclaude · 54 tokens