[BUG] Unable to set long system prompt using `--system-prompt` on Windows Native

Resolved 💬 5 comments Opened Jul 12, 2025 by blouflashdb Closed Jul 17, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.51 (Claude Code)
  • Operating System: Windows 11
  • Terminal: pwsh

Bug Description

The claude command, along with a massive --system-prompt argument, exceeds the character limit for a single command that can be passed to the underlying CreateProcess API in Windows, which is typically 8,191 characters.

Steps to Reproduce

  1. Create a long system prompt
  2. Run: ``claude -p "Build a REST API" --system-prompt "Your very long system prompt"``

Expected Behavior

Claude code is able to read the system prompt from a file. For example by implementing a --system-prompt-file cli argument

Actual Behavior

Command failed with ENAMETOOLONG: claude -p --system-prompt "You are Kilo Code, ..." --verbose --output-format stream-json --disallowedTools "Task,Bash,Glob,Grep,LS,exit_plan_mode,Read,Edit,MultiEdit,Write,NotebookRead,NotebookEdit,WebFetch,TodoRead,TodoWrite,WebSearch" --max-turns 1 --model claude-sonnet-4-20250514
spawn ENAMETOOLONG

Additional Context

Discovered using Kilocode with the Claude Code Provider on Windows Native.

View original on GitHub ↗

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