[BUG] Claude Code SDK Docs for TS incorrect/outdated parameters
Environment
- Platform (select one):
- [ ] Other: Claude Code TS SDK
- Claude CLI version: SDK version 1.0.89, latest as-of posting
- Operating System: macOS 14.6
- Terminal: In my case, Cursor
Bug Description
The default quickstart for the Claude Code TS SDK will currently trip some lint errors and not function as described
Steps to Reproduce
- npm init -y
- npm install -g @anthropic-ai/claude-code
- create a new .ts file and copy the code listed here: https://docs.anthropic.com/en/docs/claude-code/sdk#quick-start
- Node your-file-name.ts
Expected Behavior
No linter errors, system prompt included successfully
Actual Behavior
Object literal may only specify known properties, and 'systemPrompt' does not exist in type 'Options'.ts(2353)
Property 'result' does not exist on type 'SDKResultMessage'.
Fix:
Change line
systemPrompt: "You are a legal assistant. Identify risks and suggest improvements.",
To
. customSystemPrompt: "You are a legal assistant. Identify risks and suggest improvements. ",
And
if (message.type === "result") {
To
if (message.type === "result" && message.subtype === "success") {
Happy to open a PR on docs to fix this if there is somewhere I can do that 😄