# Litos: Building a Minimal AI Coding Agent, from Scratch in pure C#/.NET

> Source: <https://dev.to/nitinmms/litos-building-a-minimal-ai-coding-agent-from-scratch-in-pure-cnet-a6j>
> Published: 2026-08-05 08:43:51+00:00

Hi dev.to, this is my first post here.

I've been writing C#/.NET for 23+ years, and over the last month or so I've been building **Litos** — a small, transparent AI coding agent, written entirely in pure C#/.NET. No Python or Typescript.

The goal wasn't to compete with the big coding agents out there, it was to actually understand how one works, from the inside, by building it myself.

This post is just the basics: what an "agent loop" is, and how 'Litos' AI Coding Agent is put together.

At the core of any AI coding agent is a surprisingly simple. A "turn" starts when you send a message, and then the agent just keeps going — asking the model for a response, running any tools the model asks for (like reading a file, editing code, or running a shell command), feeding the results back to the model, and repeating — until the model comes back with a plain answer and no more tool calls to make.

That's it.

That loop, repeated with an ever-growing transcript (context) of what's happened so far, is what lets the model read your code, make edits, run commands, and check its own work.

I divided the project into three parts, inspired by [Tau](https://github.com/alejandro-ao/tau)'s "brain, environment, face" split, and by Mario Zechner's [pi](https://pi.dev):

`Litos.Agent`

) — the core loop, the transcript, and context management. It doesn't know or care whether it's talking to Anthropic, OpenAI, or Gemini, or whether it's running in a terminal or a desktop app.`Litos.Tools`

, `Litos.Providers.*`

) — the actual capabilities: file editing, shell access, web search, and the calls to whichever LLM provider you've configured.`Litos.Gui`

, `Litos.Api`

,`Litos.Console`

) — the thin UI layer.An Avalonia desktop app, and an HTTP/API host (with a working Telegram bridge) and a terminal UI all drive the exact same loop underneath.Keeping those separate has made it much easier to reason about — and to add a new provider or a new UI without touching the core loop at all.

I've got two short videos showing it working end to end:

It's all open source: [github.com/nitinmms/LitosAiCodingAgent](https://github.com/nitinmms/LitosAiCodingAgent)

It's still very much a work in progress — some pieces (like the console UI and a couple of the provider adapters) are unfinished, and the README is upfront about that. But the Desktop coding agent and the desktop/Telegram experiences work today.

I'll follow up with more detail posts on individual pieces (context management, MCP support, etc.) if there's interest.

Feedback welcome!
