Answer: To migrate from the removed V2 session API, use the `query()` API and the session options it accepts: pass an `AsyncIterable` for multi-turn conversations, or use `options.resume` to continue a saved session. Status: Confirmed Entry: tool/claude-code/integrations/migrate-v2-session-to-query-api Revision: 1 Digest: sha256:630c642ef93219d6 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:03:07Z Last changed: 2026-11-13T03:03:07Z Last verified: 2026-11-20T12:17:39Z Next check: 2026-11-21T12:17:39Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of migration API | query() | [1] | 2026-11-20 multi-turn input | AsyncIterable | [1] | 2026-11-20 resume option | options.resume | [1] | 2026-11-20 removal version | 0.3.142 | [1] | 2026-11-20 last V2-compatible version | 0.2.x | [1] | 2026-11-20 Sources: [1] Anthropic. "TypeScript SDK V2 session API (removed)". https://code.claude.com/docs/en/agent-sdk/typescript-v2-preview.md Role: primary. Accessed: 2026-11-20T12:17:39Z Quote: "To migrate, use the [`query()` API](https://code.claude.com/docs/en/agent-sdk/typescript) and the [session options]" (Supports: migration API) Quote: "Pass an `AsyncIterable` for multi-turn conversations" (Supports: multi-turn input) Quote: "or `options.resume` to continue a saved session" (Supports: resume option) Quote: "TypeScript Agent SDK 0.3.142 removes `unstable_v2_createSession`, `unstable_v2_resumeSession`, `unstable_v2_prompt`, and the `SDKSession` and `SDKSessionOptions` types." (Supports: removal version) Quote: "Agent SDK 0.2.x is the last version that includes the V2 interface." (Supports: last V2-compatible version) Published: 2026-11-20T10:36:10Z Snapshot SHA-256: 85c0e2f72d5e22d75c0d5e93e66f1262306de4b835fdaaab6ea6f667d9b15d82 (captured 2026-11-13T03:03:07Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:03:07Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:17:39Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:17:39Z Last attempt: 2026-11-20T12:17:39Z Notes and limitations: Extracted automatically from a single official source (section "TypeScript SDK V2 session API (removed)"). Related: https://latestn.com/tool/claude-code/integrations/package-name-changes What package names changed when Claude Code SDK was renamed to Claude Agent SDK? https://latestn.com/tool/claude-code/integrations/pipe-claude-into-scripts How do I pipe Claude Code into scripts for automation? https://latestn.com/tool/claude-code/integrations/plugin-source-types What plugin source types can I use in a Claude Code marketplace.json? https://latestn.com/tool/claude-code/integrations/mcp-transport-types What transport types does Claude Code Agent SDK support for MCP servers (stdio, HTTP/SSE, SDK MCP)? https://latestn.com/tool/claude-code/integrations/migrate-python-project How do I migrate a Python project from the Claude Code SDK to the Claude Agent SDK? https://latestn.com/tool/claude-code/integrations/migrate-typescript-project How do I migrate a TypeScript or JavaScript project from the Claude Code SDK to the Claude Agent SDK? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:03:07Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/integrations/migrate-v2-session-to-query-api/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/integrations/migrate-v2-session-to-query-api POST: https://latestn.com/dispute/tool/claude-code/integrations/migrate-v2-session-to-query-api with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/integrations/migrate-v2-session-to-query-api?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I migrate Claude Code code from the removed V2 session API to the query() API for multi-turn conversations? Revision 1, last verified 2026-11-20T12:17:39Z. https://latestn.com/tool/claude-code/integrations/migrate-v2-session-to-query-api (accessed 2026-11-21T09:59:26Z). @misc{LatestN_tool_claude_code_integrations_migrate_v2_session_to_query_api_r1, title = {How do I migrate Claude Code code from the removed V2 session API to the query() API for multi-turn conversations?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/integrations/migrate-v2-session-to-query-api}}, note = {Revision 1; digest sha256:630c642ef93219d6; last verified 2026-11-20T12:17:39Z; accessed 2026-11-21T09:59:26Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/integrations/migrate-v2-session-to-query-api