claudeloop-agent-sdklisted
Install: claude install-skill the-vibey-project/vibey
# claudeloop + claude-agent-sdk integration
> **Codex skill mirror** of `.claude/skills/claudeloop-agent-sdk/SKILL.md`. When this guidance changes, update Claude skill, Cursor rule, and `.agents/skills/` in the same PR.
`infrastructure/agent/` is the only place `claude_agent_sdk`
may be imported — see the `claudeloop-architecture` skill for the enforced
onion rule. This skill covers the SDK integration specifics; consult
`claudeloop-domain-model` for how the resulting signals get classified.
## `ClaudeSDKClient` over `query()` — this is not optional
`query()` (single-shot) raises a **plain `Exception`** after yielding an
error `ResultMessage`, and the underlying process exits non-zero. A
streaming-input `ClaudeSDKClient` **stays alive** across error results — you
can keep sending messages on one live process with no resume/respawn. The
`AgentGateway` adapter (infrastructure/agent/gateway.py::ClaudeAgentGateway) MUST use `ClaudeSDKClient`, not `query()`, or
the whole point of collapsing the legacy respawn loop is lost. See ADR 0002
for the full reasoning.
## Key `ClaudeAgentOptions` fields for this project
- **`permission_mode="bypassPermissions"`** — required for autonomy. Note:
the Python SDK has **no `dangerously_skip_permissions` field**; this is
its equivalent. Do not go looking for a field that doesn't exist.
- **`can_use_tool`** — a defensive callback that must NEVER await input.
Intercepts `AskUserQuestion` specifically and **denies with guidance**
(not