Claude transport
Claude Code is integrated through @anthropic-ai/claude-agent-sdk, keeping one persistent SDK session open per AgentDock session.
The Claude adapter (src/main/agents/claude) talks to Claude Code exclusively through @anthropic-ai/claude-agent-sdk — there's no PTY fallback for this provider.
Session model
One SDK session stays open for the life of an AgentDock session rather than re-spawning the CLI per message. That persistent session is what makes live model and permission-mode switching possible mid-conversation without losing context.
Permission handling
Tool-call approval goes through the SDK's real canUseTool callback, wired over --permission-prompt-tool stdio. A denied call is genuinely blocked at the SDK level — AgentDock isn't just hiding a result the CLI already produced.
Event mapping
Structured SDK activity (assistant text, tool calls, tool results) is mapped into the shared agent event model by ClaudeEventMapper. One specific wrinkle the mapper handles: a tool result can arrive after the activity it belongs to was already reported as provisionally complete, so the reducer supports updating an already-emitted activity rather than assuming single-shot reporting.