claude-code - 💡(How to fix) Fix `Unhandled node type: pipeline` when piping a heredoc into a command [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56019Fetched 2026-05-05 06:00:18
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1

Piping a heredoc directly into a command (cat <<'EOF' | cmd) triggers Unhandled node type: pipeline on the confirmation prompt. The semantically equivalent redirect form (cmd < file) does not trigger.

Error Message

(cmd < file) passes without error.

Root Cause

Piping a heredoc directly into a command (cat <<'EOF' | cmd) triggers Unhandled node type: pipeline on the confirmation prompt. The semantically equivalent redirect form (cmd < file) does not trigger.

Fix Action

Fix / Workaround

# Workaround -- write to a file first, then redirect (no pipeline node):
printf 'hello world\n' > /tmp/repro_input.txt
cat < /tmp/repro_input.txt

Related: #47701 (closed, framed around file_redirect). That report mentions several missing node type handlers. The pipeline failure from heredoc-pipe appears to be a distinct case: the parser fails at the pipeline node rather than at a redirect node, and the < file workaround works, suggesting the two code paths are separate.

Code Example

# Triggers "Unhandled node type: pipeline":
cat <<'EOF' | cat
hello world
EOF

---

# Workaround -- write to a file first, then redirect (no pipeline node):
printf 'hello world\n' > /tmp/repro_input.txt
cat < /tmp/repro_input.txt
RAW_BUFFERClick to expand / collapse

Summary

Piping a heredoc directly into a command (cat <<'EOF' | cmd) triggers Unhandled node type: pipeline on the confirmation prompt. The semantically equivalent redirect form (cmd < file) does not trigger.

Reproduction

# Triggers "Unhandled node type: pipeline":
cat <<'EOF' | cat
hello world
EOF
# Workaround -- write to a file first, then redirect (no pipeline node):
printf 'hello world\n' > /tmp/repro_input.txt
cat < /tmp/repro_input.txt

Expected: the heredoc-pipe pattern is a common shell idiom; it should parse consistently with the redirect form, or at least produce a specific prompt that describes the unsupported construct.

Observed: cat <<'EOF' | cmd triggers Unhandled node type: pipeline. The redirect form (cmd < file) passes without error.

Notes

Related: #47701 (closed, framed around file_redirect). That report mentions several missing node type handlers. The pipeline failure from heredoc-pipe appears to be a distinct case: the parser fails at the pipeline node rather than at a redirect node, and the < file workaround works, suggesting the two code paths are separate.

Environment

  • claude-code version: 2.1.118
  • OS: macOS 26.4.1
  • Shell: /bin/zsh
  • Notes: heavy use of git worktrees and multiple language toolchains

extent analysis

TL;DR

The issue can be worked around by writing the heredoc to a file first and then redirecting it to the command, instead of piping it directly.

Guidance

  • The error Unhandled node type: pipeline suggests that the parser is failing to handle the pipeline node in the heredoc-pipe pattern.
  • The fact that the redirect form (cmd < file) works without error implies that the issue is specific to the pipeline node.
  • To verify the workaround, try writing the heredoc to a file and then redirecting it to the command, as shown in the reproduction steps.
  • The related issue #47701 may provide additional context, but it appears to be a distinct case.

Example

printf 'hello world\n' > /tmp/repro_input.txt
cat < /tmp/repro_input.txt

Notes

The root cause of the issue is unclear, but it appears to be related to the parser's handling of pipeline nodes. The workaround provided in the reproduction steps should mitigate the issue, but a more permanent fix may require changes to the parser.

Recommendation

Apply workaround: writing the heredoc to a file first and then redirecting it to the command, as this has been shown to work in the reproduction steps.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix `Unhandled node type: pipeline` when piping a heredoc into a command [1 comments, 2 participants]