[BUG] Backslash Handling Issues in CLI Commands

Resolved 💬 3 comments Opened May 20, 2025 by Cheffromspace Closed Jan 4, 2026

Environment

  • [x] 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:

``bash
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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗