A Semantic Kernel connector that bridges your local Claude Code OAuth session into Microsoft Semantic Kernel — no manual API key management needed.
- Zero-config authentication — automatically reads
~/.claude/.credentials.json - Multi-source credential resolution — options → env vars → local session, in priority order
- OAuth & API key support — handles
sk-ant-oat*(Bearer) andsk-ant-api*(x-api-key) tokens - Full Semantic Kernel integration —
IKernelBuilder.UseClaudeCodeChatCompletion()one-liner - DI-friendly —
IServiceCollection.AddClaudeCodeAuthentication()for ASP.NET Core / Generic Host - Broad TFM support —
netstandard2.0,net8.0,net10.0
dotnet add package JD.SemanticKernel.Connectors.ClaudeCodeusing JD.SemanticKernel.Connectors.ClaudeCode;
var builder = Kernel.CreateBuilder();
builder.UseClaudeCodeChatCompletion(); // defaults to ClaudeModels.Default (Sonnet)
var kernel = builder.Build();
var result = await kernel.InvokePromptAsync("Hello, Claude!");
Console.WriteLine(result);builder.Services.AddClaudeCodeAuthentication(options =>
{
options.CredentialsPath = "/custom/path/.credentials.json"; // optional
});{
"ClaudeSession": {
"ApiKey": null,
"OAuthToken": null,
"CredentialsPath": null
}
}builder.Services.AddClaudeCodeAuthentication(builder.Configuration);| Priority | Source | Description |
|---|---|---|
| 1 | ClaudeSession:ApiKey |
Explicit API key in options/config |
| 2 | ClaudeSession:OAuthToken |
Explicit OAuth token in options/config |
| 3 | ANTHROPIC_API_KEY env var |
Environment variable |
| 4 | CLAUDE_CODE_OAUTH_TOKEN env var |
Environment variable |
| 5 | ~/.claude/.credentials.json |
Claude Code local session file |
This repo includes sample projects demonstrating agentic workflows with Semantic Kernel:
| Tool | Command | Description |
|---|---|---|
| Gherkin Generator | jdgerkinator |
Converts acceptance criteria into Gherkin/Reqnroll specs |
| PR Review Agent | jdpr |
Multi-provider PR review (GitHub, Azure DevOps, GitLab) |
| Codebase Explorer | jdxplr |
Profiles codebases into structured knowledgebases |
| Todo Extractor | (library demo) | Extracts structured todos from natural language |
Install the CLI tools as global tools:
dotnet tool install -g JD.Tools.GherkinGenerator
dotnet tool install -g JD.Tools.PullRequestReviewer
dotnet tool install -g JD.Tools.CodebaseExplorerWell-known model constants are available via ClaudeModels:
builder.UseClaudeCodeChatCompletion(ClaudeModels.Opus); // claude-opus-4-6
builder.UseClaudeCodeChatCompletion(ClaudeModels.Sonnet); // claude-sonnet-4-6 (default)
builder.UseClaudeCodeChatCompletion(ClaudeModels.Haiku); // claude-haiku-4-5Full documentation is available at the DocFX site including:
- Getting Started
- Credential Resolution
- Kernel Builder Integration
- Service Collection Integration
- HttpClientFactory
- Configuration Reference
- Sample Tools Guide
dotnet build
dotnet testcd docs
dotnet tool restore
dotnet docfx docfx.json