MCP ConfigsMay 13, 2026·2 min read

lean-ctx — Context Runtime (MCP + Shell Hook)

lean-ctx is a local-first context runtime (MCP + shell hook) that compresses file reads and CLI output to cut token waste for coding agents.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 17/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
Mcp Config
Install
Stage only
Trust
Trust: Established
Entrypoint
Asset
Safe staging command
npx -y tokrepo@latest install a86dee69-dfc9-5674-9c1d-1c39f807e0f6 --target codex

Stages files first; activation requires review of the staged README and plan.

Intro

lean-ctx is a local-first context runtime (MCP + shell hook) that compresses file reads and CLI output to cut token waste for coding agents.

Best for: Developers with shell-heavy AI sessions who want lower token burn

Works with: Rust binary, MCP clients, Cursor/Codex/Claude Code integrations

Setup time: 4-10 minutes

Key facts (verified)

  • GitHub: 1611 stars · 165 forks · pushed 2026-05-13.
  • License: Apache-2.0 · owner avatar + repo URL verified via GitHub API.
  • README-verified entrypoint: curl -fsSL https://leanctx.com/install.sh | sh.

Main

  • Start with lean-ctx setup + doctor to ensure the MCP server and shell hook are actually active for your agent/editor.

  • Use read modes intentionally: map/signatures/diff modes reduce tokens while still giving enough context for refactors.

  • If you share a repo across containers/workspaces, follow the README guidance on repo IDs (.lean-ctx-id) to avoid cache/context collisions.

Source-backed notes

  • README headline claims 60–95% token reduction (up to 99% on cached reads) and lists 59 tools and 10 read modes.
  • README provides a 60-second install flow: install → lean-ctx setuplean-ctx doctorlean-ctx gain --live.
  • README includes a compatibility matrix with agent-specific init commands like lean-ctx init --agent codex and ... --agent claude.

FAQ

  • Is this only an MCP server?: No — README describes both an MCP server and a shell hook that compresses CLI output.
  • Can I disable it quickly?: Yes — README lists an immediate disable command (lean-ctx-off) for the current shell.
  • What’s a safe first workflow?: Run gain --live while doing normal dev tasks to see token savings before changing read modes.
🙏

Source & Thanks

Source: https://github.com/yvgude/lean-ctx > License: Apache-2.0 > GitHub stars: 1611 · forks: 165

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets