[Bug] @agent command fails to list custom agents in PowerShell on Windows
Resolved 💬 3 comments Opened Oct 7, 2025 by tjazevedo Closed Oct 11, 2025
Bug Description
Bug in Claude Code for Windows when running in PowerShell: the @agent command does not list custom agents available in the project. It only works correctly when running
via WSL (Windows Subsystem for Linux). In PowerShell, custom agents configured in .claude/agents/ do not appear in the listing, while in WSL all are displayed normally.
Environment Info
- Platform: win32
- Terminal: mintty
- Version: 2.0.10
- Feedback ID:
Errors
[{"error":"Error\n at CA (B:/~BUN/root/claude.exe:530:1074)\n at <anonymous> (B:/~BUN/root/claude.exe:531:9903)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:861:50)\n at processTicksAndRejections (native:7:39)\n at spawnSync (unknown)\n at spawnSync (node:child_process:226:22)\n at execSync (node:child_process:275:109)\n at Z (B:/~BUN/root/claude.exe:1312:8000)\n at KbY (B:/~BUN/root/claude.exe:1312:8178)\n at request (B:/~BUN/root/claude.exe:533:2088)\n at processTicksAndRejections (native:7:39)\n at spawnSync (unknown)\n at spawnSync (node:child_process:226:22)\n at execSync (node:child_process:275:109)\n at Z (B:/~BUN/root/claude.exe:1312:8000)\n at KbY (B:/~BUN/root/claude.exe:1312:8178)\n at HbY (B:/~BUN/root/claude.exe:1312:8708)\n at HbY (B:/~BUN/root/claude.exe:1312:8831)\n at W (B:/~BUN/root/claude.exe:528:14227)","timestamp":"2025-10-07T22:39:46.318Z"},{"error":"AbortError: The operation was aborted.\n at unknown\n at abortChildProcess (node:child_process:947:42)\n at onAbortListener2 (node:child_process:35:24)\n at abort (unknown)","timestamp":"2025-10-07T22:39:54.683Z"},{"error":"AbortError: The operation was aborted.\n at unknown\n at abortChildProcess (node:child_process:947:42)\n at onAbortListener2 (node:child_process:35:24)\n at abort (unknown)","timestamp":"2025-10-07T22:39:57.615Z"},{"error":"Error: Failed to create shell snapshot: Command failed: C:\\Program Files\\Git\\bin\\bash.exe -c -l SNAPSHOT_FILE='C:\\Users\\tjaba\\.claude\\shell-snapshots\\snapshot-bash-1759876787012-3w0vrx.sh'\n # No user config file to source\n \n # First, create/clear the snapshot file\n echo \"# Snapshot file\" >| \"$SNAPSHOT_FILE\"\n \n # When this file is sourced, we first unalias to avoid conflicts\n # This is necessary because aliases get \"frozen\" inside function definitions at definition time,\n # which can cause unexpected behavior when functions use commands that conflict with aliases\n echo \"# Unset all aliases to avoid conflicts with functions\" >> \"$SNAPSHOT_FILE\"\n echo \"unalias -a 2>/dev/null || true\" >> \"$SNAPSHOT_FILE\"\n \n echo \"shopt -s expand_aliases\" >> \"$SNAPSHOT_FILE\"\n \n \n # Check for rg availability\n echo \"# Check for rg availability\" >> \"$SNAPSHOT_FILE\"\n echo \"if ! command -v rg >/dev/null 2>&1; then\" >> \"$SNAPSHOT_FILE\"\n echo ' alias rg='\"''\\''C:\\Users\\tjaba\\.local\\bin\\claude.exe'\\'' --ripgrep'\" >> \"$SNAPSHOT_FILE\"\n echo \"fi\" >> \"$SNAPSHOT_FILE\"\n \n # Add PATH to the file\n echo \"export PATH=\\$PATH\" >> \"$SNAPSHOT_FILE\"\n \n \n # Exit silently on success, only report errors\n if [ ! -f \"$SNAPSHOT_FILE\" ]; then\n echo \"Error: Snapshot file was not created at $SNAPSHOT_FILE\" >&2\n exit 1\n fi\n \n at <anonymous> (B:/~BUN/root/claude.exe:1297:138)\n at <anonymous> (B:/~BUN/root/claude.exe:1295:1776)\n at exitHandler (node:child_process:109:27)\n at emit (node:events:98:22)\n at #maybeClose (node:child_process:778:16)\n at #handleOnExit (node:child_process:532:72)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-10-07T22:40:03.734Z"},{"error":"Error\n at CA (B:/~BUN/root/claude.exe:530:1074)\n at <anonymous> (B:/~BUN/root/claude.exe:531:9903)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:861:50)\n at processTicksAndRejections (native:7:39)\n at request (B:/~BUN/root/claude.exe:533:2088)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-10-07T22:46:41.504Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗