clean-code-bash

clean-code-bash is a skill for Claude Code from CassetteTapeCrackle/claude-starters. It costs 38 tokens per session (328 once invoked), scanned C, original, MIT.

Bash coding guidance for writing and reviewing shell scripts, which automate commands and system tasks.

In plain words
What is it for?
It is for applying strict mode, safe quoting, traps, arrays, reliable input reading, temporary directories, and meaningful exit codes.
Why use it?
It helps avoid unsafe argument handling, incorrect exit behavior, broken temporary-file cleanup, and errors caused by parsing command output.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-starters plugin — 9 skills, 1 command, 8 agents, 2 hooks shipped together

Good fit It is for applying strict mode, safe quoting, traps, arrays, reliable input reading, temporary directories, and meaningful exit codes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cassettetapecrackle/claude-starters/clean-code-bash
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.

Any agent
npx skills add CassetteTapeCrackle/claude-starters --skill clean-code-bash
Clone the repo
git clone --depth 1 https://github.com/CassetteTapeCrackle/claude-starters

Made for: Claude Code.

Or install claude-starters, the plugin that ships this one along with the rest of its 9 skills, 1 command, 8 agents, 2 hooks.

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 clean-code-bash

README.md
[![agentmods](https://agentmods.dev/badge/skills/cassettetapecrackle/claude-starters/clean-code-bash.svg)](https://agentmods.dev/skills/cassettetapecrackle/claude-starters/clean-code-bash)
Your own site
<a href="https://agentmods.dev/skills/cassettetapecrackle/claude-starters/clean-code-bash"><img src="https://agentmods.dev/badge/skills/cassettetapecrackle/claude-starters/clean-code-bash.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 328 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00038 $0.00328
Opus 5 $0.00019 $0.00164
Sonnet 5 $0.00008 $0.00066
Haiku 4.5 $0.00004 $0.00033

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

Security

Grade C, and why

clean-code-bash 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 7d 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.

- `trap 'rm -rf "$tmp"' EXIT` for cleanup; create temps with `mktemp -d`.
skills/clean-code-bash/SKILL.md · 25 lines

What it actually says

Clean-code Bash (depth)

On top of the base rules (set -euo pipefail, shellcheck clean, bats tests).

Safety

  • set -euo pipefail always; understand where -e doesn't fire (in if, ||, command substitution) and check explicitly there.
  • Quote every expansion; "${arr[@]}" for arrays. [[ ]] for tests; (( )) for arithmetic.
  • trap 'rm -rf "$tmp"' EXIT for cleanup; create temps with mktemp -d.

Robustness

  • local all function vars. Prefer functions + a main "$@" entrypoint.
  • Read lines with while IFS= read -r line or mapfile; never parse ls.
  • Parameter expansion for defaults/checks: "${VAR:?message}", "${VAR:-default}".
  • printf '%s\n' over echo for arbitrary data. Meaningful exit codes; errors to stderr (>&2).

Smells

  • Unquoted $var in a path/test → word-splitting/glob bug.
  • Parsing ls/find output by whitespace → use globs or -print0/read -d ''.
  • A temp file with no trap cleanup → litter on failure.
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. 7d ago First seen · 25 lines · 38 tokens per session scan C 01bbeae72509

Subscribe to this mod's changes

clean-code-bash is a skill published in the GitHub repository CassetteTapeCrackle/claude-starters (1 stars, last pushed 19d ago), licensed MIT. It adds 38 tokens to every session and 328 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

open-problem

Use when the user points at a hard, unsolved, or open problem in any field — mathematics, physics, biology, ML, engineering — and wants a real attack on it. Runs a sustained multi-agent assault: establishes the state of play from primary sources, hunts for the two literatures nobody has combined, generates and kills…

infiniV/ultra-ml-intern · 141 tokens

grounding

Use before writing, reviewing, or debugging any code that uses a specific ML model (DINOv3, SAM 2, Whisper, Qwen3-Embedding, SigLIP 2…), whenever a model-provenance archive for it exists locally. Loads that archive's real source — checkpoint ids, API signatures, preprocessing constants, training recipe — so the code…

infiniV/ultra-ml-intern · 147 tokens

engineering-discipline

Behavioral guidelines to reduce common agent coding mistakes — thinking before coding, simplicity, surgical changes, goal-driven execution, and mandatory verification for data/BI work. Adapted from andrej-karpathy-skills (MIT), with a data/BI engineering layer added. Use this skill whenever writing, editing, or…

mukilankarthik/self-awareness · 86 tokens

self-awareness

Behavioral calibration system that helps Claude catch its own failure patterns in real-time. Triggers on EVERY response to run self-checks for verbosity compensation, hallucination risk, missed frustration signals, sycophantic patterns, and constraint violations. Use this skill continuously—it modifies how Claude…

mukilankarthik/self-awareness · 67 tokens

fable-method

Use when a task carries real uncertainty — multi-step builds, debugging where the first theory may be wrong, research or analysis with claims to verify, anything touching data/APIs/files not yet opened, or work that will be handed off. Also when work keeps failing or stalling, before declaring anything done, or when…

debabsah/fable-method · 111 tokens

model-provenance

Use when the user names a specific ML model (e.g. DINOv3, SAM 2, Whisper, Qwen2-VL) and wants its real/official code, training recipe, or papers found, verified, or archived locally for grounded coding. Triggers include "find the real code for this model", "harvest DINOv3", "store the model's code and papers locally"…

infiniV/ultra-ml-intern · 134 tokens