Claude Code Pwsh Guard
Description
Claude Code hook pack that stops the agent firing Bash-only syntax at a Windows PowerShell session. Detects extglob, POSIX env refs, /dev/null, heredocs and more; auto-rewrites the safe ones and blocks the rest with the correct pwsh command so the agent self-corrects. Not affiliated with Anthropic.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
claude-code-pwsh-guard
A Claude Code hook pack that catches bash-only shell syntax before it reaches a Windows PowerShell session, and either rewrites it to the PowerShell equivalent or blocks it with the correct command in the error message.
Claude pwsh-guard Result
──────────────────────────────────────────────────────────────────────────────────────────────────
Bash("shopt -s extglob; ─▶ PreToolUse: deny ✗ never runs
rm -f !(keep.txt|keep2.txt)") [ERROR] shopt / extglob is a bash builtin
PowerShell: Get-ChildItem -Exclude ... |
Remove-Item
[ERROR] extglob pattern !(...)
Bash("Get-ChildItem -Exclude ─▶ (silent) ✓ runs
keep.txt,keep2.txt | Remove-Item")
Bash("export NODE_ENV=production; ─▶ PreToolUse: allow + updatedInput ✓ runs, fixed
echo $PATH > /dev/null") $env:NODE_ENV = "production";
echo $env:PATH > $null
Without the guard, that first command produces `The term 'shopt' is not recognized`, Claude tries a variation of the same bash syntax, and the loop repeats. That loop is [issue #28670](https://github.com/anthropics/claude-code/issues/28670).
   
Quick start
- Clone this repo anywhere:
git clone https://github.com//claude-code-pwsh-guard cd claude-code-pwsh-guardpowershell -ExecutionPolicy Bypass -File .\install.ps1
Related Skills
Auto Update
Pull the latest ECC repo changes and reinstall the current managed targets.
Development Ecc Guide
Navigate ECC's current agents, skills, commands, hooks, install profiles, and docs from the live repository su
Development Epic Claim
Claim an epic issue, stamp coordination state, and sync local ownership.
Development Epic Publish
Publish a validated epic update back to the issue and local cache.
Development Epic Review
Mark epic review requested, approved, or changes requested.
Development Epic Unblock
Sweep blocked epic issues and reopen anything whose dependencies are closed.
Development Related Agents
Django Build Resolver
Django/Python build, migration, and dependency error resolution specialist. Fixes pip/Poetry errors, migration
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11