Static prompts → Dynamic context pipelines
Instead of a fixed system prompt, context engineering builds a pipeline that assembles the right context for each task, reading only what's relevant, at the right compression level, with the right metadata.
Concept
It's the shift from prompt engineering to context operations, the discipline of designing, compressing, and governing the full information environment your AI agent works in. LeanCTX is that discipline, automated — the context engineering layer for AI agents.
Prompt engineering optimized the input. Context engineering optimizes the environment.
When AI agents were limited to single-turn interactions, prompt engineering was sufficient. You crafted the right instruction, the model returned a useful response, and the workflow ended.
Modern AI coding agents operate differently. They run multi-step workflows across dozens of files, maintain state across sessions, and make decisions that compound over time. The prompt is no longer the bottleneck, the context is.
A coding agent with a perfect prompt but poor context will hallucinate file paths, lose track of prior decisions, and repeat work it already completed. The failure mode isn't bad instructions, it's an incomplete picture of the codebase.
Context engineering is the shift from prompt engineering to context operations: designing, compressing, and governing the full information environment an AI agent works in. LeanCTX automates that discipline.
Context engineering represents a fundamental change in how we think about AI agent inputs.
Instead of a fixed system prompt, context engineering builds a pipeline that assembles the right context for each task, reading only what's relevant, at the right compression level, with the right metadata.
Rather than hand-picking which files to include, context engineering reads each file's structure, keeps the parts that carry real signal, and compresses the rest, automatically.
Context engineering adds session memory, a knowledge graph, and clean handoffs, so agents build up understanding over time instead of starting from scratch every conversation.
Context engineering spans four interconnected domains, each addressing a different aspect of the agent's information environment.
Multiple read modes (full, map, signatures, entropy, aggressive), tree-sitter AST parsing across 26+ languages, and semantic chunking reduce file content by 60–99% while preserving the information agents need to make decisions.
Session snapshots, knowledge graphs, handoff ledgers, and prospective memory allow agents to recall prior decisions, avoid repeated work, and transfer context between team members or agent instances.
Role-based access policies, token budgets, SLO enforcement, and path sandboxing ensure agents operate within defined boundaries, reading only what they should, spending only what's allocated.
Output validation, proof artifacts, path and identifier preservation checks, and information-loss scoring give measurable confidence that compressed context retains the semantic content the agent requires.
LeanCTX is an open-source context engineering runtime that brings these principles into production for AI coding agents.
A full tool surface for reading, searching, compressing, and managing context, all exposed via the Model Context Protocol.
From full cached reads to entropy-filtered compression, each mode is optimized for a specific task: editing, exploring, reviewing, or referencing.
Pattern-based compression for git, cargo, npm, docker, and other CLI output, reducing verbose command results to structured, token-efficient summaries.
Runs entirely local. No telemetry, no cloud dependencies, no data leaving your machine. Open-source under Apache-2.0.
The essential distinctions behind the discipline and its role in AI coding.
Context engineering is the discipline of managing what information an AI agent sees, remembers, and acts on. It replaces ad-hoc prompt engineering with a systematic runtime that compresses, caches, verifies, and governs AI context.
AI coding agents waste thousands of tokens rereading files, parsing noisy shell output, and losing context between sessions. Context engineering reduces this waste by up to 99%, making agents faster, cheaper, and more reliable.
Prompt engineering focuses on crafting individual prompts. Context engineering manages the entire information lifecycle — what the agent reads, how it is compressed, what is cached, what is remembered across sessions, and what is verified before delivery.
The installer configures LeanCTX for supported agents while keeping the runtime and its data local.
curl -fsSL https://leanctx.com/install.sh | sh LeanCTX is free, open-source, and installs in under a minute. See what context engineering can do for your AI workflow.
curl -fsSL https://leanctx.com/install.sh | sh Cookie preferences
We use analytics to understand how our site is used. You choose what's allowed — no tracking runs until you decide.
Essential
Site functionality, security, preferences
Analytics
Pageviews & usage patterns · PostHog EU (Frankfurt) · No cross-site tracking
Read our Privacy Policy for full details. You can change your preferences anytime.