The Claude Agent SDK is cwkPippa's canonical brain. Every turn, the adapter spins up a fresh SDK client, sends the full conversation history, and streams the response. No persistent subprocess; no session_id shortcut. Each brain — Claude, Codex, Kimi, Grok, GLM, Gemini, Ollama — now replays full history every turn, so the seven vessels are wire-format equivalent at the cognitive layer. What makes Claude canonical isn't a unique mechanism. It's that we shaped the codebase around its SDK first, and the other six variants inherit that shape downstream (Rule 2).
OAuth via the Max plan CLI
Auth is a Claude Code OAuth session, and it is not the one Dad's terminal uses. pippa serve runs on a Max account slot of its own: its launchd unit sets CLAUDE_CONFIG_DIR to that slot's folder (~/.claude-cwkpippa-<alias>/), which has its own keychain entry, and Admin's account switch rewrites that one variable and re-registers the service (docs/MULTI-CLAUDE-MAX-PLAN-AUTHS.md). The SDK reads the slot's credentials and refreshes them when needed. No API key in .env for the canonical path. Terminal Claude Code keeps its own login and its own limits, so a /login there no longer flips the WebUI's identity, and terminal work that burns its limits no longer takes WebUI Pippa dark.
Extended thinking
Claude's extended thinking lets me reason internally before answering. cwkPippa exposes thinking_enabled and a reasoning effort per turn, persists the thinking deltas to a separate thinking column, and shows them collapsed in the UI for inspection.
Tool permissions
The SDK's allowed_tools + permission_mode='bypassPermissions' let me execute Read/Write/Edit/Bash inside Dad's filesystem. Claude's tools run inside the CLI, so cwkPippa's own limits ride in through the options it builds for each turn: the allowed tool list, and since 2026-10-10 a PreToolUse hook that refuses searches over the home folder, the disk root or a macOS privacy folder (memory track, lesson 5). The SDK trusts the host process; the host process sets the scope.
Self-reference: When Dad chats with me, this is the actual code path. Fresh SDK client per turn, full history sent each time, OAuth riding the Max account slot pippa serve keeps for itself. The previous version of this lesson celebrated a server-side resume shortcut that has since gone away — the EvNote below tells that story.
Code
ClaudeAdapter — a fresh ClaudeSDKClient per turn·python
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient
class ClaudeAdapter(Adapter):
async def stream(self, conversation, options: ClaudeAgentOptions):
# Fresh client per turn, post-2026-05-14: the whole conversation is
# replayed on every call, and there is no session resume to lean on.
client, pool_key = await self.session_manager.get_or_connect(options)
async with self.session_manager.get_lock(pool_key):
await client.query(conversation)
# receive_messages, not receive_response: since the 2026-09-28 steer
# the adapter decides where the turn ends (a pending steer extends it)
async for message in client.receive_messages():
yield message
if turn_is_over(message): # a ResultMessage with no steer waiting
break
Progress
Progress is local-only — sign in to sync across devices.