managedcode

ClaudeCodeSharpSDK — Development skill for Claude Code

Development community

CLI-first .NET / C# SDK for Claude Code CLI with typed thread API, streamed JSONL events, structured outputs.

How to install ClaudeCodeSharpSDK

This entry records only its repository, not the path inside it, so there is no exact command to give. Open managedcode/ClaudeCodeSharpSDK and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What ClaudeCodeSharpSDK does

CLI-first .NET / C# SDK for Claude Code CLI with typed thread API, streamed JSONL events, structured outputs.

Alternatives in Development

  • Claude API — Build apps with the Claude API or Anthropic SDK 94.1k ★
  • Ccusage — CLI for analyzing Claude Code/Codex usage from local JSONL files 11.8k ★
  • Reverse API Engineer — Reverse engineer any website into a typed API client 1.9k ★

README

ManagedCode.ClaudeCodeSharpSDK

[![CI](https://github.com/managedcode/ClaudeCodeSharpSDK/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/managedcode/ClaudeCodeSharpSDK/actions/workflows/ci.yml) [![Release](https://github.com/managedcode/ClaudeCodeSharpSDK/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/managedcode/ClaudeCodeSharpSDK/actions/workflows/release.yml) [![CodeQL](https://github.com/managedcode/ClaudeCodeSharpSDK/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/managedcode/ClaudeCodeSharpSDK/actions/workflows/codeql.yml) [![NuGet](https://img.shields.io/nuget/v/ManagedCode.ClaudeCodeSharpSDK.svg)](https://www.nuget.org/packages/ManagedCode.ClaudeCodeSharpSDK) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

`ManagedCode.ClaudeCodeSharpSDK` is a .NET SDK for driving the Claude Code CLI from C#.

It is intentionally CLI-first. The library does not reimplement Anthropic APIs or invent its own transport. It wraps the local `claude` binary, runs Claude Code in print mode, and maps the emitted protocol into typed C# models.

What You Get

  • ClaudeClient / ClaudeThread API for start, resume, run, and stream workflows
  • real Claude Code print-mode transport via claude -p
  • typed parsing for stream-json events
  • structured output with StructuredOutputSchema
  • optional Microsoft.Extensions.AI adapter package
  • optional Microsoft Agent Framework adapter package
  • repository automation that tracks upstream changes in anthropics/claude-code

Source Of Truth

This SDK follows the real Claude Code CLI contract in print mode:

  • claude -p --output-format json
  • claude -p --output-format stream-json --verbose
  • upstream reference repository: anthropics/claude-code

If the docs in this repository and the observed CLI behavior ever diverge, the observed CLI behavior wins and the SDK should be updated to match