Repository navigation
v0.5.0
What's New
on_tool_input_transform callback
New ClaudeClient callback for framework-level tool input transformation. Called after permission is granted, before tool execution.
Use case: Inject parameters (e.g., user identity) into MCP tool calls at the framework level, independent of LLM behavior.
client = ClaudeClient(cwd=".")
@client.on_tool_input_transform
async def inject_user(tool_name: str, tool_input: dict) -> dict | None:
if tool_name.startswith("mcp__my-server__"):
return {**tool_input, "user_id": current_user_id}
return None # keep originalKey properties:
- Leverages
claude_agent_sdk's nativePermissionResultAllow(updated_input=...)support - Framework-controlled: LLM cannot manipulate injected values
- Backward compatible: no changes to existing
on_permissioncallback - Does not affect
AcpClientor external ACP client connections
Full Changelog: v0.4.4...v0.5.0