lean-ctx

Compress CLI output and cache contextual data for AI-assisted coding sessions.

3.6k|324|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/yvgude/lean-ctx --skill lean-ctx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean-ctx
Source: https://github.com/yvgude/lean-ctx/tree/main/skills/lean-ctx
Command: npx skills add https://github.com/yvgude/lean-ctx --skill lean-ctx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LeanCTX tackles the issue of bloated LLM prompts and repetitive context by compressing CLI output and providing a persistent cross-session memory layer for developers.

Core Features & Use Cases

  • Shell Hook: transparently compresses CLI output before it reaches the AI, reducing noise.
  • Context Server: 24 intelligent tools for cached reads, delta updates, dependency graphs, and task-aware relevance scoring.
  • CCP & CEP: cross-session memory with LITM-aware positioning to maintain context across chats and projects and optimize attention.
  • Language support: tree-sitter parsing for 14 languages to extract meaningful APIs and structures.
  • Integration: simple agent hooks to connect with Claude Code, Cursor, Gemini CLI, Codex, Windsurf, and more.

Quick Start

Install LeanCTX and run lean-ctx -c <command> to compress verbose output and preserve context for AI-assisted coding.

Frequently Asked Questions about lean-ctx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress LLM context to reduce token costs in AI coding?

You can compress LLM context by running a command like `lean-ctx -c <command>` to intercept and compress verbose CLI output before it reaches the AI. This reduces token costs and preserves context for AI-assisted coding.

How does cross-session memory work for AI coding assistants?

Cross-session memory works by caching contextual data and applying LITM-aware positioning to maintain relevant context across different chats and projects. This prevents repetitive context loading and optimizes attention for iterative coding workflows.

Can I use context compression with Cursor and Claude Code?

Yes, context compression integrates directly with Cursor and Claude Code. The system provides simple agent hooks to connect and cache contextual data across these AI coding platforms, accelerating development without altering existing workflows.

Does cross-session memory support tree-sitter parsing for multiple programming languages?

Yes, the system supports tree-sitter parsing for 14 programming languages to extract meaningful APIs and structures. This enables accurate dependency graphs and delta updates during context compression across various coding projects.

Do I need a Rust binary to run context compression for AI coding?

Yes, a Rust binary is required to run this context compression system. The binary powers the core compression engine, shell hook integration, and the context server's 24 intelligent tools for cached reads and task-aware relevance scoring.