Skip to content

About

Lightweight AI Coding Harness, focused on context efficiency, durable concurrent tasks and workers that survive compaction, whether working local or over ssh, or switching between both on the fly.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

lean-coder

A small terminal coding agent: stdlib-only Python core, minimal context overhead.

lean-coder auditing and fixing a real bug on a local model

Install

Requires Python 3.11+ and curl or git.

curl -fsSL https://raw.githubusercontent.com/codemonkeying/lean-coder/main/install.sh | bash

Android / Termux:

pkg install -y python curl && curl -fsSL https://raw.githubusercontent.com/codemonkeying/lean-coder/main/install.sh | bash

Options: --with-ollama --pull (local Ollama on Linux), --dry-run. The installer adds ~/.local/bin to PATH in your shell rc if it isn't there. Update with lean_coder --update or /update.

Uninstall: ~/lean-coder/uninstall.sh (or ./uninstall.sh in a clone) lists what it will remove and asks first. By default that includes ~/.config/leancoder - settings, sessions and auth tokens; pass --keep-config to keep them. install.sh --uninstall does the same with --keep-config.

From a clone:

git clone https://github.com/codemonkeying/lean-coder
cd lean-coder && python3 lean_coder.py

Quick start

lean_coder                                  # start in the current project
lean_coder --host http://HOST:11434         # remote Ollama

Inside: /provider picks a backend, /model a model, /leash sets what the agent may do (read only, edit, or edit and run commands), /approve sets which actions ask you first, /connect works on a remote box over SSH, /help lists everything. Config lives in ~/.config/leancoder/config.toml.

Providers: Ollama, llama.cpp and MLX (local), plus OpenAI, Anthropic API, Gemini, Groq, OpenRouter, Kilo and OVH (API key). Add your own with a small plugin file.

Extending

  • Lean-tools: optional tools (web fetch, SSH, view, ...) you switch on with /tools; each one adds its schema to the prompt only when enabled.
  • MCP: connect external tool servers that speak the Model Context Protocol.
  • Workers: the agent can start background sub-agents for side tasks and coordinate them on a task board.

Context overhead

Tokens the tool definitions add to every request (the test suite enforces these limits):

Surface Max tokens
Always-on (core tools) 2500
Every bundled lean-tool enabled 6500

Reference

License

Copyright (c) 2026 codemonkeying. All rights reserved.

No licence is granted to use, copy, modify or distribute this software. Releases up to and including 0.10.103 were published under MIT, and 0.10.104 to 0.10.124 under Apache-2.0; copies of those releases keep those licences.

About

Lightweight AI Coding Harness, focused on context efficiency, durable concurrent tasks and workers that survive compaction, whether working local or over ssh, or switching between both on the fly.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages