Skip to content

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

@blouflashdb

Description

@blouflashdb

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requesthas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on Windows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions