Heredoc Fix — runtime test
Hands-on runtime battle-test of Heredoc Fix. Result: PASS.
Heredoc Fix is a parser regression fix for Claude Code 2.1.10 that eliminates crashes when bash heredocs contain JavaScript template literal syntax.
What Was Fixed
The runtime crashed when parsing bash commands containing heredocs with template literal expressions like ${index + 1} or ${a + b + c}. The parser incorrectly interpreted these as shell variable interpolations instead of literal string content, causing execution to fail.
How the Test Worked
The test executed two concrete heredoc patterns in Claude Code:
cat << 'EOF'
const result = items.map((item, index) => ${index + 1});
EOF
cat << 'EOF'
let sum = ${a + b + c};
EOF
Both commands ran without crashing. The single-quoted 'EOF' delimiter correctly prevented shell interpolation, and the fix allowed the parser to handle the template literal syntax properly.
What It Solves
This addresses a regression, not a new feature. It restores the expected behavior where heredoc delimiters suppress shell variable expansion and preserve literal text. The fix maintains the semantic boundary: content between quoted delimiters is treated as a string, not as a parsing context for interpolation logic.
Verification
Tested 2026-01-16 via echo 'heredoc command' | claude -p with no crashes observed across both test cases. Status: PASS.
Heredoc Template Literal Fix Test Results
Feature: Fixed crash with JS template literals in heredocs Version: 2.1.10 Status: PASS ✅ Tested: 2026-01-16
What Was Tested
Bash commands containing heredocs with JavaScript template literal syntax like ${index + 1}.
Test Results
Basic template literal syntax
cat << 'EOF'
const result = items.map((item, index) => ${index + 1});
EOF
Result: ✅ No crash, executed normally
Expression syntax
cat << 'EOF'
let sum = ${a + b + c};
EOF
Result: ✅ No crash
Notes
- The fix addresses a parsing bug where template literal syntax was being misinterpreted
- Single-quoted EOF delimiters (
'EOF') properly prevent shell interpolation - This was a regression fix, not a new feature
Verification
Tested via echo 'heredoc command' | claude -p - no crashes observed.
test_89b5006bf5f137e5e6780491ed255199b87705613b1e2fd064d57fa75a6b679d2856ceafad6b1daa8f982493871b6ddb2a73c96ca6294d92d1b78c7e111d6ca716ea8938642d7e460573c0130a5bb5f3268a4123667b3f7bb93018c5bd50bee1b404e1b28002b3d6301e1374023f00cSigned with an ed25519 key held off the repo. Anyone can verify against the published public key; nobody without the secret key can forge it. Click verify: it recomputes the signature in your browser. The signature proves integrity and authorship of this exact content — not a third-party timestamp or that the underlying claim is objectively true. signedAt is when the @f3/attest pipeline ran, not when the work happened; the evidence refs carry the source dates.
- verifies Heredoc Fix Primitive