Answer: Call `await client.interrupt()` on the ClaudeSDKClient to send a stop signal, then drain the interrupted task's messages with `receive_response()` before sending a new query. Status: Confirmed Entry: tool/claude-code/agents-and-automation/claudesdkclient-interrupts Revision: 1 Digest: sha256:572e2029c32ba1f4 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:54Z Last changed: 2026-11-13T03:02:54Z Last verified: 2026-11-20T12:17:05Z Next check: 2026-11-21T12:17:05Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of interrupt method | await client.interrupt() | [1] | 2026-11-20 drain method | receive_response() | [1] | 2026-11-20 terminal_reason values | aborted_streaming | [1] | 2026-11-20 Sources: [1] Anthropic. "Agent SDK reference - Python". https://code.claude.com/docs/en/agent-sdk/python.md Role: primary. Accessed: 2026-11-20T12:17:05Z Quote: "await client.interrupt()" (Supports: interrupt method) Quote: "You must drain them with `receive_response()` before reading the response to a new query." (Supports: drain method) Quote: "terminal_reason is "aborted_streaming" or "aborted_tools"" (Supports: terminal_reason values) Published: 2026-11-20T03:41:08Z Snapshot SHA-256: a658fde43f021fe438986ed2b6a6e539fe2f2baa74fce42d6db51ce979b01742 (captured 2026-11-20T12:17:04Z) 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]. Cross-check: not-available at 2026-11-20T12:17:05Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:17:05Z Last attempt: 2026-11-20T12:17:05Z Notes and limitations: Extracted automatically from a single official source (section "Example - Using interrupts"). Related: https://latestn.com/tool/claude-code/agents-and-automation/configure-hooks How do I configure hooks in Claude Code to intercept tool calls? https://latestn.com/tool/claude-code/agents-and-automation/configure-tool-search How do I configure tool search in Claude Code? https://latestn.com/tool/claude-code/agents-and-automation/continue-conversations How do I continue a conversation when running Claude Code programmatically? https://latestn.com/tool/claude-code/agents-and-automation/choose-display-mode How do I choose the display mode for my Claude Code agent team? https://latestn.com/tool/claude-code/agents-and-automation/choose-hook-type-sdk When should I use which hook type in the Claude Code SDK? https://latestn.com/tool/claude-code/agents-and-automation/claude-write-save-workflow How do I have Claude write and save a workflow in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:02:54Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/claudesdkclient-interrupts/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/agents-and-automation/claudesdkclient-interrupts POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/claudesdkclient-interrupts with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/claudesdkclient-interrupts?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I interrupt a running Claude Code session with ClaudeSDKClient in Python? Revision 1, last verified 2026-11-20T12:17:05Z. https://latestn.com/tool/claude-code/agents-and-automation/claudesdkclient-interrupts (accessed 2026-11-21T10:01:17Z). @misc{LatestN_tool_claude_code_agents_and_automation_claudesdkclient_interrupts_r1, title = {How do I interrupt a running Claude Code session with ClaudeSDKClient in Python?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/claudesdkclient-interrupts}}, note = {Revision 1; digest sha256:572e2029c32ba1f4; last verified 2026-11-20T12:17:05Z; accessed 2026-11-21T10:01:17Z} } 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/agents-and-automation/claudesdkclient-interrupts