Features How it works Docs Pricing Compare LeanCTX Discord

Your AI coding agent.
In the terminal.

LeanCTL is a terminal-native AI coding agent built in Rust. It reads, writes, tests, and commits your code — with built-in LeanCTX compression that reduces your token usage on every API call.

Install CLI
Built in Rust Bring your own key Runs locally, your data stays yours
0%
up to token savings
0
built-in tools
0
compression modes
0
data sent to us

The problem

AI coding tools are expensive.
And getting worse.

Every AI coding agent — Cursor, Claude Code, Windsurf — sends your files in full to the AI. A 300-line file costs 4,200 tokens. Read it again? Another 4,200. Run your tests? 847 lines of raw output dumped into the context window.

without compression
Read a file: 4,200 tokens
Run tests: 847 lines raw
Read it again: 4,200 tokens again
Typical session: ~$0.80
with LeanCTL
Read a file: 48 tokens (smart summary)
Run tests: 42 tokens (pattern match)
Read it again: ~13 tokens (from cache)
Typical session: ~$0.08

What if your agent compressed everything automatically?


Meet LeanCTL

A full AI coding agent — inside your terminal.

You type what you want in plain English. LeanCTL reads your codebase, writes the code, runs tests, and commits. Like Cursor or Claude Code — but terminal-native, keyboard-first, and compressed by default.

Who is it for?

Solo developers

You pay for your own API calls. Every token counts. LeanCTL turns your $50/month bill into $10.

Terminal enthusiasts

You live in the terminal. LeanCTL gives you a full AI experience without ever touching a GUI. SSH-friendly.

Open source maintainers

Compression means longer sessions and more context without blowing your budget across repos.

Built-in capabilities

Full-screen TUI

Inline diffs, syntax highlighting, live token streaming — all rendered natively with Ratatui.

7+ providers supported

Bring your own key for Claude, GPT, DeepSeek, Ollama, Groq, OpenRouter. Switch mid-session with /model.

Session memory

Every conversation persists locally (SQLite). Resume any session, search across all chats.

Git-native

Status, diff, and commit are built-in tools. The agent commits its own work automatically.

MCP support

Connect external tools, databases, and APIs via the Model Context Protocol.

Permission control

Every file write asks for permission with a diff preview. Or go full --yolo.

23 tools read_filebatch_readwrite_fileedit_filemulti_editdelete_filerename_filesearch_codesemantic_searchlist_filescontext_fillrun_commandgit_statusgit_diffgit_commitweb_searchweb_fetchrelated_filesproject_knowledgesavings_reportquestiontask+ MCP

How it works

Three steps. Five minutes.

Single binary — no Node, no Python, no Docker. Install, connect, code.

1

Install

One command. macOS, Linux, Windows. Single Rust binary, zero dependencies.

$ curl -fsSL leanctl.com/install.sh | sh
Installed leanctl v0.1.0
2

Connect your AI

Anthropic, OpenAI, DeepSeek, Ollama — your key, your control.

$ leanctl init
Provider? anthropic
API key? sk-ant-••••
Connected.
3

Start coding

Type what you want. LeanCTL handles the rest — compressed automatically.

$ leanctl
add user auth with JWT
5 tools $0.024 −42%

Powered by LeanCTX

Built on LeanCTX. Engineered for efficiency.

In LeanCTL, compression is compiled into the binary. Every file read, every shell command, every re-read — always compressed. No plugin, no configuration.

8 compression modes, each for a different scenario. The right mode is selected automatically based on file type, cache state, and task context.

fullCached read, re-read = ~13 tok
mapDeps + API surface
signaturesFunction signatures only
diffOnly changed lines
aggressiveStrip comments + whitespace
entropyShannon + Jaccard filter
lines:N-MExact line range
taskIntent-based filtering
342-line file → 48 tokens
F7=service.ts 342L
§ AuthService
deps: jwt, bcrypt, prisma
λ login(email, pwd) → Promise
λ register(data) → Promise
λ verify(token) → Promise
98.6% compression
847-line test output → 42 tokens
auth.test.ts 14 passed
routes.test.ts 8 passed
middleware.test.ts 6 passed
39/39 passed │ 0 failed │ 1.2s
95% compression

LeanCTL is proactive — it predicts what files the AI will need and preloads them before the first tool call.

Auto-Preload

Predicts relevant files and caches them before the AI starts working. Zero-latency context.

Batch Read + Dedup

Read 20 files in one call with automatic cross-file deduplication. Shared imports sent once.

Project Knowledge

Remembers architecture decisions across sessions. Contradiction detection flags conflicts automatically.

Auto-Compaction

Auto-compacts history — latest exchange verbatim, older turns summarized. Or trigger with /compact.

Smart Caching

First read cached. Every re-read returns a cache hit (~13 tokens) or a delta of only changed lines.

Auto-Checkpoint

Every 15 tool calls, session state is saved. Terminal crash? Resume exactly where you left off.

Before the AI sees a single token, LeanCTL classifies your message into one of 9 task types and tailors the thinking budget.

intent → thinking budget
Task Think Budget Output
generateMinimal1,024code only
fix bugMedium4,096diff only
debugTrace8,192cause→effect
reviewTrace8,192concise
exploreMinimal1,024concise
refactorMedium4,096diff only
testMinimal1,024code only
deployMinimal1,024step list
configMinimal1,024code only
result
80%
fewer thinking tokens
vs always-deep reasoning
Classification 85% accuracy Casual chat thinking off Mode auto / always / never

Three guardrails between your wallet and wasted tokens.

Loop Detection

Tool call fingerprinting. Same call 3× → throttled. 12× → blocked. Prevents runaway token burn.

Quality Guard

Four-metric check after every compression: AST, identifiers, lines, density. Score too low → automatic rollback.

LITM Optimizer

LLMs lose attention in the middle. LeanCTL places goals at the start and findings at the end — where attention peaks.

Lab-tuned defaults across 100+ benchmark iterations. Use /lab to tune and /benchmark to measure.

/lab — live tuning
/lab
Performance Tuning
━━━ User Parameters ━━━
crp_mode tdd
cache_ttl 300
autonomy true
checkpoint 15
/benchmark — token analysis
/benchmark src/main.rs
Benchmark: src/main.rs
raw3,420 tokens
signatures212 tok (−93.8%)
cache hit9 tok (−99.7%)

Why LeanCTL

The only agent with compression built in.

Other agents send everything raw. LeanCTL compresses every operation — automatically, always, without configuration.

Cursor / Claude CodeLeanCTX (MCP)LeanCTL
File readsRaw (full file)Compressed if usedAlways compressed
Shell outputRaw dumpCompressed if used90+ patterns
Re-readsFull cost againCached (~13 tok)Delta only
ThinkingFixed budgetN/AAuto-steered
Loop protectionNoneNoneAuto-throttle
Quality guardNoneNoneAST + ID check
MemoryNoneSession stateKnowledge base
Efficiency~2×3–5×

Works with

Claude SonnetClaude OpusGPT-4.1DeepSeek V3OllamaGroqany OpenAI-compatible

Your savings

Do the math. It pays for itself.

Drag the slider to your monthly API spend and see how much you'd save.

$80 /month on API calls
$10 $300
With LeanCTL you'd pay $28
LeanCTL subscription $9
Net savings / month $43

Pricing

Bring your own API key. We handle the rest.

LeanCTL doesn't provide AI — you connect your own API key from Anthropic, OpenAI, or any provider. We charge $9/month for the compression engine that makes your existing API calls cheaper.

Free

$0 forever
Local models only Ollama, LM Studio, llama.cpp All 23 tools Full compression engine Unlimited sessions /lab + /benchmark
Download

Pro

$9/mo(free during beta)
Everything in Free Use your own cloud API keys Claude, GPT, DeepSeek, Groq, OpenRouter — your key, your billing Connect any OpenAI-compatible API Thinking Steering (80% saved) Loop detection + Quality guard LITM attention optimizer Priority support

FAQ

Common questions.

What's the difference between LeanCTL and LeanCTX? +

LeanCTX is the open-source compression engine — it works as an MCP server that any AI tool can use. LeanCTL is a complete AI coding agent with LeanCTX compiled directly into its core. Every operation is automatically compressed, no configuration needed.

Do I need to change my AI provider? +

No. LeanCTL works with your existing API key — Anthropic, OpenAI, DeepSeek, Groq, OpenRouter, or local models via Ollama. You keep your provider and your billing relationship.

How does the free tier work? +

The free tier works with local models only (Ollama, LM Studio, llama.cpp). You get all 23 tools, full compression, and unlimited sessions — no time limit, no credit card. To use your own cloud API keys (Anthropic, OpenAI, etc.), you need Pro at $9/month.

What is Thinking Steering? +

LeanCTL classifies every prompt into 9 task types and adjusts the AI's reasoning depth automatically. Simple code generation uses 1,024 thinking tokens, complex debugging gets 8,192. This saves 80% of thinking tokens compared to always-deep reasoning.

Is my code sent to LeanCTL's servers? +

No. LeanCTL runs entirely on your machine. Your files, sessions, and history are stored locally. The only data that leaves your computer goes directly to your chosen AI provider — compressed, via your own API key.

Can I use LeanCTL alongside Cursor or VS Code? +

Yes. LeanCTL runs in your terminal — it doesn't replace your editor. Many developers use it alongside their IDE for tasks that benefit from terminal-native speed.


Install

One command. Ready in seconds.

macOS / Linux

curl -fsSL https://leanctl.com/install.sh | sh

Then register for the free Pro beta:

$ leanctl register

Ready to try it?

Install in seconds. Start free with local models or register for the Pro beta — all features, no credit card.

Install CLI