# ClaudeAgent and CodexAgent take typed native options

> Agno's ClaudeAgent accepts a native ClaudeAgentOptions object and CodexAgent accepts ThreadOptions and TurnOptions, replacing the untyped _kwargs dictionaries. Constructors are keyword-only, and print_response returns the final run.

- Published: 2026-10-12
- Author: Ashpreet Bedi
- Categories: Changelog
- Canonical: https://www.agno.com/blog/claudeagent-and-codexagent-take-typed-native-options
- Markdown: https://www.agno.com/blog/claudeagent-and-codexagent-take-typed-native-options.md

Agno's `ClaudeAgent` takes the SDK's own `ClaudeAgentOptions` through `options`, and `CodexAgent` takes `ThreadOptions` and `TurnOptions`, typed dictionaries exported from `agno.agents.codex` that use the Codex SDK's parameter names. Named fields on the agent, such as `allowed_tools` or `sandbox`, win over the same setting in those options whenever they are set.

```python
from claude_agent_sdk import ClaudeAgentOptions

from agno.agents.claude import ClaudeAgent
from agno.agents.codex import CodexAgent

claude = ClaudeAgent(
    name="Claude",
    allowed_tools=["Read"],
    options=ClaudeAgentOptions(max_turns=3),
)

codex = CodexAgent(
    name="Codex",
    sandbox="read-only",
    thread_options={"personality": "pragmatic"},
    turn_options={"effort": "high"},
)
```

ClaudeAgent also gains named fields for `tools`, `setting_sources`, `strict_mcp_config`, `skills` and `plugins`, and CodexAgent for `model_provider`, `service_tier`, `mcp_servers` and `client_options`. The old dictionaries keep working and warn on construction.

```text
# real output
DeprecationWarning: options_kwargs is deprecated; use options=ClaudeAgentOptions(...) or named parameters. Named parameters override options; options_kwargs retains legacy precedence.
DeprecationWarning: thread_kwargs is deprecated; use thread_options. Named settings take precedence.
```

Both constructors are keyword-only now. Earlier releases read `ClaudeAgent("Claude")` as the agent's name, and this release refuses it.

```text
# real output
TypeError: ClaudeAgent.__init__() takes 1 positional argument but 2 were given
```

`agent.sdk` names the SDK an adapter wraps (`"claude-agent-sdk"` or `"codex"`), and the agents and session APIs report only `sdk`. The older `agent.framework` attribute stays on the Python object as an alias.

`print_response` and `aprint_response` return the final `RunOutput` and raise once a failed or cancelled run has printed, so a failing script stops at the failure. Pass `raise_on_error=False` to get the run back and check its status yourself. We ran it on both releases with a Claude Agent SDK stand-in whose subprocess exits with code 1.

```text
# real output, summarised: ClaudeAgent(name="Claude").print_response("hi", stream=False)
Before:  returned None, no exception
Now:     AgentRunException: Command failed with exit code 1
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/frameworks/claude-agent-sdk/claude_basic.py), and learn more about [configuring Claude and Codex](https://docs.agno.com/agent-os/multi-framework/configuration) in the documentation.
