[DOCS] Remove obsolete Python can_use_tool dummy-hook workaround
Current Python SDK releases keep stdin open for can_use_tool without a dummy hook, but the user-input guide still tells users the workaround is required.
Documentation Type
Incorrect/outdated documentation
Documentation Location
https://code.claude.com/docs/en/agent-sdk/user-input
Section/Topic
Python can_use_tool example and the streaming-mode note
Current Documentation
The Python example still defines a no-op hook under this comment:
# Required workaround: dummy hook keeps the stream open for can_use_tool
It also passes that hook through ClaudeAgentOptions.hooks. The note below the example says a finite prompt stream closes before the callback unless a hook or SDK MCP server keeps stdin open.
What's Wrong or Missing?
https://github.com/anthropics/claude-agent-sdk-python/pull/1204 changed the Python SDK to keep stdin open when can_use_tool is configured. It also added support for can_use_tool with string prompts. The workaround and warning now describe behavior that current SDK releases no longer have.
The stale example makes users register an unrelated hook and suggests that the supported callback path still needs a transport workaround.
Suggested Improvement
Remove dummy_hook, the hooks={...} option, and the note that says a hook or SDK MCP server is required. Use the string-prompt form in the Python example, matching the TypeScript example on the same page:
async for message in query(
prompt="Create a test file and then delete it",
options=ClaudeAgentOptions(can_use_tool=can_use_tool),
):
...
The page can still state that can_use_tool uses streaming mode internally and that ClaudeSDKClient remains the better fit for long-lived interactive sessions.
Impact
Medium - Makes feature difficult to understand
Verification
The current SDK contract tests pass without any hook:
$ python -m pytest -q tests/test_query.py -k 'can_use_tool_waits_for_result or string_prompt_with_can_use_tool_is_supported'
3 passed, 56 deselected in 0.91s
Additional Context
Earlier reports such as https://github.com/anthropics/claude-code/issues/19694 described the real SDK bug before it was fixed. This report is about removing the workaround after the fix shipped.