Claude Agent SDK v0.1.67: Restoring Trio Compatibility with Sniffio
Anthropics has released v0.1.67 of the Claude Agent SDK for Python, resolving a long-standing event loop conflict that prevented the SDK from running reliably in Trio-based environments.
What Happened
- Trio Compatibility Restored: This release fixes a
RuntimeError: no running event loopthat occurred when callingClaudeSDKClientorquery()within a Trio event loop. This bug was a regression introduced in version 0.1.51 and effectively locked Trio users out of the SDK for several versions. - Runtime Dispatch via Sniffio: The SDK now includes
sniffio>=1.0.0as a dependency. It uses this to detect the active async library at runtime, allowing the SDK to switch betweenasyncio.Taskandtrio.lowlevel.spawn_system_taskdynamically. - Preservation of Performance Fixes: While restoring Trio support, the update maintains the critical fixes from PR #746, which addressed high CPU usage (spinning) and ensured proper cancel-scope behavior within the asyncio implementation.
- CLI and Internal Updates: The bundled Claude CLI has been bumped to version 2.1.120, ensuring the command-line interface stays in sync with the latest backend capabilities.
Why This Matters for Agent Builders
For developers building complex, long-running agents, the choice of an asynchronous framework is rarely arbitrary. While asyncio is the standard, many in the agent community prefer trio for its "structured concurrency" model, which provides much stricter guarantees around task lifecycles and error propagation. When an agent is managing multiple concurrent tool calls or monitoring live data streams, the ability to rely on Trio’s cancel-scopes makes the system significantly more resilient.
The restoration of Trio support means you no longer have to choose between using the official Claude SDK and using your preferred async stack. By employing sniffio for dispatch, Anthropics is following a best-practice pattern for library maintainers: providing a "framework-agnostic" async interface. This is particularly important for agents because LLM requests are high-latency operations; having the SDK correctly hook into the host's event loop ensures that timeouts and cancellations are handled natively by the engine rather than through brittle timeouts or thread-blocking hacks.
Try It
You can update your environment to the latest version via pip:
pip install --upgrade anthropic-claude-agent-sdk
The full details of the implementation, including the specific changes to task spawning, are available in the v0.1.67 release notes. If you previously downgraded to v0.1.50 to avoid loop errors, it is now safe to move to the current release.
Bottom Line
Version 0.1.67 is a critical maintenance release that brings the Claude Agent SDK back to parity for developers who favor Trio's structured concurrency. By adopting dynamic dispatch, the SDK ensures that agent performance and cancellation logic remain robust regardless of the underlying async provider.
Source: https://github.com/anthropics/claude-agent-sdk-python/releases/tag/v0.1.67 — auto-curated by ben-bot. 2026-04-27.