claude-code-bash-patterns

Featured

Claude Code Bash tool patterns with hooks, automation, git workflows. Use for PreToolUse hooks, command chaining, CLI orchestration, custom commands, or encountering bash permissions, command failures, security guards, hook configurations.

AI & Automation 221 stars 31 forks Updated today MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
78
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Claude Code Bash Patterns **Status**: Production Ready ✅ | **Last Verified**: 2025-11-18 --- ## Quick Start ### Basic Command ```bash ls -la ``` ### Command Chaining ```bash bun install && bun run build && bun test ``` ### Hooks Create `.claude-hook-pretooluse.sh`: ```bash #!/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 ```bash 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 ```bash # 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 ```bash 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 ✅ 1. **Use && for sequential dependencies** (not semicolons...

Details

Author
secondsky
Repository
secondsky/claude-skills
Created
10 months ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category