Skip to content

Agent Mode fails to create files with heredoc syntax - quote escaping issues #7735

@rifatdinc

Description

@rifatdinc

Pre-submit Checks

Describe the bug

Image

To reproduce

I'm experiencing a persistent issue with Warp Agent Mode when attempting to create files using heredoc syntax (cat > file << 'EOF' or similar). The agent consistently fails with exit code 130, suggesting the commands are being improperly escaped or interrupted.

Issue Details

When the agent attempts to create files using any heredoc syntax, the command fails with exit code 130. The system reports:

{"output":{"command":"cat > /tmp/file.sh << 'EOF'…","note_from_user":"Actually, I decided to run the following command: cat > /tmp/file.sh << 'EOF'…. I manually edited it, so don't try to rerun your original command from before the edit.","output":"","exit_code":130,"new_pwd":"/home/ubuntu"}}

Reproduction Steps

  1. Ask Agent Mode to create a bash script file
  2. Agent attempts to use heredoc syntax like:

cat > /tmp/script.sh << 'EOF' #!/bin/bash echo "test" EOF

Attempted Solutions

The agent has tried multiple approaches, all failing:
• ✗ cat > file << 'EOF'
• ✗ cat > file << EOF (without quotes)
• ✗ sudo tee file > /dev/null << 'EOF'
• ✓ printf 'content' | sudo tee file (workaround - works)
• ✓ Direct file creation with nano or vim (manual workaround)
• Warp Version: v0.2025.10.08.08.12.stable_03
• OS: Ubuntu (Linux)
• Shell: bash 5.2.21(1)-release
• Agent Model: claude 4.5 sonnet

Expected behavior

Expected Behavior

Heredoc syntax should work properly for creating multi-line files, as it's a standard bash feature that works when executed manually in the terminal.

Screenshots, videos, and logs

Attempted Solutions

The agent has tried multiple approaches, all failing:
• ✗ cat > file << 'EOF'
• ✗ cat > file << EOF (without quotes)
• ✗ sudo tee file > /dev/null << 'EOF'
• ✓ printf 'content' | sudo tee file (workaround - works)
• ✓ Direct file creation with nano or vim (manual workaround)

Operating system (OS)

Select an OS

Operating system and version

26.0.1

Shell Version

No response

Current Warp version

v0.2025.10.08.08.12.stable_03

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

No

Is this an issue only in Warp?

Yes, I confirmed that this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGBugs, Hangs, Crash, and Freezes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions