Skip to main content

LansCoder

A local coding agent you can read end to end.

Python 3.11+ MIT License

LansCoder TUI screenshot

What is it?

LansCoder is a locally-runnable Python coding agent. It understands your codebase, edits files, and runs shell commands — like Claude Code or Aider. But its core design goal isn't feature volume; it's understandability.

~30,000 lines of Python, clean module boundaries, solid test coverage. Real enough to use daily, small enough to read from end to end.

96.38% reward pass@1 on the Harbor Aider Polyglot benchmark.

Highlights

  • Small, so you can read it — ~30k lines of Python, not 570k lines of TypeScript. Every module's job is obvious.
  • Built to learn from — strict layering, clear dependency rules. Great for studying how coding agents work, for hacking on, or for interview prep.
  • Actually usable — 40+ built-in tools, multi-provider support, MCP integration, session persistence, context compression. Not a toy.
  • Preview before you write — syntax-highlighted diffs shown before every file change, even in high-permission mode.

Quick start

Choose your preferred install method:

Shell (one-liner, all platforms):

curl -sSL https://raw.githubusercontent.com/Lanstzz/LansCoder/main/install.sh | bash

Homebrew (macOS):

brew tap lanstzz/tap
brew install lanscoder

pipx (all platforms):

pipx install lanscoder

After installation, run lanscoder config init to generate a config file, then edit it with your API key:

  • macOS / Linux: ~/.config/lanscoder/config.toml
  • Windows: C:\Users\<username>\.config\lanscoder\config.toml

Example config:

default_model = "deepseek/deepseek-v4-flash"

[providers.deepseek]
type = "openai-compatible"
base_url = "https://api.deepseek.com"
api_key = "sk-xxx"

[models."deepseek/deepseek-v4-flash"]
label = "DeepSeek V4 Flash"
context_window = 1000000

[permissions]
mode = "ask"

[ui]
theme = "default"

Then launch from your project directory:

lanscoder

Development setup:

python -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/python -m pytest

Features at a glance

Capability What it does
Coding agent Understands code, edits files, runs shell commands, 40+ built-in tools
Multi-model OpenAI-compatible and Anthropic providers, hot-switchable mid-session
Permissions Standard / aggressive / bypass modes, diff preview before every mutation
TUI Textual-based terminal UI, streams reasoning, tool calls, and results in real time
Sessions Create, resume, fork, share — persisted as JSONL
Context compression 4-level pipeline (L1–L4) to manage token usage in long conversations
Background subagents Subagents run independently in the background, notify on completion
MCP integration Connect external tool servers via Model Context Protocol

Architecture

lanscoder/
├── app/           Textual TUI
├── agent/         Agent loop and orchestration
├── providers/     Model provider adapters
├── tools/         Tool registration and execution (40+ tools)
├── permissions/   Policy and grant management
├── context/       Event log and context management
├── session/       Session lifecycle
├── mcp/           MCP protocol integration
├── memory/        Cross-session persistent memory
├── skills/        Local skill discovery and loading
├── config/        TOML configuration
└── utils/         Shared utilities

Who is it for?

  • Developers who want to deeply understand how coding agents work
  • People looking to extend or modify a Python-based coding agent
  • Anyone who needs a project they can explain architecturally for interviews or portfolios
  • AI enthusiasts who want to experiment with different models locally

Contributing

Issues and PRs are welcome. Tests cover most core modules — please make sure they pass before submitting.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lanscoder-1.0.1.tar.gz (291.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lanscoder-1.0.1-py3-none-any.whl (380.7 kB view details)

Uploaded Python 3

File details

Details for the file lanscoder-1.0.1.tar.gz.

File metadata

  • Download URL: lanscoder-1.0.1.tar.gz
  • Upload date:
  • Size: 291.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for lanscoder-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b049f2b47d88a901b3b5ee58bd34deba6cb93c1d6ea7b79fb788858b02b3cfbc
MD5 971d26d41120534c51127016fb24ae59
BLAKE2b-256 d97f12c81363e2af82b59716200de39c1792afffd5765de0a5e5ffa986c4a78a

See more details on using hashes here.

File details

Details for the file lanscoder-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: lanscoder-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 380.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for lanscoder-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ccf9c5a8b8e8964576a61bd91a36e3531cf410074c503bb629205506997e30c
MD5 6fe8b0585f2e7b5bf80c232ee76992d9
BLAKE2b-256 3fe547684848aa4460d45046d9e1a1acd9c16654b565ee05ac0e9cc793c2896f

See more details on using hashes here.

Release history Release notifications | RSS feed

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page