claude-code - 💡(How to fix) Fix 权限确认弹窗渲染超长命令导致终端卡死 [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#49068Fetched 2026-04-17 08:51:49
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1
RAW_BUFFERClick to expand / collapse

Bug Description

When a sub-agent executes a Bash command with very large content (e.g., a Python script that writes an entire HTML file inline), the permission confirmation popup renders the full command text in the terminal. This causes the terminal to freeze/become unresponsive — the user cannot scroll, confirm, or dismiss the dialog.

Steps to Reproduce

  1. Launch a sub-agent that generates a large file (e.g., an HTML file with ~500+ lines)
  2. The agent uses a Bash command like python3 << 'PYEOF' ... PYEOF with the entire file content inline
  3. The permission popup appears, rendering all content
  4. Terminal becomes unresponsive / extremely laggy

Expected Behavior

  • Long commands should be truncated in the permission preview (e.g., show first 50-100 lines with a "... truncated" indicator)
  • Or show a summary (e.g., "Run python3 script (2847 chars)") with an option to expand

Actual Behavior

The full command is rendered in the permission popup, freezing the terminal. User has to press Esc (if responsive) or Ctrl+C to recover.

Environment

  • macOS
  • Claude Code (latest)

Screenshot

The permission popup rendering thousands of characters of inline HTML/Python code, making the terminal unusable.

extent analysis

TL;DR

Truncating the command text in the permission confirmation popup or displaying a summary with an expand option may resolve the terminal freezing issue.

Guidance

  • Investigate the Claude Code configuration to see if there's an option to truncate long commands in the permission preview.
  • Consider modifying the sub-agent to write the large file content to a temporary file instead of passing it inline, reducing the command length.
  • Review the Bash command syntax to determine if there's a way to limit the output or redirect it to prevent the terminal from freezing.
  • Test the behavior with smaller command lengths to determine the threshold at which the terminal becomes unresponsive.

Example

No code snippet is provided as the issue is more related to the behavior of the Claude Code and terminal rather than a specific code error.

Notes

The solution may depend on the specific version of Claude Code and the terminal emulator being used. The provided guidance is based on the information given and may not be applicable in all scenarios.

Recommendation

Apply a workaround, such as writing the large file content to a temporary file, as it seems to be a more feasible and immediate solution to prevent the terminal from freezing.

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