shell

Guide safe command execution and redirection for Bash and Zsh.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/cstrahan/claude-plugins --skill shell-cstrahan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell
Source: https://github.com/cstrahan/claude-plugins/tree/main/skills/shell
Command: npx skills add https://github.com/cstrahan/claude-plugins --skill shell-cstrahan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Shell environments across Bash and Zsh can behave differently, making common commands fragile due to noclobber, extended globbing, and tricky quoting. This Skill guides you to write cross-shell commands that behave predictably in both shells.

Core Features & Use Cases

  • Detects your current shell (bash or zsh) and explains its quirks
  • Provides safe redirection techniques (>|, >|, and portable workarounds) to avoid noclobber errors
  • Covers quoting strategies and dangerous characters to prevent globbing issues
  • Includes practical examples for scripts and interactive sessions

Quick Start

Describe a shell task you want to run and Claude will generate a zsh- and bash-safe command sequence.

Frequently Asked Questions about shell

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent noclobber errors when redirecting output in bash and zsh?

To prevent noclobber errors during shell redirection, use safe redirection operators like >| to forcefully overwrite files in both bash and zsh. This ensures predictable file writing behavior across different shell environments without triggering accidental errors.

Why does globbing behave differently in zsh compared to bash?

Globbing behaves differently in zsh compared to bash due to zsh's extended globbing features and distinct pattern matching rules. You can ensure consistent cross-shell behavior by applying proper quoting strategies to prevent unintended pattern expansion.

What is the best way to write shell scripts that work in both bash and zsh?

The best way to write cross-shell scripts is to detect the current shell and apply safe redirection techniques along with consistent quoting rules. This approach avoids common pitfalls from noclobber and extended globbing differences.

How do I safely handle special characters in shell commands across different environments?

To safely handle special characters in shell commands, apply proper quoting strategies to prevent globbing issues. Using appropriate quotes ensures that special characters are interpreted literally rather than triggering pattern matching in bash or zsh.

Does the >| redirection operator work the same way in bash and zsh?

The >| redirection operator works as a safe redirection technique in both bash and zsh to bypass noclobber settings. It allows you to forcefully overwrite existing files reliably without encountering shell-specific behavior discrepancies.

When do I need to worry about noclobber settings breaking my shell scripts?

You need to worry about noclobber settings breaking shell scripts when performing standard file redirection, as the shell will block overwriting existing files. Using portable workarounds like the >| operator ensures your redirection executes reliably.