{"name":"canUseTool","slug":"canusetool","family":"setting","title":"Settings keys","noun":"settings key","description":"Background and forked agents now run your permission callback even when a hook says allow, and deny rules win.","description_source":"entry","described_by":{"version":"2.1.222","anchor":"forked-and-background-agent-queries-require-canusetool-by-de"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.308","builds":0,"mined_builds":149,"first_cited":{"version":"2.1.119","released_at":"2026-04-23 21:36:46","spans":1}},"aliases":[],"entries":[{"version":"2.1.284","anchor":"agent-sdk-now-asks-the-cli-for-session-state-by-default-and","heading":"Agent SDK runs can keep going after the result while background work finishes","line":"The Agent SDK now ends a run when Claude Code reports it is idle, which can mean waiting up to 10 minutes after the result","released_at":"2026-09-28 17:11:59","reason":"found in this entry's text"},{"version":"2.1.281","anchor":"sdk-canusetool-receives-requiresuserinteraction-serverpromp","heading":"SDK canUseTool receives requiresUserInteraction, serverPrompt and computerFolder","line":"The SDK's canUseTool callback can now receive requiresUserInteraction, serverPrompt and computerFolder when a permission request carries them","released_at":"2026-09-23 17:01:17","reason":"found in this entry's text, named in this entry"},{"version":"2.1.281","anchor":"new-can-use-tool-fields-server-prompt-and-computer-folder-p","heading":"New can_use_tool fields server_prompt and computer_folder, passed through to the SDK host","line":"Permission requests sent to SDK hosts can carry two new internal fields, serverPrompt and computerFolder, set only by the session service","released_at":"2026-09-23 17:01:17","reason":"found in this entry's text, named in this entry"},{"version":"2.1.280","anchor":"sdkplugin-session-scope-gains-savedagentmessages-and-reques","heading":"SDK\/plugin session scope gains savedAgentMessages and requestMessages callbacks","line":"The SDK's internal session bridge gained savedAgentMessages and requestMessages callbacks","released_at":"2026-09-22 15:44:39","reason":"found in this entry's text"},{"version":"2.1.275","anchor":"session-teardown-leave-questions-standing-path-has-no-call","heading":"Session-teardown 'leave questions standing' path has no caller","line":"New leaveQuestionsStanding path rejects pending permission questions with a teardown message but nothing calls it yet","released_at":"2026-09-17 20:20:31","reason":"found in this entry's text"},{"version":"2.1.269","anchor":"sendmessage-cross-machine-permission-check-now-passes-a-deta","heading":"SendMessage cross-machine permission check now passes a detached ask callback","line":"SendMessage's cross-machine permission check now uses a detached approval callback instead of passing context and canUseTool directly","released_at":"2026-09-11 18:12:49","reason":"found in this entry's text"},{"version":"2.1.259","anchor":"permission-prompt-tool-routing-gets-a-bypass-for-an-explicit","heading":"Permission-prompt-tool routing gets a bypass for an explicit \"none\" sentinel","line":"A permission-prompt tool named none now routes through an ask-based fallback resolver instead of the MCP prompt tool.","released_at":"2026-09-02 21:21:42","reason":"found in this entry's text"},{"version":"2.1.223","anchor":"permission-denied-events-fire-even-without-a-permission-prom","heading":"permission_denied events fire even without a permission prompt","line":"Headless and SDK runs now report permission denials even when no prompt was ever shown.","released_at":"2026-08-05 22:51:13","reason":"named in this entry, found in this entry's text"},{"version":"2.1.222","anchor":"forked-and-background-agent-queries-require-canusetool-by-de","heading":"Forked and background agent queries require canUseTool by default","line":"Background and forked agents now run your permission callback even when a hook says allow, and deny rules win.","released_at":"2026-08-04 20:37:17","reason":"named in this entry, found in this entry's text"},{"version":"2.1.216","anchor":"bug-fixes","heading":"","line":null,"released_at":"2026-07-20 20:19:37","reason":"found in this entry's text"}],"entries_total":13,"docs":[{"source":"api","path":"managed-agents\/migration","title":"migration","documented":false},{"source":"claude-code","path":"agent-sdk\/agent-loop","title":"How the agent loop works","documented":false},{"source":"claude-code","path":"agent-sdk\/configuration","title":"Configure your agent","documented":false},{"source":"claude-code","path":"agent-sdk\/hooks","title":"Intercept and control agent behavior with hooks","documented":false},{"source":"claude-code","path":"agent-sdk\/permissions","title":"Configure permissions","documented":false},{"source":"claude-code","path":"agent-sdk\/python","title":"Agent SDK reference - Python","documented":false},{"source":"claude-code","path":"agent-sdk\/skills","title":"Extend agents with skills","documented":false},{"source":"claude-code","path":"agent-sdk\/typescript","title":"Agent SDK reference - TypeScript","documented":false},{"source":"claude-code","path":"agent-sdk\/user-input","title":"Handle approvals and user input","documented":false},{"source":"claude-code","path":"env-vars","title":"Environment variables","documented":false}],"docs_total":12,"gates":[],"related":[],"url":"https:\/\/changelogs.core-directive.com\/reference\/setting\/canusetool","family_url":"https:\/\/changelogs.core-directive.com\/reference\/setting.json"}