Agent skill · software engineering · secondsky
claude-code-bash-patterns
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.
Why this skill is useful
Adds multiple executable scripts and automation patterns for Bash command orchestration that aren't in public docs.
What it needs
Requires bun, npm installed locally. About 5k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.
What this skill does
Claude Code Bash Patterns Status: Production Ready ✅ Last Verified: 2025-11-18 --- Quick Start Basic Command Command Chaining Hooks Create .claude-hook-pretooluse.sh: Load references/hooks-examples.md for complete hook patterns. --- The Five Core Patterns 1. Sequential Operations (&&) Use when: Each command depends on previous success Why: Stops chain if any command fails --- 2. Parallel Operations (Multiple tool calls) Use when: Commands are independent Load references/cli-tool-integration.md for parallel patterns. --- 3. Session Persistence Use when: Need to maintain state across commands --- 4. Background Processes Use when: Long-running tasks --- 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) 2. Quote paths with spaces (cd "path with spaces") 3. Check environment before destructive ops (rm, git push --force) 4. Use specialized tools first (Read, Grep, Glob before Bash) 5. Set timeouts for long operations (up to 10 minutes) 6. Validate inputs before passing to shell commands 7. Use hooks for repeated patterns (logging, validation) 8. Maintain session state (export variables once) 9. Handle errors explicitly (check exit codes) 10. Document custom commands in .claude/commands/ Never Do ❌ 1. Never use ; for dependent commands (use &&) 2. Never skip quoting paths with spaces 3. Never run rm -rf without confirmation 4. Never expose secrets in command output 5. Never ignore timeout limits (max 10 min) 6. Never use bash for file operations when specialized tools exist 7. Never chain with newlines (use && or ; explicitly) 8. Never force-push to main without explicit user request 9. Never skip hooks (--no-verify) without user request 10. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills secondsky/claude-code-bash-patterns