Windows Batch Shim in Claude Code npm Install Silently Truncated Multi-line Prompts
A developer running AI agent evaluations on Windows 11 discovered that Claude Code, installed globally via npm, uses a batch file wrapper (claude.CMD) that silently drops everything after the first newline in a prompt passed through Python's subprocess. This caused an agent benchmark score to collapse from 21 out of 24 tasks to just 3 out of 24, with no error or warning indicating data loss. The root cause was traced to the .CMD shim using %* for argument forwarding via cmd.exe, which appears to lose newline characters during the process. Two workarounds were identified: directly invoking the underlying claude.exe binary instead of relying on shutil.which(), or flattening multi-line prompts into a single line before passing them. The findings were reproducible with a minimal Python script and measured between August 14–16, 2026.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in