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

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Native · 94/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Mcp
Install
Curl
Trust
Trust: Established
Entrypoint
curl -fsSL https://leanctx.com/install.sh | sh
Universal CLI install command
npx tokrepo install a86dee69-dfc9-5674-9c1d-1c39f807e0f6
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