[BUG] Token drift in parallel Write tool calls: repeated path prefix produces real-word substitution ("shane" → "seine")

Resolved 💬 5 comments Opened May 1, 2026 by ShaneK77 Closed Jun 16, 2026

Summary

When generating multiple parallel Write tool calls in a single response with identical path prefixes, the prefix drifted on the fifth instance, substituting seine for shane in the username segment (/Users/seine/... instead of /Users/shane/...). The write failed immediately due to a filesystem permission error, so no files were misplaced -- but in a permissive or sandboxed environment the failure would have been silent.

Reproduction Context

  • Task: Generating 5 parallel Write tool calls with paths of the form /Users/shane/documents/project/files/{filename}.md
  • Error occurred on: The fifth call in the batch
  • Calls 1-4: Correct (/Users/shane/...)
  • Call 5: Drifted (/Users/seine/...)

Observed Behavior

/Users/seine/documents/project/files/{filename}.md

Expected Behavior

/Users/shane/documents/project/files/{filename}.md

Forensic Notes

  • seine is a high-frequency real word (Paris river, fishing net type) with strong training data representation
  • The substitution is a minimal letter-level drift: shs, ae
  • No /Users/seine appeared anywhere in files read during the session -- the path was generated fresh each time, ruling out copy-contamination from context
  • The real-word landing likely suppresses self-correction that would catch a nonsense string
  • The shaneseine relationship is itself evidence: not random noise, but a minimal transformation of a low-frequency proper noun toward a high-frequency common word

Related Research

This appears to be an instance of the Repeated Token Phenomenon documented in arXiv:2503.08908 (ICML 2025): repeated identical token sequences cause abnormal attention marking on subsequent instances, producing amplification and divergence. Our case is substitution rather than repetition, but the same attention-sink mechanism is the likely cause.

Related Claude Code issue: #41176 (Khmer script degeneration to repeated "org" tokens -- different surface, same underlying dynamic).

Risk

In a sandboxed environment or one with open write permissions, this failure mode is invisible -- the file writes silently to the wrong location. The filesystem permission error was the only catch here. Repeated identical path generation across parallel tool calls is the specific risk surface.

Environment

  • Claude Code CLI
  • Model: claude-sonnet-4-6
  • Platform: macOS (darwin 25.3.0)

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗