Open-source memory server that lets AI coding agents like Claude Code and Cursor recall past sessions, with local-first search.

LeanCTX
Open-source context gateway that trims what AI coding tools read, caches repeat reads and logs what each agent was given.
What is LeanCTX?
LeanCTX is a context gateway for AI systems that sits between your coding agents and the files, commands and search results they consume. The Apache-licensed Engine runs locally and exposes ten MCP tools plus a command-line interface, so an agent can read files in several compressed modes, list project structure compactly, run shell commands with trimmed output and search code without loading whole files. Session-aware caching means a file already sent is not sent again, and the Engine also keeps memory, usage receipts and recovery data. A hosted tier adds personal sync, and a team server shares one index, role-based tokens, per-role budgets and an audit log across developers and CI agents. Enterprise adds identity, policy and reporting, and an SDK is offered for embedding. The Community plan is free, Pro costs $9 per month, and Team costs $29 per month per seat.
Use cases
- Cut token use in AI coding sessions
- Compress shell output before it reaches a model
- Share one code index across a dev team
- Cap AI spend with per-role token budgets
- Audit what agents read in your repos
- Search a codebase without reading whole files
Who it's for
Why use LeanCTX
- Re-reading a file that is already cached costs about 13 tokens, which keeps long agent sessions from paying for the same code twice.
- The Community plan works locally with no account, so you can try it before paying for sync or team features.
- A shared team server lets every developer and CI agent query one index instead of each rebuilding its own.
- Role-based tokens, budgets and an append-only audit log make AI spend and file access something you can show to others.
- Your own models and tools stay in place, since it only manages the context between them.
LeanCTX features
- ctx_read with six read modes and line ranges
- Cache hits for files already read in a session
- Tree-sitter signature extraction for 14 languages
- Shell output compression with 75+ patterns
- Compact directory trees and token-light code search
- Context checkpoints for long conversations
- Benchmarking and entropy analysis of files
- Terminal dashboard of lifetime token savings
- Team server with role-scoped tokens and audit log
- Per-role token budgets
LeanCTX integrations
How to get started with LeanCTX
- Install LeanCTX and run the init command, with the global option if you want shell aliases for tools such as git, npm and docker.
- Point your MCP client at LeanCTX so the agent calls its read, search, tree and shell tools instead of raw file and command access.
- Choose a read mode per task, from full content with caching to signatures, maps or changed lines only.
- Check savings with the metrics and gain commands, then add Pro sync or a Team server if you need shared context.
LeanCTX limitations
- Team plan is for 1 to 25 seats
- Model and infrastructure costs are billed separately from LeanCTX
- SDK embedding and OEM use need a separate signed agreement
- Enterprise scope depends on the licensed release and a written agreement
LeanCTX pricing
Yes, LeanCTX has a free plan. Paid plans start at $9 per month, according to the official pricing page on .
LeanCTX plans
Community
$0
Free, forever
- Sources, search and every read mode
- Local safety, reference routing and budgets
- Cache, memory, receipts and recovery
Pro
$9/month
or $90 per year
- Personal Cloud sync and backup
- 1 GB hosted index
- All Community features
Team
$29/month per seat
or $290 per year per seat
- Hosted team server, shared workspace
- Role-based access, OIDC single sign-on, audit log
- 20 GB shared hosted index
- 1 to 25 seats
Enterprise
Custom
Annual agreement
- Organization identity, roles and access controls
- Shared policy, approvals, audit and reporting
- Deployment, recovery and operating support
Plans as listed on the official pricing page on . Prices can change and may vary by country or exclude tax. Check the official pricing page.
LeanCTX alternatives
The main LeanCTX alternatives listed on Debuly are Headroom, Helicone, Bifrost, LiteLLM, Portkey and Source Trace. The table compares pricing and platforms; order is A–Z.
| Tool | Pricing | Starting price | Platforms |
|---|---|---|---|
| LeanCTX | Freemium | $9/mo | CLI, Self-hosted, API |
| Bifrost | Open source | — | Self-hosted, CLI, API |
| Headroom | Open source | — | Python, TypeScript, CLI, Docker |
| Helicone | Freemium | $79/mo | Web, API, Self-hosted |
| LiteLLM | Open source | — | Python, API, Self-hosted, CLI |
| Portkey | Freemium | $49/mo | Web, API, Self-hosted |
| Source Trace | Free | — | VS Code extension, Web |

Bifrost
Open-source AI gateway from Maxim with one OpenAI-compatible API across providers, failover, budgets and an MCP gateway.
Open sourceVisit Bifrost (official site)Headroom
Open-source context compression for LLM apps and coding agents that trims tool output, logs, files and RAG results before the model reads them.
Open sourceVisit Headroom (official site)
Helicone
Open-source LLM observability and AI gateway that logs requests, tracks cost and latency, and routes to 100+ models through one API.
FreemiumVisit Helicone (official site)LiteLLM
Open-source AI gateway and Python SDK that gives one OpenAI-format API to 100+ LLM providers, with keys, budgets and cost tracking.
Open sourceVisit LiteLLM (official site)
Portkey
AI gateway with observability, guardrails, caching and prompt management for teams running LLM apps in production.
FreemiumVisit Portkey (official site)Source Trace
VS Code extension and team dashboard that measure how much code your AI coding tools write, how much survives to commit, and which models earn their cost.
LeanCTX FAQ
How much does LeanCTX cost?
Community is free forever at $0. Pro costs $9 per month or $90 per year. Team costs $29 monthly or $290 yearly for each seat. Enterprise is sold on an annual agreement. Prices are in USD.
Is there a free LeanCTX plan?
Yes. Community runs the open-source Context Gateway locally with sources, search, every read mode, safety rules, budgets, cache, memory and recovery. No account is needed.
What does the LeanCTX Team plan include?
Team is for 1 to 25 seats. It brings a 20 GB shared hosted index, an audit log, OIDC single sign-on, role-based access, a shared workspace and a hosted team server.
Is LeanCTX open source?
The Engine is Apache-licensed and can run locally. The SDK and Engine artefacts carry separate licences, and embedding or redistribution requires a signed commercial agreement.
Does LeanCTX work with MCP?
Yes. It provides 10 MCP tools along with a command-line interface, so MCP-capable coding agents can call it for reads, search, shell commands and metrics.
What are alternatives to LeanCTX?
Related tools for trimming or governing LLM context and traffic include Headroom, Helicone, Bifrost and LiteLLM.
Sources & verification
Facts on this page come from the official sources below, each with the date we read it. Written by Debuly; the vendor did not review this page.
| Source | Type | Accessed |
|---|---|---|
| leanctx.com | official | |
| github.com/yvgude/lean-ctx | repository | |
| leanctx.com/pricing/ | pricing | |
| leanctx.com/features/ | official | |
| leanctx.com/teams/ | official | |
| leanctx.com/enterprise/ | official |
Image credits
- Logo: from leanctx.com · fetched · Vendor trademark, used only to identify the product; removed on request
- Cover: none collected yet, so a generated tile is shown.
Spot an error? Report an issue with this listing. We also remove a logo or image on the owner's request.

