Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/secondsky/claude-skillsnpx agentmods add skills/secondsky/claude-skills/claude-code-bash-patternsWrote 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.
[](https://agentmods.dev/skills/secondsky/claude-skills/claude-code-bash-patterns)<a href="https://agentmods.dev/skills/secondsky/claude-skills/claude-code-bash-patterns"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/claude-code-bash-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/secondsky/claude-skills/claude-code-bash-patterns"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/claude-code-bash-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Tool Misuse · line 57 Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
- medium Excessive Agency · line 128 Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.02175 |
| Opus 5.5 | $0.00021 | $0.00870 |
| Sonnet 5.5 | $0.00010 | $0.00435 |
| Haiku 4.5 | $0.00005 | $0.00217 |
Grade B, and why
claude-code-bash-patterns scanned grade B 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 1mo 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 deletemediumDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
3. **Never run rm -rf without confirmation** Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -H "Authorization: Bearer $API_KEY" api.example.com How it starts
The opening of the file, as written. The whole thing — 424 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Claude Code Bash Patterns
Status: Production Ready ✅ | Last Verified: 2025-11-18
Quick Start
Basic Command
ls -la
Command Chaining
bun install && bun run build && bun test
Hooks
Create .claude-hook-pretooluse.sh:
#!/usr/bin/env bash
# PreToolUse hook - runs before every Bash command
echo "Running: $1"
Load references/hooks-examples.md for complete hook patterns.
The Five Core Patterns
1. Sequential Operations (&&)
Use when: Each command depends on previous success
git add . && git commit -m "message" && git push
Why: Stops chain if any command fails
2. Parallel Operations (Multiple tool calls)
Use when: Commands are independent
Message with multiple Bash tool calls in parallel
Load references/cli-tool-integration.md for parallel patterns.
3. Session Persistence
Use when: Need to maintain state across commands
# Set environment variable
export API_KEY="sk-..."
# Use in later commands (same session)
curl -H "Authorization: Bearer $API_KEY" api.example.com
4. Background Processes
Use when: Long-running tasks
npm run dev &
# Get PID with $!
5. Hooks for Automation
Use when: Need pre/post command logic
Load references/hooks-examples.md for all hook types.
Critical Rules
Always Do ✅
- Use && for sequential dependencies (not semicolons)
- Quote paths with spaces (
cd "path with spaces") - Check environment before destructive ops (rm, git push --force)
- Use specialized tools first (Read, Grep, Glob before Bash)
- Set timeouts for long operations (up to 10 minutes)
- Validate inputs before passing to shell commands
- Use hooks for repeated patterns (logging, validation)
- Maintain session state (export variables once)
- Handle errors explicitly (check exit codes)
- Document custom commands in .claude/commands/
What ships with it
13 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/cli-tool-integration.md 4.8 KB
- references/git-workflows.md 9.7 KB
- references/hooks-examples.md 6.7 KB
- references/security-best-practices.md 4.1 KB
- references/troubleshooting-guide.md 8.4 KB
- scripts/bash-audit-logger.sh 4.7 KB runs code
- scripts/dangerous-command-guard.py 6.4 KB runs code
- scripts/package-manager-enforcer.sh 2.3 KB runs code
- templates/.envrc.example 5.7 KB
- templates/custom-command-template.md 5.1 KB
- templates/dangerous-commands.json 2.9 KB
- templates/github-workflow.yml 3.1 KB
- templates/settings.json 3.1 KB
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.
- 1mo ago First seen · 424 lines · 52 tokens per session scan B 1c1be2d7633e
claude-code-bash-patterns is a skill published in the GitHub repository secondsky/claude-skills (231 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 2,175 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B 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-09-03.
Other skills, from other repositories
review
Review a change with what this repository knows about it — who depends on the file, which tests cover it, what broke here before, and what the repo has written down. Use before approving a diff, opening a PR, or when asked to review.
milestone
Record a change that reshaped the repository — what moved, why it was worth doing, and which areas it touched. Use after a migration, a rewrite, or a decision that changed how part of the system works.
promote
Turn a scratch script into a permanent tool this repo keeps. Use when a check, report, or analysis has proved worth running more than once.
catchup
Answer "where did I stop?" for this project. Gives three short groups, done, open and next, taken from the last chat, the recorded to-dos, the last handoff note and git. Use when the user comes back to a project, starts a new chat, or asks where they left off. It writes nothing.
commit-push-pr
Use when asked to commit and push a feature branch, with or without a pull request. Its no-PR mode publishes without a PR. Not for a PR body alone: use create-pull-request.
commit
Use when asked to commit changes, create a typed branch, format history for a changelog, or rewrite messages of HEAD or an unpushed range. Not for pushing or a PR: use commit-push-pr.