Search the documentation
15 pages for canusetool.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
How the agent loop works
Claude Code CLI · in the page
agent-sdk/agent-loop
…"default"` | Tools not covered by allow rules trigger your `canUseTool` callback; no callback means deny…
Intercept and control agent behavior with hooks
Claude Code CLI · in the page
agent-sdk/hooks
…ion) once a permission request has waited about six seconds on your [`canUseTool` callback](/docs/en/agent-sdk/user-input). Requires TypeScript Agent SDK v0.3.233 or later, or Python Agent SDK v0.2.13…
Configure permissions
Claude Code CLI · in the page
agent-sdk/permissions
…ion modes and rules to define what's allowed automatically, and the [`canUseTool` callback](/docs/en/agent-sdk/user-input) to handle everything else at runtime. ## How permissions are evaluated When…
Agent SDK reference - Python
Claude Code CLI · in the page
agent-sdk/python
…ted stderr: Callable[[str], None] | None = None can_use_tool: CanUseTool | None = None hooks: dict[HookEvent, list[HookMatcher]] | None = None user: str | None = None include_parti…
Extend agents with skills
Claude Code CLI · in the page
agent-sdk/skills
…rs. For the full permission flow, including permission modes and the `canUseTool` callback, see [Permissions](/docs/en/agent-sdk/permissions). ## Troubleshooting ### Skills not found **Check settin…
Subagents in the SDK
Claude Code CLI · in the page
agent-sdk/subagents
…e subagent calls. Without it, Agent invocations fall through to your `canUseTool` callback or, in `dontAsk` mode, are denied * **Use explicit prompting**: mention the subagent by name in your prompt,…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…ession in. Other unlisted tools fall through to `permissionMode` and `canUseTool`. Use `disallowedTools` to block tools. See [Permissions](/docs/en/agent-sdk/permissions#allow-and-deny-rules)…
Handle approvals and user input
Claude Code CLI · in the page
agent-sdk/user-input
…ying questions** (via the `AskUserQuestion` tool). Both trigger your `canUseTool` callback, which pauses execution until you return a response. This is different from normal conversation turns where C…
Claude Code changelog
Claude Code CLI · in the page
changelog
…ash commands (e.g. `touch`, `rm`) without a permission prompt or SDK `canUseTool` callback * Fixed worktree creation following a repository-committed symlink at `.claude/worktrees`, which could crea…
Environment variables
Claude Code CLI · in the page
env-vars
…ication) in sessions where Claude Code sends them to the Agent SDK's `canUseTool` callback, which is how Claude Desktop and the VS Code extension host Claude Code. Has no effect in terminal sessions.…
Hooks reference
Claude Code CLI · in the page
hooks
…y in sessions where it sends permission requests to the Agent SDK's [`canUseTool` callback](/docs/en/agent-sdk/user-input), which is how Claude Desktop and the VS Code extension host Claude Code: * E…
Automate actions with hooks
Claude Code CLI · in the page
hooks-guide
…s) with the `-p` flag, that prompt only exists when the Agent SDK's [`canUseTool` callback](/docs/en/agent-sdk/permissions) supplies it. In plain `-p` runs or with `--permission-prompt-tool`, use `Pre…
Connect Claude Code to tools via MCP
Claude Code CLI · in the page
mcp
…ction; not supported via --permission-prompt-tool`. The Agent SDK's [`canUseTool` callback](/docs/en/agent-sdk/permissions) does receive these calls and can approve them, because your SDK application…
Monitoring
Claude Code CLI · in the page
monitoring-usage
…ssion prompt request itself fails, for example when the Agent SDK's [`canUseTool`](/docs/en/agent-sdk/typescript#canusetool) callback or the [`--permission-prompt-tool`](/docs/en/cli-reference#cli-fla…
Orchestrate subagents at scale with dynamic workflows
Claude Code CLI · in the page
workflows
…/en/cli-reference#cli-flags) approves it, or, with the Agent SDK, a [`canUseTool`](/docs/en/agent-sdk/permissions) callback or a [`PermissionRequest` hook](/docs/en/hooks#permissionrequest) approves i…