AI Skill MartBrowse skillsPromptsProgramsLearnWhat is a Skill?
← Back to list

Windows Agent Shell Traps

Field-tested rules for coding agents on Windows: Git Bash path rewriting, PowerShell quoting and encoding, and CRLF pitfalls.

Dev & CodingIntermediate★ 788⑂ 95AI score 9/10Last updated: Nov 21, 2026

What it does

  • Forces you to establish which shell actually runs the command (Git Bash, Windows PowerShell 5.1, or pwsh) before debugging.
  • Documents Git Bash's rewriting of leading-slash arguments, /c/x path translation, drive-letter casing bugs, and junction hazards with npm --prefix.
  • Covers PowerShell traps: token splitting, judging success by $LASTEXITCODE, empty-string env vars being deleted, and the 10-minute tool timeout.
  • Ships check_text.py (mojibake, BOM, CRLF, invalid UTF-8, --fix-crlf) and probe_argv.py (what arguments and pipe encodings a program really received).

Who it's for

  • Developers running Claude Code, Cursor, or Codex on Windows.
  • Cross-platform teams whose macOS/Linux scripts must also work on Windows.
  • Anyone repeatedly hitting "works here, breaks there" failures.

Examples

  1. gh api /repos/owner/name fails with invalid API endpoint: "C:/Program Files/Git/repos/..." → drop the leading slash or set MSYS_NO_PATHCONV=1.
  2. Em-dashes and § turn into mojibake after a PowerShell Get-Content edit → run python <skill dir>/scripts/check_text.py <files>, then restore with git checkout <good-ref> -- <file>.
  3. Vitest reports No test suite found with exit 1 → uppercase the drive letter (C:/work/app) and use npm --prefix <dir>.

· · · Install guide · · ·

Try it now, no install

Paste this into Claude to use the skill without installing anything.

Read the instructions in this file and follow them to help me:
https://raw.githubusercontent.com/phuryn/product-engineering/HEAD/agent-harness/skills/windows-agent-shell/SKILL.md

What I want: (describe your task here)

If Claude can't open the link, open it yourself and paste the contents instead.

↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on AI Skill Mart.
Copy the agent-harness/skills/windows-agent-shell folder from the GitHub repo phuryn/product-engineering into my ~/.claude/skills/windows-agent-shell/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/phuryn/product-engineering.git /tmp/product-engineering && mkdir -p ~/.claude/skills && cp -r /tmp/product-engineering/agent-harness/skills/windows-agent-shell ~/.claude/skills/

⚠ This is a third-party skill. Check the source repository before installing.

  1. Open a terminal (Git Bash recommended on Windows).
  2. Clone the repo: git clone https://github.com/phuryn/product-engineering.git
  3. Create the skills folder: mkdir -p ~/.claude/skills
  4. Copy the skill: cp -r product-engineering/agent-harness/skills/windows-agent-shell ~/.claude/skills/
  5. Verify SKILL.md plus the scripts/ and references/ folders came along.
  6. Restart Claude Code and trigger it with a prompt like "my Windows output came back garbled".
  7. The bundled scripts need Python — confirm with python --version.