Windows: tool calls fail when arguments contain single-backslash paths (unescaped in tool-call JSON)
Summary
On Windows, when the model emits a tool call whose arguments include an absolute path like E:\Folder\file.md, the backslashes go into the tool-call JSON unescaped. Sequences like \C or \A are invalid JSON escapes, so the entire arguments object fails to parse and the tool never runs.
Captured error (SendUserFile, 2026-08-16)
InputValidationError: SendUserFile was called with input that could not be
parsed as JSON.
You sent (first 181 of 181 bytes):
{"files": E:\Chat gpt Codex\Angels sword\Claude-Voice-Input-Bug-Report.md,
"caption": "…", "status": "normal"}
Common causes: unescaped backslashes in file paths (use / or \\),
unescaped control characters, or truncated output. Retry with valid JSON.
Two defects visible in that emitted payload:
- Unescaped backslashes — the path contains
\C,\A, which are not valid JSON string escapes. - The path value wasn't wrapped as a quoted array element —
"files": <bare path>instead of"files": ["E:/…"]— suggesting the argument serializer mishandles the whole value once a backslash path is involved.
Why it happens
JSON permits only a fixed set of escapes after a backslash (\", \\, \/, \b, \f, \n, \r, \t, \uXXXX). A raw Windows path such as E:\Chat\Angels contains invalid escapes, so a strict parser rejects the whole arguments object — not just the one field. Windows-only; POSIX forward-slash paths never trigger it.
Repro
- On Windows, drive any flow where the model passes a single-backslash absolute path as a tool argument (file send/read/write/attach).
- The tool call fails with "could not be parsed as JSON / unescaped backslashes."
- The same call with forward slashes (
E:/Folder/file.md) or doubled backslashes succeeds.
Occurs whenever a single-backslash path lands in tool arguments; appears intermittent only because the model often happens to use forward slashes.
Impact
- Tool call lost; at least one wasted turn per occurrence.
- The agent can misread the failure, retry incorrectly, or abandon the action.
- Disproportionately hits Windows users on paths that are perfectly valid on the OS.
Requested fix (serializer side — durable)
- JSON-escape string argument values automatically when building tool-call payloads (backslashes →
\\, quotes, control chars), rather than relying on the model to pre-sanitize paths. - Fail soft: on a parse failure caused by lone backslashes, attempt one automatic repair (escape them) and log it, instead of dropping the call.
- Normalize Windows paths at the tool boundary (accept
\,\\, and/interchangeably).
Environment
Windows 11 Pro 26200 · Claude Code desktop 1.30096.5.0 · observed 2026-08-16 on SendUserFile; defect is general to any tool receiving a Windows path argument.