Skip to content

Comments

Add SystemPromptFile support for --system-prompt-file CLI flag#591

Open
ronmrdechai wants to merge 1 commit intoanthropics:mainfrom
ronmrdechai:add-system-prompt-file-support
Open

Add SystemPromptFile support for --system-prompt-file CLI flag#591
ronmrdechai wants to merge 1 commit intoanthropics:mainfrom
ronmrdechai:add-system-prompt-file-support

Conversation

@ronmrdechai
Copy link
Contributor

@ronmrdechai ronmrdechai commented Feb 19, 2026

I'm trying to pass a really big system prompt to Claude and it fails on an ARGMAX error. This change exposes --system-prompt-file to the SDK.

Summary

  • Add SystemPromptFile TypedDict with type: "file" and path fields to types.py
  • Add SystemPromptFile to the system_prompt union type on ClaudeAgentOptions
  • Handle the new type in subprocess_cli.py by passing --system-prompt-file <path> to the CLI
  • Add test coverage in both test_types.py and test_transport.py

Test plan

  • test_claude_code_options_with_system_prompt_file — verifies ClaudeAgentOptions accepts and stores a SystemPromptFile dict
  • test_build_command_with_system_prompt_file — verifies the command builder emits --system-prompt-file with the path, and does not emit --system-prompt or --append-system-prompt
  • All existing tests in test_types.py and test_transport.py continue to pass

Allow users to specify a file path for the system prompt via a new
SystemPromptFile TypedDict, which passes --system-prompt-file to the CLI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant