systemPrompt: { type: "preset", preset: "claude_code" } returns HTTP 500 since SDK 0.2.84
Resolved 💬 1 comment Opened Apr 13, 2026 by nicolasnoble Closed May 25, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Passing systemPrompt: { type: "preset", preset: "claude_code", append: "..." } to the Agent SDK's query() triggers a server-side HTTP 500 on every SDK version from 0.2.84 through 0.2.104. The same call works on 0.2.83.
The error response is:
{"type":"error","error":{"type":"api_error","message":"Internal server error"}}
The default path (omitting systemPrompt entirely) still loads the full Claude Code prompt and works fine. Custom string system prompts also work fine. Only the explicit preset option is broken.
Steps to Reproduce
- Install
@anthropic-ai/claude-agent-sdk>= 0.2.84 - Call
query()withsystemPrompt: { type: "preset", preset: "claude_code", append: "some text" } - Every request returns HTTP 500
Workaround
Omit the systemPrompt option entirely (uses the default Claude Code prompt) and inject custom content via a <system-reminder> block in the first user message instead.
Environment
- SDK: tested 0.2.84, 0.2.104 (broken), 0.2.83 (works)
- OS: Linux
- Node: v24.12.0
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗