migrating-claude-agent-sdk-to-pydantic-ai
Installation
SKILL.md
Migrate Claude Agent SDK to Pydantic AI
Preserve observable behavior, not the Claude Code process or API shape. Migrate the smallest complete caller path and keep application infrastructure in place.
Trace the source before choosing a target
- Read repository instructions, dependencies, tests, and the runtime entrypoint. Record the installed Claude Agent SDK, bundled Claude Code CLI, Pydantic AI, and Harness versions.
- Trace one real request from
query()orClaudeSDKClientthrough prompts, tools, events, results, state, persistence, approvals, and side effects that callers use. Establish a focused baseline or characterization test. - Separate these source contracts when present:
- fresh
query()calls, liveClaudeSDKClientcontinuation, disk/external-store resume, transcript forks, and file rewind; - tool availability, automatic approval, policy callbacks, and OS/container isolation;
- completed messages, raw token deltas, lifecycle events, and terminal results;
- conversation history, workflow checkpoints, model-owned plans, long-term memory, and workspace state;
- model-directed subagents from application-owned loops, queues, retries, and schedulers.
- fresh
- Record each observed contract, its owner, semantic difference, and executable proof. An unobserved Claude Code feature is not migration scope.
Read Research and concept mapping for the detected source features. Read Verification and cutover before implementation.