[DOCS] Missing cross-platform usage instructions for `--json-schema` in CLI Reference
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/cli-reference
Section/Topic
The CLI flags table, specifically the entry for --json-schema.
Current Documentation
The documentation provides the following example for the --json-schema flag:
claude -p --json-schema '{"type":"object","properties":{...}}' "query"
What's Wrong or Missing?
The provided example uses single quotes (') to wrap the JSON string. While this syntax works correctly in Bash environments (macOS, Linux, WSL), it fails in the standard Windows Command Prompt (cmd.exe) and often behaves unexpectedly in PowerShell.
Windows cmd.exe does not recognize single quotes as string delimiters. Users attempting to run the example command exactly as written on Windows will encounter syntax errors or argument parsing failures, potentially causing confusion without a disclaimer or a platform-specific alternative.
Suggested Improvement
Please add a note or a toggle/tab for Windows users regarding quoting rules for JSON arguments.
Suggested addition:
Note for Windows Users: When using Command Prompt (cmd.exe), single quotes are not supported. You must use double quotes around the JSON string and escape internal double quotes with backslashes. Windows Example: ``cmd claude -p --json-schema "{\"type\":\"object\",\"properties\":{...}}" "query" ``
Impact
High - Prevents users from using a feature
Additional Context
In Windows cmd.exe:
- Arguments must be enclosed in double quotes (
"). - Literal double quotes inside the string must be escaped (usually
\").
Providing only the Bash syntax assumes a specific shell environment that excludes a significant portion of Windows users running the tool natively.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗