[BUG] `claude --remote` misparses prompts starting with `--` as CLI options

Resolved 💬 1 comment Opened Apr 19, 2026 by ftnext Closed May 26, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

claude --remote appears to treat prompt text starting with -- as a CLI option instead of prompt content.

For example, this works:

claude --remote "こんにちは"

It creates a remote session successfully.

But this fails:

claude --remote "--versionコマンドを実装してほしい"

with:

error: unknown option '--versionコマンドを実装してほしい'

This suggests that the value passed to --remote is being parsed again as command-line options when it begins with - or --.

What Should Happen?

A remote session should be created with the full prompt preserved.
The argument passed to --remote should always be treated as prompt text, even if it starts with - or --.

Error Messages/Logs

error: unknown option '--versionコマンドを実装してほしい'

Steps to Reproduce

  1. Run:

``bash
claude --remote "こんにちは"
``

  1. Confirm that a remote session is created successfully.
  2. Run:

``bash
claude --remote "--versionコマンドを実装してほしい"
``

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.114

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

This looks related to the general class of prompt/argument parsing bugs where user input starting with - is interpreted as CLI flags.

Possibly related:

  • #3844

It may need the equivalent of an option terminator (--) internally before handing prompt text to the relevant parser.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗