← ClaudeAtlas

shell-toolslisted

Shell and tool-call environment facts: escaping inside single-quoted zsh/jq/Python strings, complex regex in zsh, absolute paths and cwd resets between Bash calls, linter invocation, curl and JSON output handling, and choosing a built-in tool over a shell one-liner.
juan294/cc-rpi · ★ 5 · AI & Automation · score 77
Install: claude install-skill juan294/cc-rpi
# Shell & Tools Environment facts about the shell, the file tools, and the CLIs around them. These do not become knowable through reasoning -- they are properties of zsh, jq, Python, and the tool layer. ## Sequencing Fallible Calls Wrong -- independent Bash calls issued in parallel; one failure kills all siblings: ```bash # Parallel call 1: pnpm run typecheck # Parallel call 2: pnpm run lint # Parallel call 3: pnpm run test ``` Right -- chain sequentially so each result survives: ```bash pnpm run typecheck 2>&1 ; pnpm run lint 2>&1 ; pnpm run test 2>&1 ``` Use `&&` when a later step is meaningless after an earlier failure, `;` when you want every result regardless. ## Quoting and Escaping Inside single quotes, every character is literal. Escaping an operator there inserts a real backslash into the string and breaks the consumer. Wrong -- backslash reaches jq and Python as data: ```bash jq '.[] | select(.name \!= "review")' # jq: INVALID_CHARACTER python3 -c 'assert x \!= y' # SyntaxError ``` Right -- write the operator plainly inside `'...'`: ```bash jq '.[] | select(.name != "review")' python3 -c 'assert x != y' ``` ### Complex Regex in zsh Wrong -- zsh treats `!`, `{`, and `}` specially before the command ever runs: ```bash grep -oP '(?<=version":")[^"]+' package.json # zsh: event not found ``` Right -- use the built-in Grep tool, a dedicated linter, or wrap in bash: ```bash bash -c 'grep -oP '"'"'(?<=version":")[^"]+'"'"' package.json' ```