[BUG] Claude Code SDK Docs for TS incorrect/outdated parameters

Resolved 💬 4 comments Opened Aug 23, 2025 by brock-statsig Closed Jan 29, 2026

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

  1. npm init -y
  2. npm install -g @anthropic-ai/claude-code
  3. create a new .ts file and copy the code listed here: https://docs.anthropic.com/en/docs/claude-code/sdk#quick-start
  4. 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 😄

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗