Configures the CrestApps.Core Claude orchestrator (IOrchestrator "anthropic") using the official Anthropic C# SDK. Covers registration, ClaudeOptions binding, model discovery, tool materialization, prompt caching, and usage metering.
Ships in crestapps-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
CrestApps.Core.AI.Claude adds ClaudeOrchestrator, an IOrchestrator named "anthropic" (title Claude). It talks to Anthropic through the official Anthropic NuGet package, so there is no CLI or external executable to install.
ClaudeSessionMetadata.ClaudeModel or ClaudeOptions.DefaultModel.ClaudeOptions from your own section or site settings.ApiKey and DefaultModel must be set, or every turn answers "Claude is not configured and cannot be used until it has been configured." A per-profile model override does not replace the default-model requirement.reasoningEffort do not apply; Claude uses ClaudeEffortLevel on the session metadata.using CrestApps.Core.AI.Claude;
using CrestApps.Core.AI.Claude.Models;
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddClaudeOrchestrator()
)
);
builder.Services.Configure<ClaudeOptions>(builder.Configuration.GetSection("Claude"));
Raw form: builder.Services.AddCoreAIClaudeOrchestrator(); after AddCoreAIServices() and AddCoreAIOrchestration().
{
"Claude": {
"ApiKey": "sk-ant-...",
"BaseUrl": "https://api.anthropic.com",
"DefaultModel": "claude-sonnet-4-6",
"EnablePromptCaching": true
}
}
ClaudeOptionsValidator (an IValidateOptions<ClaudeOptions>) fails when ApiKey is empty. Keep the key in user secrets or a key vault.
| Service | Implementation |
|---|---|
IOrchestrator | ClaudeOrchestrator (ClaudeOrchestrator.OrchestratorName = "anthropic") |
ClaudeClientService | Creates SDK clients and lists models from the Anthropic Models API |
IChatInteractionSettingsHandler | ClaudeChatInteractionSettingsHandler persists chat interaction overrides |
IOrchestrationContextBuilderHandler | ClaudeOrchestrationContextHandler copies ClaudeSessionMetadata into OrchestrationContext.Properties |
using CrestApps.Core.AI.Claude.Models;
using CrestApps.Core.AI.Claude.Services;
profile.OrchestratorName = ClaudeOrchestrator.OrchestratorName;
profile.Put(new ClaudeSessionMetadata
{
ClaudeModel = "claude-opus-4-5",
EffortLevel = ClaudeEffortLevel.Medium,
});
await profileManager.UpdateAsync(profile);
Or resolve it directly: var orchestrator = resolver.Resolve(ClaudeOrchestrator.OrchestratorName);.
ClaudeEffortLevel is None, Low, Medium or High; anything other than None is sent as the reasoning_effort additional property.
ClaudeSessionMetadata.ClaudeModel, else ClaudeOptions.DefaultModel.IToolRegistry.GetAllAsync(context.CompletionContext), the same scoped registry the default orchestrator uses, and are materialized into ChatOptions.Tools through IToolMaterializer. For a Chat Interaction the listable tools are re-checked against the current user (IUserAccessor) and denied ones are left out with a warning; AI sessions run the profile's tools as configured. DisableTools sends none.AIUsageMetering.Meter(..., AIUsagePurposes.Conversation) before UseFunctionInvocation, so every round trip is a usage record with client name anthropic. With DefaultAIOptions.EnableOpenTelemetry on, UseOpenTelemetry sits below the tool loop, so every round trip also gets a gen_ai span (see crestapps-core-observability).null value is not sent); the iteration cap from DefaultAIOptions.MaximumIterationsPerRequest (default 30).With ClaudeOptions.EnablePromptCaching on (the default), each request marks ephemeral cache breakpoints on the last function tool, the end of the system prompt and the last block of the latest message. Later turns, and later round trips of the tool-calling loop within five minutes, read that prefix at the cache-read rate. Three of Anthropic's four breakpoints are used, and marked messages and tools are copies, so the caller's history is never changed. A prefix shorter than the model's minimum cacheable length is sent uncached without an error. Cache reads are metered as CachedInputTokenCount and cache writes as CacheWriteInputTokenCount. Turn it off only for workloads that never repeat a prefix within five minutes, since a cache write costs more than an uncached request.
ClaudeClientService.CreateClient() returns a configured AnthropicClient, and ListModelsAsync(cancellationToken) returns ClaudeModelInfo entries for the API key so editors can offer a picker; fall back to free text when discovery is unavailable. The MVC and Blazor sample hosts wire Claude into settings, AI profiles, profile templates and chat interactions.
ClaudeOptions.ApiKey or DefaultModel is empty, usually because nothing bound the options. Set a default model even when every profile overrides it.AddCoreAIUsageTracking() or .AddUsageTracking() (see crestapps-core-ai-usage-metering).The Claude orchestrator cannot pause for tool approvals, so a tool that requires an approval does not run in its requests: the model gets a "was not run" result, unless the profile's AIToolApprovalSettings lets that tool kind run without asking.
The Anthropic client sends its requests through the named HttpClient ClaudeClientService.HttpClientName ("CrestApps.Claude"), registered by AddCoreAIClaudeOrchestrator() without redirects or cookies and with decompression. Configure it with AddHttpClient(ClaudeClientService.HttpClientName) to choose the transport. Code that constructs ClaudeClientService passes an IHttpClientFactory, and a host that registers it without AddCoreAIClaudeOrchestrator() also calls services.AddHttpClient().
The orchestrator now sends the scoped tools, so profile, interaction, system and MCP tools are called on Claude. ClaudeOrchestrator takes IToolMaterializer and IUserAccessor as new constructor parameters; code that constructs it directly passes them.
Prompt caching is on by default. Set EnablePromptCaching to false to restore uncached requests.
ClaudeOrchestrator takes the scoped DefaultAIOptions instead of IOptions<DefaultAIOptions>, so a site's Enable OpenTelemetry setting reaches it. Code that constructs it directly passes a DefaultAIOptions.
AIUsageMetering.Meter.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
claude-orchestrator, anthropic-sdk, dotnet-ai, crestapps-core
/crestapps-core:crestapps-core-claude-orchestratorfrom crestapps-core
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-core51 skills in this plugin
/crestapps-core-a2aSkill for Agent-to-Agent (A2A) protocol support in CrestApps.Core on the A2A 1.0 SDK. Covers AddA2AClient and AddCoreAIA2AClient with Entity Framework Core or YesSql connection stores, A2AConnection and A2AConnectionMetadata authentication, AIProfileA2AMetadata, the agent card cache and A2AToolRegistryProvider, the listAvailableAgents, findAgentForTask and findToolsForTask tools, building an A2A host with IAgentHandler, A2AServer, ITaskStore and MapA2A, A2A 1.0 agent cards with supportedInterfaces published at /.well-known/agent-card.json, A2AHostOptions authentication and ExposeAgentsAsSkill, system agents exposed through the host, and upgrading from the 0.3 SDK./crestapps-core-ag-uiSkill for running the CrestApps.Core 2.0 AI chat as an AG-UI agent. Covers the CrestApps.Core.AI.AGUI package (AGUIRunEventWriter, AGUIRunRequest, AGUIJson), AIChatHubCore.RunAgent over SignalR and MapAGUIChat with Server-Sent Events, the RunAgentInput members and streamed events, tool approvals with RequireApproval or an approval tool kind, ApprovalRequiredAIFunction, interrupts and resume, approvals inside agents, page context with crestAppsAGUI.registerContextProvider, shared state with registerStateProvider and update_shared_state, frontend tools, stored tool calls (ChatTurnToolActivity), runs that continue on the next page, AGUIChatOptions.DisconnectedRunTimeout, the protocol and sendPageContext chat options, and the AICompletionContextKeys and ChatResponseHandlerContext members. Use it when showing tool calls in the chat, asking a person before a tool runs, sharing page state with the agent, connecting CopilotKit or another AG-UI client, or troubleshooting approvals and continued runs.Other plugins' skills for the same job