VibeHunt
Back to browse

lean-ctx

Token-saving context runtime for agents.

lean‑ctx provides a local‑first runtime that intercepts file reads and shell output before they are sent to a large language model, applying mode‑aware compression and caching to reduce token usage. It supports multiple read modes such as full, map, signatures, and diff, and a shell hook that applies over ninety patterns to compress noisy CLI output from tools like git, npm, cargo, and docker. The system also offers a session memory component that persists task facts and decisions across chats, and an HTTP server mode for streamable MCP access.

The runtime is intended for developers building AI coding agents that interact with code repositories and command‑line tools, aiming to lower the token cost of operations in environments such as Cursor, Claude Code, Copilot, Windsurf, Codex, and Gemini. By compressing and caching data, it can cut token waste by 60‑95 % and up to 99 % on cached reads, with re‑reads consuming roughly thirteen tokens.

Implementation is a single Rust binary available via a universal installer, Homebrew, npm, and Arch Linux packages. It exposes a set of `ctx_*` tools through an MCP server, integrates with shell commands via a transparent hook, and provides a programmable HTTP endpoint for tool calls, enabling developers to incorporate the context layer into their AI workflows with minimal setup.

Reviews

Sign in to leave a review.

Loading reviews…

Similar apps