SkillsReviewed · secondsky

Claude Code Bash Patterns

Claude Code Bash Patterns is a skill for developers automating shell and Git work in Claude Code, but several hook examples conflict with its scripts. It includes workflow guides, command templates and hooks for blocking dangerous command patterns, logging commands and enforcing package-manager consistency. Current compatibility and runtime effectiveness are unverified.

Researched 17 Nov 2026

In short.

Claude Code Bash Patterns is a reusable skill for developers who want shell automation recipes in Claude Code, but its inconsistent hook instructions require careful adaptation. Its three scripts provide a command-pattern guard, a local audit logger and a lockfile-based package-manager check. Several configuration examples still use an environment variable that the scripts explicitly describe as the wrong input mechanism. The guard has incomplete coverage, and the settings template grants broad tool access. No code was executed. Current Claude Code compatibility, operating costs and claimed performance improvements are unknown.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete supplied folder plugins/claude-code-bash-patterns/skills/claude-code-bash-patterns at revision 88378361314f558fb719aec0af9fd898ab36f0b2: SKILL.md, five reference documents, three scripts and five templates. The repository-root LICENSE is the related notice outside that folder. Other repository content, plugin installation packaging, external documentation and linked issue contents are outside this scope. No code or commands were executed; installation, hook execution, platform compatibility, environment persistence, deployment outcomes, performance and operating costs remain unverified.

The overview

Identity

The resource is the claude-code-bash-patterns skill folder in secondsky/claude-skills. It combines assistant instructions with reference documents, Bash and Python scripts, and configuration templates. SKILL.md declares version 2.0.0. It is an instruction package for Claude Code, rather than a standalone coding assistant.

The original source location is [https://github.com/secondsky/claude-skills/tree/main/plugins/claude-code-bash-patterns/skills/claude-code-bash-patterns]. The supplied files are pinned to revision 88378361314f558fb719aec0af9fd898ab36f0b2.

Assessment

The contents support using this as an editable collection of shell, Git and CLI automation recipes. Its practical value comes from concrete command sequences, reusable custom-command structures and inspectable hook scripts.

Adoption requires someone comfortable reviewing shell code and Claude Code settings. The documentation and implementation disagree about hook inputs, environment loading and security coverage. Those inconsistencies make copying the complete configuration unchanged a poor starting point. The supplied material does not establish dependable unattended operation.

Users

The strongest fit is developers already using Claude Code who want repeatable Git operations, documented internal CLI tools or lightweight local hooks. Teams maintaining npm, pnpm or Yarn projects may find the lockfile check useful within its limited command coverage.

Beginners can learn dependency chaining, path quoting and structured workflows from the examples. Installing the hooks requires additional knowledge of JSON configuration, executable scripts, credentials and Git recovery. The contents do not establish equivalent integration with other assistants.

Capabilities

The instructions cover success-dependent command chains, independent parallel tool calls, environment state, background processes and hooks. The references add commit preparation, branch and pull-request workflows, CLI documentation in CLAUDE.md, troubleshooting and security examples.

The three scripts implement separate functions. The Python guard checks command text against dangerous patterns. The logger writes timestamped commands with user, host and working-directory information to a local file, with best-effort secret redaction and a 10 MB rotation threshold. The package-manager hook compares commands with pnpm, Yarn or npm lockfiles.

Five templates cover custom commands, environment configuration, dangerous-pattern examples, Claude Code settings and GitHub Actions. The GitHub Actions template runs conventional npm testing, builds and Cloudflare deployments; it contains no Claude Code invocation.

Using it

Requirements

The hook examples assume Claude Code with command-hook support, a compatible shell and access to local settings and script files. The guard requires Python 3. Both Bash scripts use jq; the logger also uses standard command-line utilities including sed and stat. It optionally uses flock to coordinate concurrent logging.

Git, GitHub CLI, package managers and Wrangler are needed only for workflows using those tools. Deployment and service examples require their corresponding authentication. The environment template is written for direnv and uses its PATH_add helper. The CI template selects Node.js 20, which is an example choice rather than an established minimum for the whole skill.

The supplied material does not establish a minimum supported Claude Code version or verified operating-system coverage.

Mechanism

SKILL.md supplies instructions and directs the assistant to topic-specific references. Custom-command files describe workflows for the assistant to follow. Separately configured hooks execute local programs around tool use or session startup.

The guard reads JSON from standard input, extracts tool_input.command and checks regular expressions. A matching pattern produces an error and exit code 2. The package-manager script also reads standard input, checks lockfiles in its working directory and compares them with a command beginning with npm, pnpm or yarn. When multiple lockfiles exist, its priority is pnpm, then Yarn, then npm.

The logger reads the same command payload and appends a redacted entry to ~/.claude/bash-audit.log. The dangerous-commands.json template is separate illustrative data: the Python guard defines its patterns internally and never loads that JSON file. Editing the template therefore does not change the guard.

Setup

The supplied hook configurations expect scripts under ~/.claude/hooks/ and register them in ~/.claude/settings.json. Bash hooks invoked directly need executable permissions; the guard is invoked through python3. The captured folder does not provide a complete, verified skill-installation command.

Merge individually reviewed hooks into existing settings. The settings template warns that copying it globally enables its hooks for every session. Its environment loader additionally requires a project-root .claude-enable-envrc sentinel before sourcing .envrc, which executes project shell code.

Resolve the inconsistent input examples before adoption: the three scripts read JSON from standard input, while several inline file-protection and formatting hooks still read CLAUDE_TOOL_INPUT. The environment template also needs adaptation if sourced without direnv.

Example

An intended Git workflow starts by inspecting git status, git diff --staged and git log -5 --oneline through independent calls. After reviewing the changes, a developer could adapt the documented pattern to npm test && git add path/to/file && git commit -m 'fix: correct parsing'. The chain attempts staging and committing only if the preceding commands succeed. The project must actually define the test command.

For a project with pnpm-lock.yaml, the package-manager script is designed to reject a command beginning with npm install. Its source checks only the start of the command, so a command prefixed with cd project && would fall outside that check. These are intended behavior and source-derived limits; no commands were executed.

Assessment & evidence

Limitations

All three scripts read JSON from standard input. Comments in bash-audit-logger.sh and package-manager-enforcer.sh explicitly identify their former CLAUDE_TOOL_INPUT environment-variable implementation as incorrect. Nevertheless, the settings template and reference snippets still use CLAUDE_TOOL_INPUT for some hooks. If that variable is absent, the file-protection and formatting snippets cannot identify the intended file.

The guard matches raw command text against an incomplete denylist. Its own comments acknowledge bypasses through alternate shell expressions. Although it rejects malformed JSON and invalid object structures, it allows missing, empty or non-string command fields. The settings template also permits broad command families including Python, Node.js and npx. The guard's blocked-command message prints the complete command without redaction.

Package-manager enforcement covers only npm, pnpm and yarn at the beginning of a command, using lockfiles in the hook's current directory. It does not comprehensively inspect chained commands, wrappers or Bun usage, and it does not explicitly reject JSON parsing failures.

Logger redaction covers known secret shapes and can miss custom formats. Logs retain commands and local user, host and directory information. The script always finishes with exit code 0, so logging failure does not block execution. It tightens file permissions on creation or rotation, but not for an existing log. Rotation lacks locking when flock is unavailable.

Environment instructions disagree: older snippets dump the full environment into CLAUDE_ENV_FILE, while the settings template avoids that dump and sources .envrc only after opt-in. The supplied material does not demonstrate that the revised loader persists variables into later tool calls. Direct sourcing also lacks the direnv context expected by PATH_add.

Git and deployment recipes need individual review. The failed-commit recovery conditions do not establish that amending the previous commit is appropriate, and a recovery example uses git reset --hard. The CI template contains placeholder URLs and reports failed production health checks without implementing rollback.

Reasoning

The useful part is concrete structure: named files, actual script implementations and workflows with explicit prerequisites and verification steps. These give developers material they can inspect and adapt.

Confidence in enforcement is lower because visible implementation limits contradict broader assurances. The security guide describes least privilege, but the settings template grants broad tool access. The guard describes fail-secure behavior while permitting some unexpected command fields. These source-level discrepancies support cautious, selective adoption; they do not establish runtime security or reliability.

Alternatives

For a smaller setup, use individual project scripts or adapt the custom-command template without enabling the complete global hook configuration. For ordinary build and deployment automation, the included GitHub Actions example shows a path that does not invoke an assistant.

The skill points to Claude Code documentation for hooks [https://docs.claude.com/en/docs/claude-code/hooks] and custom commands [https://docs.claude.com/en/docs/claude-code/custom-commands]. Those pages' current contents and availability were not assessed. No competing skill has enough supplied evidence for a feature or cost comparison.

Evidence

The supplied source includes the skill instructions, five reference guides, three scripts, five templates and the repository MIT notice. Findings about input parsing, pattern matching, logging and configuration follow from those files' visible contents. Nothing was executed, and no runtime results are established.

Production-ready and production-validated labels are author assertions. The claimed 55% token saving, 12 prevented errors and 40% speed improvement lack captured methods, baselines or result logs. The troubleshooting guide links external issues, but their contents and present resolution status are not included.

Access & freshness

Costs

The MIT notice grants permission to use and redistribute the software free of charge. That permission does not establish the cost of operating the surrounding tools.

Claude Code or model-access charges, prompt-based hook usage, CI runner costs and deployed-service costs are not specified. Actual token consumption, operating costs and savings are unknown. The metadata's claimed 55% token saving has no supporting measurements in the supplied files.

Rights

SKILL.md declares MIT, and the repository LICENSE names Claude Skills Maintainers with a 2025 copyright notice. The licence permits use, copying, modification, publication, distribution, sublicensing and sale.

Copies or substantial portions must retain the copyright and permission notice. The software is supplied without warranty. A redistributed source bundle should retain the repository LICENSE alongside the skill files.

Freshness

SKILL.md declares version 2.0.0 and a last-verified date of 2025-11-18. The supplied snapshot was captured on 2026-11-17 at 13:45:02.824 UTC from revision 88378361314f558fb719aec0af9fd898ab36f0b2. Capture time does not establish when the functionality was last validated.

Current compatibility with Claude Code remains unknown. The troubleshooting guide's timeout defaults, output limits, restart parameter and package-update instructions are not corroborated by a captured current tool specification. The scripts describe input-handling corrections, but related documentation still contains the older approach.

Actions

Start with one workflow or hook in a disposable project. Confirm the current Claude Code input contract and settings syntax, install the required dependencies and merge only the configuration needed. Exercise benign allow and block cases, malformed payloads, command chains and lockfile mismatches before relying on enforcement.

Check redaction with dummy credentials and inspect log permissions. Narrow tool access to the intended tasks. Review project .envrc contents before enabling execution, and confirm environment persistence separately. For deployment templates, replace placeholders, configure credentials and establish failure recovery before use. Preserve the MIT notice when sharing copies.

Evidence for this report

LICENSEnotice · checked 2026-11-17