Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk 4.0.0

dotnet add package Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk --version 4.0.0
                    
NuGet\Install-Package Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk -Version 4.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk --version 4.0.0
                    
#r "nuget: Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk, 4.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk@4.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk&version=4.0.0
                    
Install as a Cake Tool

Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk

About

Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk is an IModel adapter that runs the Claude Code CLI — via Universal.Anthropic.ClaudeAgentSdk — as an Operative model provider.

Usage

using Universal.Operative.Sdk;
using Universal.Operative.Sdk.Discrete;
using Universal.Operative.Sdk.Discrete.Anthropic.ClaudeAgentSdk;

using IModel model = new Model(new Model.Options { WorkingDirectory = "/path/to/a/writable/directory", // also determines where synthetic transcripts are written
 Tools = myTools, // the same ITool list registered on your Engine
 });

Notes

Partial Claude stream events are enabled by default and mapped to Operative block start/delta/stop events. Tool calls emitted by assistant messages and tool results emitted by CLI user messages are both retained in the settled response. System, rate-limit, unknown, and otherwise provider-specific messages are exposed through namespaced UnknownEvent payloads rather than dropped. Set Model.Options.IncludePartialMessages to false to use settled assistant messages only.

Experimental: conversation history is maintained via a synthetic session transcript in the CLI's own on-disk format, which is undocumented and may change without notice.

By default, each turn permits only the exact bridged Operative tool snapshot. The adapter excludes ambient MCP configuration and settings, removes built-in tools with --tools "", and checks fully qualified tool names in both permission and PreToolUse callbacks. An optional host permission callback can narrow that set; it cannot expand it or persist permission updates. Set DisableBuiltInTools = false only when intentionally enabling native CLI tools and configuration. Required/named tool choices cannot be forced by this CLI bridge and throw NotSupportedException; ToolChoiceNone exposes no bridged tools.

Working directories are normalized to absolute paths. Config directories resolve relative to that working directory; an explicit ConfigDirectory must agree with an explicit EnvironmentVariables["CLAUDE_CONFIG_DIR"]. Otherwise the environment value (including an inherited value) supplies the config directory. model.WorkingDirectory and model.ConfigDirectory expose the effective paths used by the CLI, credentials and transcript writer. Status checks and inference both prepare configured OAuth credentials before startup. Concurrent initialization publishes one complete credentials file without replacing an existing file; Unix files use owner-only permissions. A shallow status check still does not verify server acceptance.

History containing internal tool exchanges is expanded into linked assistant/user records, preserving call IDs, original MCP names and block order. Terminal failures retain native context in ErrorEvent.Extensions["anthropic.claudeAgentSdk"] (also available through ModelStreamException.SourceError); treat this payload as potentially sensitive.

The tool configuration follows the official CLI reference and PreToolUse hook contract. Local regression tests verify generated options, permission/hook decisions, transcript shape and credential initialization. They do not establish compatibility with every CLI version or execute a live agent. The synthetic transcript and credential formats remain experimental.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 140 11/18/2026
3.2.1 114 11/16/2026
3.2.0 150 11/11/2026
3.1.0 92 11/11/2026
3.0.3 109 11/10/2026
3.0.2 114 11/10/2026
3.0.1 233 10/1/2026
3.0.0 196 9/7/2026
2.0.2 143 9/2/2026
2.0.1 132 9/1/2026
2.0.0 138 9/1/2026
1.2.0 151 8/26/2026
1.1.0 147 8/25/2026
1.0.1 151 8/24/2026
1.0.0 247 8/12/2026

Targets .NET 10 and .NET 11. Enforces exact invocation tool boundaries by default, replays internal tool exchanges with correct roles, normalizes isolated state paths, atomically initializes credentials for status and inference, preserves native failure context, and rejects unsupported forced tool choices.