[BUG] Missing Type Definition in Official TS SDK
Resolved 💬 7 comments Opened Jun 12, 2025 by brian-lou Closed Dec 16, 2025
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.21
- Operating System: macOS 15.5
- Terminal: zsh
Bug Description
The Typescript SDK: @anthropic-ai/claude-code does not export types
Steps to Reproduce
Try to use:
import { query, type SDKMessage } from '@anthropic-ai/claude-code';
Expected Behavior
No errors
Actual Behavior
Typescript is unable to resolve the correct type and errors with:
Could not find a declaration file for module '@anthropic-ai/claude-code'. '/Users/brian/gt/gt-libraries/node_modules/@anthropic-ai/claude-code/sdk.mjs' implicitly has an 'any' type.
Additional Context
Adding
"types": "sdk.d.ts",
to the package.json fixes the issue
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗