Claude should use platform-appropriate paths and commands when running on Windows

Resolved 💬 2 comments Opened Mar 3, 2026 by iansul Closed Apr 1, 2026

Feature Request

When Claude Code is running on Windows, it should default to Windows-compatible
paths and shell commands rather than Unix-style ones.

Current behavior

Claude generates Unix-style paths (forward slashes, /dev/null, bash syntax)
even when running on Windows, requiring users to manually correct them or add
reminders to CLAUDE.md.

Expected behavior

Claude detects the host OS at startup and adjusts default behavior accordingly:

  • Use backslashes (or forward slashes) in file paths appropriate for the context
  • Avoid Unix-only constructs (/dev/null, 2>&1 piped to bash, etc.)
  • When writing paths that will be executed via bash (e.g. hooks, statusline

commands in settings.json), use forward slashes since Claude Code runs those
via bash even on Windows

Workaround

Users currently have to add explicit instructions to ~/.claude/CLAUDE.md:

Windows 11 — always use Windows-compatible paths and commands

Related

  • #30524 — path canonicalization bug (backslash vs forward slash in cwd comparison)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗