Claude Code Bash Patterns
Bash command patterns, PreToolUse hooks, and git workflows for Claude Code, with security guardrails and CLI integration.
- CCM score
- 46 of 100
- skills.sh installs
- 417
- GitHub stars
- 257
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers sequential and parallel command chaining, session persistence, background processes, and custom slash commands
- Includes 5 reference guides (
git-workflows.md,hooks-examples.md,cli-tool-integration.md,security-best-practices.md,troubleshooting-guide.md) and 5 templates - Enforces rules such as
&&for dependent commands, quoted paths, no--no-verifyor force-push without request, and a dangerous-command blocklist - Designed for developers configuring hooks, allowlists, and automated git, npm, bun, and wrangler workflows in Claude Code
Install
$ npx -y skills add secondsky/claude-skills --skill claude-code-bash-patterns -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
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
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- CLI & Terminal, Git & Releases
- First seen
- Jun 3, 2026
Questions
What does the claude-code-bash-patterns skill do?
The claude-code-bash-patterns skill gives Claude Code patterns for the Bash tool, covering PreToolUse hooks, command chaining, git workflows, custom commands and security guards. It also covers handling bash permission errors, command failures and hook configurations.
How do I install the claude-code-bash-patterns skill?
Run npx -y skills add secondsky/claude-skills --skill claude-code-bash-patterns -y in your project. After that, the claude-code-bash-patterns skill lets the agent follow its Bash rules, such as chaining dependent commands with && and quoting paths with spaces.
Who is the claude-code-bash-patterns skill for?
The claude-code-bash-patterns skill is for developers who use Claude Code and want to automate shell work safely. It suits anyone writing PreToolUse hooks, orchestrating CLI tools or adding custom commands in .claude/commands.
Does the claude-code-bash-patterns skill need any accounts or API keys?
The claude-code-bash-patterns skill itself needs no account. Its security guidance tells you to pass API keys through environment variables rather than hardcoding them in commands.
More from secondsky/claude-skills
All 116- Plan Interview417
- Bun React Ssr416
- Bun Shell416
- Bun Websocket Server414
- Bun Redis412
- Ml Pipeline Automation412
- Nuxt Core411
- Nuxt Data411
- Bun Ffi409
- Bun Nuxt409
- Bun Jest Migration408
- Bun Macros407
- Multi Ai Consultant407
- Model Deployment405
- Graphql Implementation403
- Jest Generator402
- Thesys Generative Ui393
- Nuxt Studio391
- Maz Ui390
- Woocommerce Code Review389
- Woocommerce Backend Dev388
- Woocommerce Copy Guidelines384
- Woocommerce Dev Cycle384
- Nuxt Seo345
Similar to Claude Code Bash Patterns
More CLI & TerminalguardrailsPlugindavepoon/buildwithclaude3.8K starsPreToolUse Bash guard for Claude Code that still holds under --dangerously-skip-permissions. Blocks pipe-to-shell installs, disk wipes and fork bombs; asks befo
git-guardrails-claude-codeSkillmattpocock/skills597.8K installsSet up a PreToolUse hook that blocks destructive git commands in Claude Code before they run.
claude-hook-writerSkillsecondsky/claude-skills418 installsSecurity-first guide for writing, reviewing, and debugging Claude Code hooks, covering event choice, matchers, and exit codes.
bash-defensive-patternsSkillsickn33/agentic-awesome-skills319 installsDefensive Bash guidance for production scripts covering strict mode, input validation, safe file handling, and logging.
slash-commandsSkillparcadei/continuous-claude-v3493 installsReference guide for creating Claude Code slash commands with arguments, bash execution, and file references.
bash-scriptingSkillmindrally/skills942 installsShell scripting conventions for secure, portable, and well-handled automation scripts in DevOps work.