ClaudeSharp
A native Claude Code alternative built in C#/.NET with Terminal.Gui TUI. Features: streaming agent loop, 11 built-in tools, MCP server integration, SQLite long-term memory with FTS5, hooks and skills plugin system, permission dialogs, and cross-platform shell support.
Ask AI about ClaudeSharp
Powered by Claude Β· Grounded in docs
I know everything about ClaudeSharp. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
ClaudeSharp
A native Claude Code alternative built in C#/.NET with Terminal UI, MCP support, and plugin system.
Open source under MIT license.
Install
# Option 1: dotnet tool (recommended, requires .NET 10 SDK)
dotnet tool install -g ClaudeSharp
# Option 2: Standalone binary (no .NET required)
# Download from GitHub Releases: https://github.com/hmennen90/ClaudeSharp/releases
Features
- Full agent loop with streaming responses and tool-call chaining
- 11 built-in tools: ReadFile, WriteFile, EditFile, Glob, Grep, Shell, ListDirectory + 4 Memory tools
- MCP server integration β compatible with Claude Code
.mcp.jsonconfig - Plugin system β hooks (PreToolUse/PostToolUse) and skills (SKILL.md slash commands)
- Terminal UI via Terminal.Gui v2 with chat view, input, status bar
- Permission system β file writes and shell commands require user confirmation
- Long-term memory β SQLite-based memory with FTS5 full-text search
- 3-layer memory retrieval β token-efficient search, timeline, details pattern
- Slash commands β /help, /model, /tools, /clear, /cost, /quit + custom skills
- Config files β ~/.claudesharp/config.json and project-level .claudesharp.json
- Context window management β auto-truncation when approaching limits
- Cross-platform β PowerShell on Windows, bash/zsh on Unix
Quick Start
# Set your API key
export ANTHROPIC_API_KEY=sk-ant-... # Unix
$env:ANTHROPIC_API_KEY = "sk-ant-..." # PowerShell
# Run
claudesharp # if installed via dotnet tool
claudesharp --model=claude-opus-4-20250514 # with specific model
claudesharp --dir=C:\Projects\MyApp # with working directory
Usage
dotnet run --project src/ClaudeSharp.Tui [options]
Options:
--model=<model> Claude model to use (default: claude-sonnet-4-20250514)
--dir=<path> Working directory
Slash Commands
| Command | Description |
|---|---|
| /help | Show available commands |
| /model | Switch Claude model |
| /clear | Clear conversation history |
| /cost | Show session token usage |
| /quit | Exit ClaudeSharp |
| Esc | Cancel current request |
Built-in Tools
| Tool | Description |
|---|---|
| ReadFile | Read files with line numbers |
| WriteFile | Create/overwrite files |
| EditFile | Exact string replacement |
| Glob | Find files by pattern |
| Grep | Regex search in files |
| Shell | Execute shell commands |
| ListDirectory | List directory contents |
| MemorySearch | Search long-term memory |
| MemoryStore | Save observations to memory |
| MemoryTimeline | Chronological context |
| MemoryGetDetails | Full memory details |
Configuration
Create ~/.claudesharp/config.json:
{
"model": "claude-sonnet-4-20250514",
"maxTokens": 8192,
"shell": "pwsh",
"shellTimeoutSeconds": 120,
"maxContextTokens": 180000
}
Or project-level .claudesharp.json in your working directory.
Priority: CLI args > env vars > project config > global config
Architecture
ClaudeSharp/
βββ src/
β βββ ClaudeSharp.Core/ # Agent loop, tools, models (no UI deps)
β βββ ClaudeSharp.Memory/ # SQLite + FTS5 long-term memory
β βββ ClaudeSharp.Tui/ # Terminal.Gui v2 interface
β βββ ClaudeSharp.Cli/ # Headless mode (planned)
βββ tests/
βββ ClaudeSharp.Core.Tests/
MCP Server Integration
ClaudeSharp connects to MCP servers using the same config format as Claude Code.
Create .mcp.json in your project directory:
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "@some/mcp-server"],
"env": {}
}
}
}
MCP tools are auto-discovered and registered as mcp_<server>_<tool>. Use /tools to see all registered tools.
Config locations: .mcp.json (project), ~/.claudesharp/mcp.json (global)
Plugin System
Hooks
Hooks run shell commands before/after tool execution. Configure in settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Shell",
"hooks": [
{
"type": "command",
"command": "echo 'Shell command about to run'",
"timeout": 10
}
]
}
]
}
}
Config locations: .claudesharp/settings.json, .claude/settings.json (Claude Code compatible)
Supported events: SessionStart, SessionEnd, PreToolUse, PostToolUse, UserPromptSubmit, Stop
Skills
Custom slash commands defined as SKILL.md files:
~/.claudesharp/skills/my-skill/SKILL.md
.claude/skills/my-skill/SKILL.md # Claude Code compatible
SKILL.md format:
---
name: my-skill
description: What this skill does
argument-hint: "[query]"
user-invocable: true
---
Your prompt content here. Use $ARGUMENTS for user input.
Invoke with /my-skill some arguments.
Memory System
Built-in long-term memory using SQLite with FTS5 full-text search.
- Per-project isolation β memories are scoped to the working directory
- 3-layer retrieval β search (lightweight index), timeline (context), details (full content)
- Auto-context β recent memories are injected into the system prompt at startup
- Storage:
~/.claudesharp/memory/claudesharp.db
License
MIT
