Forumics logo Forumics
Issue 01

Back to issue

All Claude Code known issues

CLAIM C046 Supported 2026-11-07

GitHub issue #85856 in anthropics/claude-code, opened 2026-08-11 by momom2, records a report that on Windows with Git Bash every run of backslashes in a Bash tool command is halved before bash parses anything, that quoting cannot prevent it, and that the reporter attributes it to a mismatch between the MSVCRT quoting rules Claude Code uses to encode its command line and the different convention the MSYS2 bash binary uses to decode it, with Claude Code 2.1.222 on Windows 11 Home and Git for Windows bash 5.3.15.

Verbatim Excerpts from Cited Records
“On Windows with Git Bash, every run of backslashes in a Bash tool command is halved before bash parses anything: `n` backslashes arrive as `ceil(n/2)`.”
— momom2 · anthropics/claude-code (issue 85856 opening body, Summary section) · 2026-08-11T16:11:05Z ·GitHub Issue ↗
“Cause: Claude Code encodes its command line with **MSVCRT** quoting rules, but the target (`bash.exe`) is an **MSYS2** binary that decodes with a different convention. MSYS2 performs an un-escaping pass that Claude Code never escaped for, so one backslash is eaten from every pair.”
— momom2 · anthropics/claude-code (issue 85856 opening body, Summary section) · 2026-08-11T16:11:05Z ·GitHub Issue ↗
“Single backslashes survive, so raw-string regexes like `r"\s+"` keep working. That masks the bug until a Windows path or a literal escape appears, and it means agents can produce silently wrong output with no diagnostic.”
— momom2 · anthropics/claude-code (issue 85856 opening body, Severity section) · 2026-08-11T16:11:05Z ·GitHub Issue ↗
“- Expected: `a\\b` (bash single quotes are literal; nothing should change) - Actual: `a\b`”
— momom2 · anthropics/claude-code (issue 85856 opening body, Reproduction A section) · 2026-08-11T16:11:05Z ·GitHub Issue ↗
Counter-record: Issue remains open with 21 comments as of 2026-11-06; no maintainer reply appears in the surveyed thread. Independent confirmations: borisbat on 2026-08-20 reproduced the collapse byte-for-byte on Git for Windows 2.55.0.4 with Claude Code 2.1.236, and Sylvain13bdr on 2026-08-20 measured runs of 1 to 6 backslashes arriving as 1, 1, 2, 2, 3, 3, exactly ceil(n/2). emel-purely on 2026-08-28 ruled out PreToolUse hooks as the cause with two controls. The bug was still reported present on 2.1.294, 2.1.295, 2.1.300, 2.1.309 and 2.1.312, and most recently on 2.1.318 by xlurie on 2026-11-06. Related reports cited in the thread include 93915 on long-command truncation, 97409 as a fresh duplicate, and 92543, 93618, 98622 and 98733. Workarounds discussed are writing the script to a file with the Write tool and community PreToolUse hooks or plugins. Surveyed thread contains no maintainer fix or closure. The claim documents only the original report, not a verified current state. Falsification probe: If issue 85856 is deleted without archive, if the author edits the opening body so the quoted sentences no longer match verbatim, or if the author posts a retraction of the report, this claim drops to Withdrawn. Audit verification: Verified 100% continuous verbatim substring against official GitHub REST API by scripts/verify_claim_verbatim.py.