Claude Agent SDK for TypeScript 0.3
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
5prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 746 lines · 1.5K tokens
- Anthropic SDK for TypeScript 0.12262 lines · 1.5K tokens
- Claude Agent SDK for TypeScript 0.354 lines · 1.7K tokens
Total365 lines · 13.1K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 95
- 113
- 116
- 117
- 200
- 208
- 209
- 214
- 250
- 295
- 297
- 319
- 321
- 323
- 330
- 338
- 346
- 347
- 352
- 354
- 362
- 367
- 377
- 426
- 444
- 459
- 471
- 488
- 494
- 502
- 522
- 524
- 532
- 602
- 639
- 653
- 732
- 754
- 770
- 807
- 829
- 838
- 841
- 862
- 863
- 908
- 915
- 916
- 918
- 922
- 942
- 943
- 1004
- 1321
- 1333
- 1427
Prompt Preview
Apply the Anthropic SDK for TypeScript 0.122, Node.js 24, and TypeScript 7 prompts first. These rules cover Claude Agent SDK for TypeScript 0.3 sessions, tools, permissions, hooks, MCP, resume state, and deployment.
Sessions and queries
- Build
Options.systemPrompt,model,cwd,tools,allowedTools, and environment overrides from trusted policy, never directly from query text. - Set both
maxTurnsandmaxBudgetUsd; 0.3 leaves them optional, so an omitted limit is not a usable application budget. - Treat every
SDKMessagevariant separately and reject a run unless its result hassubtype: 'success',is_error: false, andterminal_reason: 'completed'when present, within the configured limits. - Store returned session IDs under the authenticated principal and verify that binding before supplying
resumeorforkSession. - Reapply current authorization after resume; serialized messages and tool results are context, not proof that an earlier permission still holds.
Permission model
- Choose
permissionModein trusted code; never let a request selectacceptEdits,bypassPermissions, or another more-permissive mode. - Never set
allowDangerouslySkipPermissions: truein a general-purpose service; also rejectpermissionMode: 'bypassPermissions'explicitly instead of relying on the flag's default. - Use
dontAskfor non-interactive workers only with a complete allow policy: otherwise actions that would prompt are denied, whiledefaultmay prompt andacceptEditsauto-accepts edits. - Implement
canUseToolas fail-closed authorization over