██╗ ███████╗ █████╗ ███╗ ██╗ ██████╗████████╗██╗
██║ ██╔════╝██╔══██╗████╗ ██║ ██╔════╝╚══██╔══╝██║
██║ █████╗ ███████║██╔██╗ ██║ ██║ ██║ ██║
██║ ██╔══╝ ██╔══██║██║╚██╗██║ ██║ ██║ ██║
███████╗███████╗██║ ██║██║ ╚████║ ╚██████╗ ██║ ███████╗
╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚══════╝
Context-Engineered AI Coding CLI
The Only Coding CLI That Steers How Much Your LLM Thinks — Powered by lean-ctx
40+ Tools · Thinking Steering · Hybrid Semantic Search · Symbol Intelligence · Multi-Provider
Website · Install · How It Works · Features · Providers · Changelog · Discord
leanctl is a terminal-native AI coding agent that automatically steers LLM thinking budgets based on task complexity — so simple tasks stay fast and cheap, while complex tasks get the deep reasoning they need.
User: "fix the typo in line 42"
→ Intent: TaskType::QuickFix
→ Budget: Minimal (1024 tokens)
→ Result: Fast, cheap, accurate
User: "debug why the distributed cache eviction is wrong"
→ Intent: TaskType::Debug
→ Budget: High (8192 tokens)
→ Result: Deep analysis, thorough investigation
User: "redesign the auth architecture for microservices"
→ Intent: TaskType::Architecture
→ Budget: Maximum (16384 tokens)
→ Result: Comprehensive design with trade-offs
| Task Type | Thinking Budget | Token Savings vs Max |
|---|---|---|
| Quick fixes, renames, formatting | Minimal (1K) | 94% |
| Bug fixes, small features | Low (2K) | 88% |
| Debugging, refactoring | Medium (4K) | 75% |
| Architecture, complex analysis | High-Max (8-16K) | Optimal |
Lab-proven: Thinking steering reduced output tokens by 54-95% and thinking tokens by 48-100%.
# macOS / Linux — one-liner
curl -fsSL https://leanctl.com/install.sh | sh
# npm (all platforms)
npm install -g leanctl-bin
# Arch Linux (AUR)
yay -S leanctl-bin
# Upgrade existing installation
leanctl upgrade# 1. Configure your AI provider (interactive)
leanctl init
# 2. Start coding
cd your-project
leanctl| Category | Tools | What They Do |
|---|---|---|
| File Intelligence | read_file, file_outline, symbol_lookup |
Read files, get outlines, look up symbols by name |
| Code Navigation | find_callers, find_callees, search_code |
Navigate call graphs, find references |
| Semantic Search | semantic_search (hybrid) |
BM25 + dense vector search with language filters |
| Architecture | extract_routes, graph_diagram, related_files |
HTTP endpoints, Mermaid diagrams, dependency analysis |
| Editing | write_file, edit_file, multi_edit |
Precise code modifications |
| Shell | run_command |
Compressed output with 90+ patterns |
| Memory | project_knowledge, compress_memory |
Cross-session knowledge, markdown compression |
| Multi-Agent | agent_coordination, task |
Agent bus, sub-agent spawning |
- 8 read modes —
full,map,signatures,diff,aggressive,entropy,lines:N-M,reference - Session caching — re-reads cost ~13 tokens instead of thousands
- 90+ compression patterns — git, npm, cargo, docker, test runners
- Adaptive compression — Thompson Sampling bandits learn optimal settings per language
| Provider | Models | Thinking Steering |
|---|---|---|
| Anthropic | Claude 4, Claude 3.5 Sonnet | ✅ budget_tokens |
| OpenAI | GPT-4.1, o3, o4-mini | ✅ reasoning_effort |
| Gemini 2.5 Pro/Flash | ✅ thinking_budget |
|
| Ollama | Any local model | — |
Pre-built binaries for every release:
| Platform | Binary | Checksum |
|---|---|---|
| macOS Apple Silicon | leanctl-aarch64-apple-darwin.tar.gz |
✅ SHA256 |
| macOS Intel | leanctl-x86_64-apple-darwin.tar.gz |
✅ SHA256 |
| Linux x86_64 | leanctl-x86_64-unknown-linux-musl.tar.gz |
✅ SHA256 |
Linux binaries are statically linked (musl) — they work on every Linux distribution.
- Website: leanctl.com
- Core Engine: lean-ctx — MIT-licensed, fully open source
- Discord: Join the community
- X/Twitter: @leanctx
LeanCTL is proprietary software. The binary is free to use for personal and commercial projects.
The underlying engine lean-ctx is MIT-licensed and fully open source.