Answer: Use Filesystem hooks (settings.json) for sharing hooks between CLI and SDK sessions, and Programmatic hooks (callbacks in query()) for application-specific logic, structured decisions, and in-process integration. Status: Confirmed Entry: tool/claude-code/agents-and-automation/choose-hook-type-sdk Revision: 1 Digest: sha256:06aae9e0fc4438e0 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:38Z Last changed: 2026-11-13T03:02:38Z Last verified: 2026-11-20T12:16:20Z Next check: 2026-11-21T12:16:20Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Filesystem hook use case | Sharing hooks between CLI and SDK sessions | [1] | 2026-11-20 Programmatic hook use case | Application-specific logic, structured decisions, and in-process integration | [1] | 2026-11-20 Programmatic hook input fields | agent_id | [1] | 2026-11-20 Sources: [1] Anthropic. "Use Claude Code features in the SDK". https://code.claude.com/docs/en/agent-sdk/claude-code-features.md Role: primary. Accessed: 2026-11-20T12:16:20Z Quote: "Sharing hooks between CLI and SDK sessions." (Supports: Filesystem hook use case) Quote: "Application-specific logic, structured decisions, and in-process integration." (Supports: Programmatic hook use case) Quote: "carries `agent_id` and `agent_type` fields that identify which agent fired the hook." (Supports: Programmatic hook input fields) Published: 2026-11-20T02:57:11Z Snapshot SHA-256: 8a7292acc99a8ea9e7c03ef0e2e6819e91ba9a5a62f23bb905d41282e51deacc (captured 2026-11-20T12:16:16Z) 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:16:20Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:16:20Z Last attempt: 2026-11-20T12:16:20Z Notes and limitations: Extracted automatically from a single official source (section "When to use which hook type"). Related: 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/claude-code/agents-and-automation/claudesdkclient-interrupts How do I interrupt a running Claude Code session with ClaudeSDKClient in Python? 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/check-running-agent-work How do I check on work that Claude Code agents are running in the background? https://latestn.com/tool/claude-code/agents-and-automation/choose-and-weight-graders What grader types exist for Claude Code plugin evals and how do I choose and weight graders? 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/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:02:38Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/choose-hook-type-sdk/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/choose-hook-type-sdk POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/choose-hook-type-sdk with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/choose-hook-type-sdk?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). When should I use which hook type in the Claude Code SDK? Revision 1, last verified 2026-11-20T12:16:20Z. https://latestn.com/tool/claude-code/agents-and-automation/choose-hook-type-sdk (accessed 2026-11-21T10:02:29Z). @misc{LatestN_tool_claude_code_agents_and_automation_choose_hook_type_sdk_r1, title = {When should I use which hook type in the Claude Code SDK?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/choose-hook-type-sdk}}, note = {Revision 1; digest sha256:06aae9e0fc4438e0; last verified 2026-11-20T12:16:20Z; accessed 2026-11-21T10:02:29Z} } 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/choose-hook-type-sdk