Before Klaus design or code changes, inspect and test exact installed Pi and Claude Agent SDK APIs; never rely on memory, bridge code, or summaries. Use dbg?.(...) only for bounded, secret-free diagnostics. `PI_KLAUS_DEBUG=1|0` overrides global `pi-ext.debug`; restart Pi after changing selection. Never call dbg(...) without optional chaining, because disabled tracing must skip argument evaluation. Do not edit the generated `src/pi-ext-debug.ts`; edit its template and regenerate through `mise run //:codegen`. To update the Claude Agent SDK: bump the exact pin in `package.json`, install, read `version` from the installed SDK `manifest.json`, and set `SDK_VERSION` plus `CLAUDE_VERSION` in `src/protocol.ts`. Never hand-copy binary checksums; `src/runtime/standard.ts` verifies the vendored binary against the pinned SDK manifest. A model error demanding "version X or newer" means the bundled Claude Code CLI is too old; fix it with this update instead of pointing klaus at an external `claude` binary. Finish with `mise run //extensions/klaus:test`; cache fixtures pin the SDK version.