Answer: Pass a `canUseTool` callback in your query options; it fires when Claude wants to use a tool that nothing earlier in the permission flow has approved, and your callback receives `toolName`, `input`, and `options` (TS) / `context` (Python) so you can display the request to the user and return an allow or deny response. Status: Confirmed Entry: tool/claude-code/agents-and-automation/handle-tool-approval-requests Revision: 2 Digest: sha256:86ecbbbc090b1470 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:03:09Z Last changed: 2026-11-20T12:17:44Z (deny result: — → PermissionResultDeny) Last verified: 2026-11-20T12:17:44Z Next check: 2026-11-21T12:17:44Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of callback | canUseTool | [1] | 2026-11-20 arguments | toolName | [1] | 2026-11-20 input argument | input | [1] | 2026-11-20 context argument | options | [1] | 2026-11-20 allow result | PermissionResultAllow | [1] | 2026-11-20 deny result | PermissionResultDeny | [1] | 2026-11-20 Sources: [1] Anthropic. "Handle approvals and user input". https://code.claude.com/docs/en/agent-sdk/user-input.md Role: primary. Accessed: 2026-11-20T12:17:44Z Quote: "Once you've passed a `canUseTool` callback in your query options, it fires when Claude wants to use a tool" (Supports: callback) Quote: "Your callback receives three arguments: | Argument | Description | | - | - | | `toolName" (Supports: arguments) Quote: "| `input` | The parameters Claude is passing to the tool. Contents vary by tool. |" (Supports: input argument) Quote: "| `options` (TS) / `context` (Python) | Additional context including optional `suggestions`" (Supports: context argument) Quote: "return PermissionResultAllow(updated_input=input_data)" (Supports: allow result) Quote: "return PermissionResultDeny(message="User denied this action")" (Supports: deny result) Published: 2026-11-20T10:36:09Z Snapshot SHA-256: 50a580fade961f7d832dab7a75b3e86418492b184e6773b148448ba5bcdba1fe (captured 2026-11-20T12:17:44Z) 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:44Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:17:44Z Last attempt: 2026-11-20T12:17:44Z Notes and limitations: Extracted automatically from a single official source (section "Handle tool approval requests"). Related: https://latestn.com/tool/claude-code/agents-and-automation/hook-exit-codes What exit codes do Claude Code hooks use and what does exit code 2 do? https://latestn.com/tool/claude-code/agents-and-automation/hook-matcher-patterns How do matcher patterns work for Claude Code hooks, including matching MCP tools? https://latestn.com/tool/claude-code/agents-and-automation/isolate-subagents-worktrees How do I isolate subagents in separate worktrees in Claude Code? https://latestn.com/tool/claude-code/agents-and-automation/free-text-input-responses How do I support free-text input for Claude Code clarifying question responses? https://latestn.com/tool/claude-code/agents-and-automation/goal-evaluation How does Claude Code evaluate whether a goal is met, and what happens when a turn fails? https://latestn.com/tool/claude-code/agents-and-automation/handle-clarifying-questions How do I present Claude Code's clarifying questions and return the user's answers to the SDK? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:17:44Z | changed | deny result: — → PermissionResultDeny | [1] 2026-11-20T12:17:44Z | changed | allow result: — → PermissionResultAllow | [1] 2026-11-20T12:17:44Z | changed | context argument: — → options | [1] 2026-11-20T12:17:44Z | changed | input argument: — → input | [1] 2026-11-20T12:17:44Z | changed | arguments: — → toolName | [1] 2026-11-20T12:17:44Z | changed | callback: — → canUseTool | [1] 2026-11-20T12:17:44Z | changed | Deny result: PermissionResultDeny → — | [1] 2026-11-20T12:17:44Z | changed | Allow result: PermissionResultAllow → — | [1] 2026-11-20T12:17:44Z | changed | Argument 3: options → — | [1] 2026-11-20T12:17:44Z | changed | Argument 2: input → — | [1] 2026-11-20T12:17:44Z | changed | Argument 1: toolName → — | [1] 2026-11-20T12:17:44Z | changed | Number of arguments: three → — | [1] 2026-11-20T12:17:44Z | changed | Callback: canUseTool → — | [1] 2026-11-13T03:03:09Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/handle-tool-approval-requests/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/handle-tool-approval-requests POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/handle-tool-approval-requests with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/handle-tool-approval-requests?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I handle tool approval requests from Claude Code in my SDK application? Revision 2, last verified 2026-11-20T12:17:44Z. https://latestn.com/tool/claude-code/agents-and-automation/handle-tool-approval-requests (accessed 2026-11-21T10:06:08Z). @misc{LatestN_tool_claude_code_agents_and_automation_handle_tool_approval_requests_r2, title = {How do I handle tool approval requests from Claude Code in my SDK application?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/handle-tool-approval-requests}}, note = {Revision 2; digest sha256:86ecbbbc090b1470; last verified 2026-11-20T12:17:44Z; accessed 2026-11-21T10:06:08Z} } 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/handle-tool-approval-requests