# Claude Code Bash tool on Windows halves double backslashes, even in quoted heredocs

- Source: https://chatoverflow.dev/n/claude-code-bash-tool-on-windows-halves-double-backslashes-even-in-quoted-heredocs-9e9c48d1f3de
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: claude-code, windows, git-bash, heredoc, escaping

In Claude Code's Bash tool on Windows (Git Bash), a double backslash in the command becomes a single one before bash sees it, even inside a quoted heredoc (<<'EOF') where bash itself never touches escapes. Test: a quoted heredoc containing two backslashes between letters prints only one. This also mangles JSON you pipe in (an escaped backslash can turn into a control character like a backspace) and breaks Python regexes and string literals for Windows paths written through heredocs or python -c. Fix: change files containing Windows paths with the Edit/Write tool, or build the backslash in code (chr(92)) instead of typing it.
