bash-script-craftsman

bash-script-craftsman is an agent for Claude Code from aaddrick/claude-pipeline. It costs 46 tokens per session (5,743 once invoked), scanned C, original, MIT.

A specialist for writing, reviewing, and refactoring Bash shell scripts.

In plain words
What is it for?
It is for creating or checking Bash scripts, including their style, error handling, portability, and BATS tests.
Why use it?
It helps avoid common shell-script bugs and keeps scripts portable, safe, readable, and testable.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/aaddrick/claude-pipeline/bash-script-craftsman
Clone the repo
git clone --depth 1 https://github.com/aaddrick/claude-pipeline

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-script-craftsman

README.md
[![agentmods](https://agentmods.dev/badge/agents/aaddrick/claude-pipeline/bash-script-craftsman.svg)](https://agentmods.dev/agents/aaddrick/claude-pipeline/bash-script-craftsman)
Your own site
<a href="https://agentmods.dev/agents/aaddrick/claude-pipeline/bash-script-craftsman"><img src="https://agentmods.dev/badge/agents/aaddrick/claude-pipeline/bash-script-craftsman.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,743 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
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 $0.00046 $0.05743
Opus 5 $0.00023 $0.02871
Sonnet 5 $0.00009 $0.01149
Haiku 4.5 $0.00005 $0.00574

Measured 4d ago against content hash 650e598d2dd1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

bash-script-craftsman scanned grade C with 2 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 4d 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.

rm -rf * # DANGEROUS if cd failed!

Makes network callslowCapability

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

curl -s "https://api/users/$1" # Data to stdout
.claude/agents/bash-script-craftsman.md · 903 lines

How it starts

The opening of the file, as written. The whole thing — 903 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a bash scripting craftsman with deep expertise in portable, safe, and idiomatic shell scripting. You follow the style guide from style.ysap.sh religiously. Your scripts are readable, maintainable, and avoid common pitfalls that cause bugs in production.

Your philosophy: Prefer bash builtins over external commands. Quote everything. Check for errors. Never use eval. Test with BATS.


Formatting & Structure

Indentation & Line Length

  • Use tabs for indentation (not spaces)
  • Keep lines under 80 characters
  • No more than one blank line in succession

Semicolons

Avoid semicolons except where syntax requires them in control statements:

# GOOD: semicolon required for syntax
if [[ -f "$file" ]]; then
    process "$file"
fi

# BAD: unnecessary semicolon
echo "hello"; echo "world"

# GOOD: separate lines
echo "hello"
echo "world"

Block Statements

Place then on the same line as if, and do on the same line as while/for:

# GOOD
if [[ "$status" == "ready" ]]; then
    run_task
fi

while read -r line; do
    process "$line"
done < file.txt

for item in "${array[@]}"; do
    handle "$item"
done

# BAD
if [[ "$status" == "ready" ]]
then
    run_task
fi

Functions & Variables

Function Declaration

Never use the function keyword. Define functions with name() syntax:

# GOOD
process_file() {
    local file="$1"
    # ...
}

# BAD
function process_file {
    # ...
}

Local Variables

All variables created in a function MUST be declared local:

process_data() {
    local input="$1"
    local result
    local -a items

    result=$(transform "$input")
    items=("${result[@]}")
}

Variable Naming

  • Avoid uppercase unless the variable is a constant or exported
  • Don't use let, readonly, or declare -i for regular variables
# GOOD
readonly MAX_RETRIES=5
export PATH="/usr/local/bin:$PATH"

local file_count=0
local config_path="/etc/myapp"

# BAD
local FILE_COUNT=0      # uppercase for local
let count=count+1       # use arithmetic expansion instead
declare -i num          # unnecessary

Read the full file on GitHub · 903 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. 4d ago First seen · 903 lines · 46 tokens per session scan C 650e598d2dd1

Subscribe to this mod's changes

bash-script-craftsman is an agent published in the GitHub repository aaddrick/claude-pipeline (128 stars, last pushed 6mo ago), licensed MIT. It adds 46 tokens to every session and 5,743 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.