Micro Coding Agent for Local LLMs
Single-file Node.js CLI • Zero dependencies • GitHub →
⚠ Beta — In active early development. The tool interface is stable, but CLI options and config flags may refine before v1.0.
Frontier API tokens feel practically infinite today, but that won't last forever. As AI dev tools scale, token budgets, strict rate limits, and shrinking free tiers are bound to become standard enterprise policy.
What's more, local models are far more capable than their size suggests — especially with MLX acceleration on Apple Silicon. Even a 3B model is fast enough to breeze through these smaller tasks, so there's no reason to spend a frontier token on them at all.
μ-code was built around a simple split: top-tier models act as architects, using their large context windows and strong reasoning to plan and map out changes; μ-code acts as the local worker, handling small, single-file, atomic tasks with fast open-weight local models. We're building and battle-testing μ-code today so that when strict token caps hit, your local workflow is already locked in. Zero API costs, zero rate limits, and no context bloat for small file edits.
Top-tier models plan and reason. μ-code executes atomic edits locally with fast open-weight models.
Only Node.js core — no npm, no binaries beyond ripgrep. Runs anywhere Node 18+ does.
Built for when token budgets tighten. Your local workflow is ready — no API fees, no rate limits.
The same binary works standalone or as a delegated sub-agent.
Run mu interactively or one-shot with -p. You drive it directly — set goals, read/edit files, approve diffs.
Delegate from a host AI (opencode, Claude Code, Codex CLI) via the mu-code-delegate skill. Host reasons and plans; μ-code executes.
μ-code gives the model four tools. Every mutation shows a diff and requires approval.
Shell commands — mainly rg -n to locate lines. 30s timeout, 10MB buffer.
Read text files by line range. Binary detection built in.
Replace lines by number. LCS diff before approval. Never reproduces full files.
Write or append content. Creates directories automatically.
Standard Agent Skills for the architect + worker pattern. Your host AI reasons; μ-code executes.
| mu-code-delegate | Delegate atomic edits. Host reasons, μ-code executes. |
| mu-code-config | One-time setup of ~/.mu-code/config.json. |
Install to any tool supporting .agents/skills/: opencode · Claude Code · Pi · Codex CLI VS Code/Copilot · Cursor · Windsurf git clone https://github.com/hrhrprasath/mu-code.git cd mu-code ./install.sh Workflow: 1. Host AI reasons — searches, plans, finds line numbers 2. Host delegates — runs mu -g "goal" -p "instructions" 3. μ-code executes — reads, edits, shows diffs 4. Host verifies — checks result, moves to next step
Architect + worker benchmarked on the same MiniKV task with three local models — 19/19 pytest tests pass, 0 lines written by the architect.
| ornith:9b | 18m 24s · 2 bugs · ~50–65% token savings |
| gemma4:12b-mlx | ≈48 min · 0 bugs, clean 1st pass · ~50–60% |
| granite4.1:3b | ≈20 min · 3 bugs · ~55–65% pure / ~35–50% realized |
Bigger models write cleaner code, but slower. μ-code offloads ~50–65% of billed main-context tokens — 100% locally.
curl -L https://raw.githubusercontent.com/hrhrprasath/mu-code/main/mu \ -o /usr/local/bin/mu && chmod +x /usr/local/bin/mu
Create ~/.mu-code/config.json:
{
"model": "llama3.2:3b",
"ai_base_url": "http://localhost:11434/v1",
"num_ctx": 8192,
"auto_approve": false,
"think": false
}
Then run mu -f src/main.go.
| /goal | Show current session goal |
| /goal <text> | Update session goal |
| /debug | Show estimated prompt token breakdown |
| /exit / /quit | Exit |
| ``` | Multi-line input |
One file, one concern, one tool call at a time.
No LSP or symbol index — just ripgrep.
Tight line ranges after rg pinpoints the location.
Write a skeleton, then fill in with edits.
Never assume, never retry a failing call blindly.
No servers, watchers, or background processes.
No project-wide crawling or multi-file orchestration.
Designed for local models with 4k–8k context.
Search is rg-only. No find-references or definitions.
No Windows support currently.