# LocalCodeForge

> A fully-local AI coding agent kernel for C#/.NET that plans, writes, builds, fixes compile errors and verifies projects using a 30B model on your own GPU.

LocalCodeForge is an open-source, MIT-licensed coding agent kernel for C#/.NET published by BMDPLAinsong on GitHub. It runs a Qwen3-Coder-A3B 30B model locally through Ollama, so code stays on the user's machine. It plans multi-file tasks, writes code, builds and runs the project, fixes compile errors and rolls back on repeated failure. The latest listed release is v1.0.0.

## What It Is

LocalCodeForge is a local AI coding agent for C#/.NET projects. The user points it at a project in write mode and describes a task in natural language, such as adding a service class that reuses existing services and wiring it into Program.cs. The agent handles planning, code generation, building, error repair and verification without a cloud service.

## How the Fix Loop Works

The README describes a data-injected approach instead of relying on a large system prompt. Before generation, the kernel injects type inventories with member signatures and access modifiers, plus symbol indexes. A deterministic rule-based classifier routes the intent. The pipeline then runs as follows:

- A planner produces a multi-file plan with a run/verify spec.
- An executor writes the files.
- The kernel runs dotnet build and dotnet run.
- On a compile error, it locates the offending file and runs a fix round.
- After repeated failure, it rolls back to the pre-task state using task-id isolated backups, with a dry-run preview.

A pre-write type-conflict guard blocks changes when the model tries to rewrite existing types.

## Dashboard and Setup

The CLI auto-launches a local web dashboard (loopback plus token auth) on startup. It shows live task streams over SSE, stats, history, backup diffs, rollback and one-click rerun. Events are stored in SQLite. The stack uses .NET 10, Semantic Kernel 1.80.1 and a Qwen3-Coder-A3B 30B model served by Ollama. Setup is to pull the model tag, build the solution with dotnet, and run the CLI project.

## Features
- Fully local operation with no code leaving the machine
- Plans, writes, builds, fixes compile errors and verifies C#/.NET projects
- Type inventory and signature injection before code generation
- Compile-error localization to the exact file (LocateErrorFile)
- Automatic rollback with task-id isolated backups and dry-run preview
- Deterministic rule-based intent classifier
- Pre-write type-conflict guard
- Local web dashboard with live task streams, history, backup diff, rollback and rerun
- CLI fallback
- SQLite storage for sessions, symbols, memory, metrics and events

## Integrations
Ollama, Semantic Kernel, SQLite, Qwen3-Coder-A3B

## Platforms
WINDOWS, WEB, API, CLI

## Pricing
Open Source

## Version
v1.0.0

## Links
- Website: https://github.com/BMDPLAinsong/LocalCodeForge
- Repository: https://github.com/BMDPLAinsong/LocalCodeForge
- EveryDev.ai: https://www.everydev.ai/tools/localcodeforge
