claude-agent-sdk-python icon indicating copy to clipboard operation
claude-agent-sdk-python copied to clipboard

v0.1.0 breaking change not implemented: `system_prompt` still defaults to Claude Code preset

Open yokomotod opened this issue 3 months ago • 0 comments

Issue

The v0.1.0 migration guide states:

"The SDK no longer uses Claude Code's system prompt by default."

However, this breaking change is not implemented.

Current Implementation

In subprocess_cli.py lines 99-110, when system_prompt=None (the default):

if self._options.system_prompt is None:
    pass

The SDK passes no --system-prompt argument to the Claude CLI, which means the CLI uses its own default behavior.

This results in system_prompt=None behaving identically to system_prompt={"type": "preset", "preset": "claude_code"} - both use the Claude Code system prompt, contradicting the migration guide's statement that the default changed.

Expected Behavior

To enforce the breaking change, the SDK should explicitly pass an empty system prompt:

if self._options.system_prompt is None:
    cmd.extend(["--system-prompt", ""])

References

  • https://docs.claude.com/ja/docs/claude-code/sdk/migration-guide
  • https://github.com/anthropics/claude-agent-sdk-python/blob/v0.1.5/CHANGELOG.md#system-prompt-changes
  • PR #183
  • Code: subprocess_cli.py lines 99-110

Environment

  • SDK version: 0.1.5

yokomotod avatar Oct 27 '25 10:10 yokomotod