Skip to content

[BUG] Backslash Handling Issues in CLI Commands #1195

Description

@Cheffromspace

Environment

  • Anthropic API
  • Shell: /usr/bin/zsh
  • OS: Ubuntu 24.04.2 LTS (Noble)
  • Git: version 2.43.0
  • Node: v23.10.0
  • Claude Code: 0.2.122
  • Windows Terminal via SSH

Description

Claude Code CLI has issues processing commands with backslashes as line continuations. The CLI appears to treat the backslash literally rather than as a line continuation character.

Reproduction Steps

  1. Run a multi-line command with backslashes for line continuation
  2. Example:
    git rm --cached \
    /path/to/file1 \
    /path/to/file2

Expected Behavior

Command should be interpreted as a single line with the backslashes properly handling line continuation.

Actual Behavior

Receiving error: fatal: pathspec '' did not match any files

The CLI interprets the backslash as a literal character rather than line continuation, causing the command to fail.

Logs

Bash(git rm --cached \
/home/jonflatt/n8n/claude-repo/test/test-debug-claude.sh \
...)
⎿ Error: fatal: pathspec '\' did not match any files

Working around by putting commands on a single line works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsautocloseIssue will be closed automaticallybugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions