A .NET 10 reimplementation of Claude Code, written in C#.
Aexon is an interactive terminal coding assistant with an agentic tool loop, streaming responses, resumable sessions, and built-in automation for common engineering workflows.
The project is maintained for educational, interoperability, and security research work around agentic developer tooling. It is usable today, but you should still review permissions, hooks, and external tool access before running it against real codebases.
- Interactive REPL with streaming assistant responses
- Built-in tool loop for Bash, file read/write/edit, glob/grep, web fetch, and web search
- Subagents, background runs, mailbox management, and team orchestration commands
- Hooks and stdio MCP server loading from project or user settings
- Session resume, session forking, compaction, session memory, and token/cost tracking
- Cross-platform CI on Ubuntu, Windows, and macOS with formatting checks, tests, and an 80% total line-coverage gate
- Published on NuGet as the
Aexon.NET tool package
Recommended: install Aexon as a global .NET tool from NuGet.
dotnet tool install --global Aexon
aexon --helpUpdate an existing installation:
dotnet tool update --global AexonInstall into a local tool directory instead of your global PATH:
dotnet tool install --tool-path ./.tools Aexon
./.tools/aexon --helpIf you specifically want to download the NuGet package artifact, you can use the NuGet CLI:
nuget install Aexon -Source https://api.nuget.org/v3/index.json -OutputDirectory ./packagesnuget install downloads the package, while dotnet tool install is the command that gives you an executable aexon command on your machine.
- .NET 10 SDK (10.0.100+) for local builds and
dotnetCLI workflows - An Anthropic API key, provided through
ANTHROPIC_API_KEYor anappsettings*.jsonfile
Aexon resolves Anthropic settings in this order:
ANTHROPIC_API_KEY<working directory>/appsettings.secrets.json<working directory>/appsettings.json<app base directory>/appsettings.secrets.json<app base directory>/appsettings.json
appsettings.secrets.json is the recommended place for local secrets and is ignored by git in this repository.
Both of the following JSON shapes are supported:
{
"Anthropic": {
"apiKey": "YOUR_ANTHROPIC_API_KEY",
"baseUrl": "https://api.anthropic.com"
}
}{
"Aexon": {
"Anthropic": {
"apiKey": "YOUR_ANTHROPIC_API_KEY",
"baseUrl": "https://api.anthropic.com"
}
}
}Run from source:
dotnet restore Aexon.slnx
dotnet build Aexon.slnx --configuration Release
# Interactive mode
dotnet run --project src/Aexon.Cli
# Non-interactive prompt
dotnet run --project src/Aexon.Cli -- "explain this codebase"Run from an installed tool:
# Interactive mode
aexon
# Prompt mode
aexon "explain this codebase"
# Override working directory and model
aexon --cwd /path/to/project --model opus "summarize this repo"
# Resume the latest session
aexon --continueUnless --settings is provided, Aexon merges matching settings.json files from these locations:
~/.aexon/settings.json~/.claude/settings.json<working directory>/.aexon/settings.json<working directory>/.claude/settings.json
The current MCP implementation supports stdio servers and registers their tools dynamically at startup.
Aexon loads project instructions from these files when present:
CLAUDE.md.claude/CLAUDE.md.claude/rules/*.mdCLAUDE.local.md
Local verification:
dotnet restore Aexon.slnx
dotnet build Aexon.slnx --configuration Release --no-restore
dotnet format Aexon.slnx --verify-no-changes --no-restore --severity error
dotnet test Aexon.slnx \
--configuration Release \
--no-restore \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=json \
/p:CoverletOutput=TestResults/coverage-ci/ \
/p:Threshold=80 \
/p:ThresholdType=line \
/p:ThresholdStat=totalGitHub Actions runs the same checks on push and pull request, across Ubuntu, Windows, and macOS. Coverage results are uploaded as workflow artifacts for each OS job.
src/
├── Aexon.Cli/ # Entry point, REPL shell, CLI option parsing
├── Aexon.Core/ # Query engine, agents, hooks, MCP, permissions, context, storage
├── Aexon.Tools/ # Built-in tools, web tools, and subagent-facing tools
└── Aexon.Commands/ # Slash commands such as /agents, /mailbox, /team, /compact
| Option | Description |
|---|---|
--cwd <path> |
Set the working directory for the session |
--model <name> |
Model name or alias (sonnet, opus, haiku) |
--resume <session> |
Resume a specific session by id, directory, manifest, or transcript path |
--continue |
Resume the most recently updated session |
--fork-session |
Fork the resumed transcript into a brand new session |
--settings <path> |
Load hooks and MCP servers from a specific settings.json |
--mcp-config |
Alias for --settings |
--help |
Show help |
<prompt> |
Initial prompt; omit for interactive mode |
/help,/clear,/exit,/cost,/model/session,/mode,/title,/tag/compact,/microcompact,/pcompact,/session-memory/agents,/agents summary,/agents list,/agents wait,/agents tail,/agents prune,/agents stop/mailbox/team,/team create,/team show,/team dissolve
| Package | Purpose |
|---|---|
| Anthropic SDK 12.9.0 | Claude API client |
| Microsoft.Extensions.FileSystemGlobbing 10.0.0 | Glob-based file discovery |
| Spectre.Console 0.54.0 | Terminal UI rendering |
| Microsoft.Extensions.DependencyInjection 10.0.5 | DI container |
The core loop in QueryEngine follows a standard agentic pattern:
- Build the system prompt from environment, tools, memory, and runtime context
- Send the conversation to the Claude API
- Stream the assistant turn, with a buffered fallback available
- Execute requested tools with local permission checks
- Append tool results to the conversation
- Repeat until the model stops calling tools
All I/O is async (IAsyncEnumerable<QueryEvent>) so the REPL can stream output progressively.
Released under the MIT License.