CodeSharp is a terminal-first coding assistant for developers who want fast answers, clean repo navigation, and a CLI that feels built for real work instead of demos.
Built as a modern C#/.NET 10 take on the original Claw Code, it brings Anthropic, NVIDIA, OpenAI, and xAI models into a sharper REPL with live streaming, readable markdown rendering, colored diff previews, clearer tool feedback, and smoother code-reading and editing workflows.
It also adds practical features that matter in daily use: slash-command suggestions, guided config management, pinned full-screen REPL layout, parallel read-only repo analysis, smarter search output with context, and better handling for queued prompts, retries, and interrupt flow.
Requirements:
- .NET 10 SDK
global.json currently pins SDK 10.0.100 with rollForward: latestFeature.
brew install --cask dotnet-sdk
dotnet --list-sdksIf dotnet is not on your PATH afterwards, add the default install location for your shell:
export PATH="/usr/local/share/dotnet:$PATH"On Apple Silicon machines installed via Microsoft's pkg installer, you may instead need:
export PATH="/opt/homebrew/share/dotnet:$PATH"Install the .NET 10 SDK from the official Microsoft instructions:
- https://learn.microsoft.com/dotnet/core/install/linux
- https://learn.microsoft.com/dotnet/core/install/windows
dotnet restore CodeSharp.sln
dotnet build CodeSharp.slnInteractive REPL:
dotnet run --project src/CodeSharp.CliSingle prompt:
dotnet run --project src/CodeSharp.Cli -- "Explain this codebase"For a single self-contained binary on macOS Apple Silicon:
dotnet publish src/CodeSharp.Cli/CodeSharp.Cli.csproj \
-c Release \
-r osx-arm64 \
--self-contained true \
/p:PublishSingleFile=trueThe published binary will be written to:
src/CodeSharp.Cli/bin/Release/net10.0/osx-arm64/publish/
For Intel macOS, Linux, and Windows examples, see Standalone Binary below.
- Planning mode — the model can call
EnterPlanModeandExitPlanModeitself, or you can use/planand/plan approve. In planning mode all mutating tools are blocked; the assistant produces a structured plan with Goal, Assumptions, Steps, Risks, and Validation sections. - Agent tool with subagent types —
Agentnow spawns an isolatedConversationRuntimeper call.subagent_type: "Explore"maps to a read-only analysis agent,"Plan"runs in planning mode, and the default runs a focused task agent. Each has its own session and type-specific system prompt. - Automatic verification — after file edits the runtime detects the build system (dotnet, pnpm/npm typecheck, python -m py_compile) and runs it automatically, feeding the result back to the model as a system note.
/commit— AI-generates a conventional commit message from staged changes, shows a preview, and commits on confirmation./diff— showsgit diff --statplus a colored inline diff with green additions and red removals, truncated at 200 lines./branch— list branches, create and switch with/branch <name>, or checkout an existing one with/branch checkout <name>./worktree— list, add, and remove git worktrees directly from the REPL./pr— generates a PR title and body with the model, previews them, and callsgh pr createon confirmation.
- Auto-loaded memory —
CODESHARP.md,.codesharp/MEMORY.md, and all.codesharp/memory/*.mdfiles are included in the system prompt automatically at session start. /memory— lists memory files;/memory <name>shows the content of a specific file. Edit files in.codesharp/memory/to persist facts across sessions.- Session compaction —
/compactsummarizes old messages via the model and rebuilds the session history to stay within context limits while preserving recent turns.
- Parallel read-only analysis —
read_file,glob_search,grep_search,find_symbol,find_references, and task tools run in parallel within a single assistant step. - Symbol and reference search —
find_symbolandfind_referencescover C#, TypeScript, Python, C/C++, and HTML across the whole workspace without a language server. /symbols <name>and/refs <name>— symbol and reference search directly from the REPL with formatted output.- Gitignore-aware search —
glob_searchandgrep_searchrespect.gitignoreand skipbin,obj,.git,node_modules, and similar noise folders.
- Live streaming — assistant text streams into the UI while the model is still thinking, reducing dead time between tool calls.
- Slash command suggestions — typing
/shows live-narrowing command completions. - Colored diff previews — file edits show a green/red inline diff inline in the activity log.
- Queued prompts — type while the model is thinking; the next prompt is queued and sent automatically when the current turn finishes.
- Interrupt flow —
Ctrl+Ccancels the active turn first; a second interrupt exits. - Session export —
/export [path]saves the full session transcript as a markdown file.
The system prompt now follows the same structure as Claude Code's leaked guidelines:
- Doing tasks — no scope creep, no added comments on untouched code, no speculative abstractions, no error handling for impossible cases.
- Output style — lead with the answer, not the reasoning; no filler; file references use
path:lineformat. - Git workflow — conventional commits, no force-push to main, PR format.
- Planning mode — when to use
EnterPlanMode, what to produce, when to exit. - Security — no command injection, XSS, SQL injection, or path traversal; validate only at system boundaries.
CodeSharp.sln
src/
├── CodeSharp.Core/ # Core runtime, session, permissions
├── CodeSharp.Api/ # HTTP client, API providers
├── CodeSharp.Tools/ # Tool registry and execution
├── CodeSharp.Plugins/ # Plugin management
├── CodeSharp.Lsp/ # LSP integration
├── CodeSharp.Commands/ # Slash commands
├── CodeSharp.Cli/ # Main CLI application
└── CodeSharp.Server/ # HTTP server for sessions
dotnet run --project src/CodeSharp.Clidotnet run --project src/CodeSharp.Cli -- "Explain this codebase"dotnet run --project src/CodeSharp.Cli -- --provider nvidia -p "What does this function do?"The default model is currently moonshotai/kimi-k2.5, routed through the NVIDIA provider unless you override it.
You can build a standalone single-file binary with dotnet publish.
dotnet publish src/CodeSharp.Cli/CodeSharp.Cli.csproj \
-c Release \
-r osx-arm64 \
--self-contained true \
/p:PublishSingleFile=truedotnet publish src/CodeSharp.Cli/CodeSharp.Cli.csproj \
-c Release \
-r osx-x64 \
--self-contained true \
/p:PublishSingleFile=truedotnet publish src/CodeSharp.Cli/CodeSharp.Cli.csproj \
-c Release \
-r linux-x64 \
--self-contained true \
/p:PublishSingleFile=truedotnet publish src/CodeSharp.Cli/CodeSharp.Cli.csproj \
-c Release \
-r win-x64 \
--self-contained true \
/p:PublishSingleFile=trueThe published binary ends up under:
src/CodeSharp.Cli/bin/Release/net10.0/<RID>/publish/
If you prefer a framework-dependent build instead of bundling the runtime, replace --self-contained true with --self-contained false.
CodeSharp now uses a few distinct config and state files. They serve different purposes:
~/.codesharp/settings.jsonGlobal defaults for the CLI. This is wherecodesharp configstores your preferred provider, model, and provider-specific API keys../.codesharp/settings.jsonProject-local config created bycodesharp init. Repo-local settings including plugin config../CODESHARP.mdProject instructions for the agent. Included in the system prompt at session start. Define coding conventions, repo context, or workflow notes here../.codesharp/MEMORY.mdMemory index. Each line should be a pointer to a memory file. Included in the system prompt automatically../.codesharp/memory/*.mdIndividual memory files (user, feedback, project, reference types). All.mdfiles in this folder are loaded into the system prompt at session start. Use/memoryin the REPL to browse them../.codesharp/sessions/session-*.jsonSaved conversation/session files for prompt and REPL runs../.codesharp-todos.jsonTodo state written by the internal plan/todo tool.
CLI flags still win over stored defaults. For example, --model and --provider override values from ~/.codesharp/settings.json for that run.
{
"Model": "moonshotai/kimi-k2.5",
"Provider": "nvidia",
"ApiKeys": {
"Nvidia": "nvapi-..."
}
}Run this once inside a repo to create the local project files:
codesharp initThat creates:
.codesharp/settings.jsonCODESHARP.md
Interactive menu:
codesharp configNon-interactive examples:
codesharp config show
codesharp config set provider nvidia
codesharp config set model moonshotai/kimi-k2.5
codesharp config set api-key nvidia
codesharp config unset model| Flag | Description |
|---|---|
-p |
Run a single prompt and exit |
--model |
Model to use (default: moonshotai/kimi-k2.5) |
--provider |
API provider: anthropic, nvidia, openai, xai |
--permission-mode |
Permission mode: read-only, workspace-write, danger-full-access |
--allowedTools |
Comma-separated list of allowed tools |
--output |
Output format: text, json |
--version |
Show version |
--help |
Show help |
| Command | Description |
|---|---|
/help |
Show all commands |
/status |
Model, mode, permissions, token usage, git branch |
/model [name] |
Show or switch the active model mid-session |
/permissions [mode] |
Show or switch permission mode |
/plan |
Enter planning mode (blocks all mutating tools) |
/plan deep |
Enter deep planning mode |
/plan approve |
Approve plan and return to execute mode |
/plan exit |
Exit planning mode without approving |
/compact |
Summarize old messages to reduce context size |
/diff |
Show git status and colored diff |
/commit |
AI-generate a commit message and commit |
/branch [name] |
List branches or create and switch to a new one |
/branch checkout <name> |
Switch to an existing branch |
/worktree |
List git worktrees |
/worktree add <path> [branch] |
Create a new worktree |
/worktree remove <path> |
Remove a worktree |
/pr |
Generate a PR title/body and open via gh pr create |
/symbols <name> |
Find symbol declarations across the workspace |
/refs <name> |
Find symbol references across the workspace |
/memory |
List memory files in .codesharp/memory/ |
/memory <name> |
Show the content of a specific memory file |
/cost |
Show token usage and estimated cost breakdown |
/export [path] |
Save session transcript as markdown |
/clear --confirm |
Clear session history |
/config |
Interactive config menu |
/version |
Show version |

