Randomlydropsspaceswhen generating tool-call arguments(v2.1.233)

Status Open
Reported on v2.1.233
Maintainer reply None cached
Activity 0 comments · opened Aug 16, 2026

Bugreport: Claude Code randomlydropsspaces when generating tool-call arguments

Environment

  • Claude Code version: 2.1.233
  • OS: macOS

-Shell: zsh

Symptom

Duringa sessioninvolving repeatedfile edits andshellcommand construction,
generated text intermittently loses a spacecharacter.This is not a terminal
rendering artifact— the missing space ispresent inthe actual command/argument
textpassed to tools, causing shell errors.

Concrete evidence from one session(session id: 1e41fd2d-191e-45cb-936d-da9b0ef19a2b)

  1. Intended: echo 'importquant.research'

Actual (executed): echoimportquant.research
Result: command not found: echoimport quant.research

  1. Intended: rm -f /tmp/sector_ic_check.py

Actual (executed): rm -f/tmp/sector_ic_check.py
Result: rm: illegal option -- /

  1. Reproduced again live ina follow-upsession:

Intended: claude--version
Actual (executed): claude--version
Result: command not found: claude--version

##Patternobserved
-Happens specificallyat the boundary between two tokens where a space is the
only separator (e.g. echo + import..., -f+ /tmp/...,claude + --version).

  • Occurred during long/complexgenerationturns(multiple chained Edit tool

failures before fallingback toBash-based fileconstruction), suggesting it
maycorrelate withlongergenerationsor degraded-modefallbackpaths, but
also reproduced ina short, simpleone-line command.

  • Workaroundfound effective: base64-encoding command strings (whichcontain no

literal spaces)beforedecodingand executing,sidesteps the bug entirely.

##Impact
Silent corruption ofgenerated shell commands / filecontent, causing confusing
downstream errorsthatlook like user/environment issues rather than a
generation bug. Wasted several turns before the pattern wasidentified.

Request

Pleaseinvestigatespace-dropping in token generation/streaming fortool-call
argumentconstruction, particularly atword-boundarytokenization edges.

View original on GitHub ↗