claude-code-bash-patterns_skill

This skill helps you orchestrate CLI workflows, secure Bash usage, and automate Git tasks with robust patterns and hooks.
  • Python

8

GitHub Stars

4

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill jackspace/claudeskillz --skill claude-code-bash-patterns

  • README.md10.1 KB
  • SKILL.json28.0 KB
  • SKILL.md28.1 KB
  • SKILL.md.backup28.1 KB

Overview

This skill provides comprehensive, practical guidance for using the Bash tool inside Claude Code. It focuses on safe, repeatable command patterns, hook configuration, git workflow automation, CLI integration, and troubleshooting Bash tool issues. Use it to set up hooks, manage session behavior, and automate multi-command operations with security guards in place.

How this skill works

The skill documents core Bash patterns (chaining, parallel calls, heredoc, output capture, conditional execution) and explains how Claude Code runs commands in a persistent session with environment inheritance and a 30,000-character output limit. It shows how to configure PreToolUse, PostToolUse, and SessionStart hooks to audit, block, or transform commands, and describes production-tested git and CLI workflows for commits, PRs, and deployments.

When to use it

  • Orchestrating multi-step CLI workflows (build, test, deploy)
  • Automating git workflows: commits, PRs, and verification
  • Configuring PreToolUse/PostToolUse/SessionStart hooks
  • Creating or documenting custom .claude/commands/ for internal CLIs
  • Debugging truncated output, command failures, or session environment issues
  • Implementing security guards and allowlisting for dangerous operations

Best practices

  • Use && for dependent sequential steps and ; only when failures are acceptable
  • Parallelize only truly independent Bash tool calls to save time and tokens
  • Use HEREDOC with quotes to preserve newlines in commit messages and file content
  • Capture and trim large outputs (head/tail or write to file) to avoid the 30k truncation limit
  • Deploy PreToolUse hooks to block dangerous patterns and log commands for auditability
  • Run SessionStart hooks to source project env and export to $CLAUDE_ENV_FILE

Example use cases

  • Set up a PreToolUse hook that blocks rm -rf /, dd if=, mkfs, fork bombs, and force-pushes to main
  • Automate a build → test → deploy pipeline with npm install && npm run build && npx wrangler deploy
  • Create a HEREDOC-based git commit message that preserves formatting and co-author attribution
  • Run parallel git status, git diff --staged, and git log -5 to gather context before composing a commit
  • Add a PostToolUse hook to run prettier or tests after file edits and commit changes if safe

FAQ

Command output is truncated at about 30,000 characters. For large outputs, pipe to head/tail or write to a file and read the file in smaller chunks.

How do I block dangerous commands reliably?

Install a PreToolUse hook that inspects $CLAUDE_TOOL_INPUT and exits with code 2 on matching dangerous patterns (rm -rf /, dd if=, mkfs, fork bombs, sudo rm, force push), and log blocked attempts for audit.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational