{"data":{"slug":"yvgude-lean-ctx","name":"lean-ctx","tagline":"Control what your AI can see by serving context with a local Rust binary.","github_url":"https://github.com/yvgude/lean-ctx","owner":"yvgude","repo":"lean-ctx","owner_avatar_url":"https://avatars.githubusercontent.com/u/7590809?v=4","primary_language":"Rust","stars":3486,"forks":312,"topics":["agentic-coding","ai","ai-agents","ai-coding","claude-code","context-engineering","context-intelligence","context-layer","copilot","cursor","developer-tools","gemini-cli","lean-context","llm","mcp","mcp-server","reduce-token-costs","rust","token-optimization"],"archived":false,"github_pushed_at":"2026-08-04T11:40:56+00:00","maintenance_label":"Very active","url":"https://www.graphcanon.com/tools/yvgude-lean-ctx","markdown_url":"https://www.graphcanon.com/tools/yvgude-lean-ctx.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/yvgude-lean-ctx","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=yvgude-lean-ctx","description":"Control what your AI can see. LeanCTX (Lean Context) is the context intelligence layer for AI agents — one local Rust binary that decides what they read, remembers what they learn, guards what they touch, and proves what they save. 60–90% fewer tokens as the receipt. 76 MCP tools, 30+ agents, local-first.","homepage_url":"https://leanctx.com","license":"Apache-2.0","open_issues":5,"watchers":21,"ai_summary":"LeanCTX acts as a context intelligence layer for AI agents, controlling read access and memory management locally. It supports token optimization for more than 70 MCP tools with support for multiple programming languages.","readme_excerpt":"# 1) Install (pick one)\ncurl -fsSL https://leanctx.com/install.sh | sh      # universal (no Rust needed)\nbrew tap yvgude/lean-ctx && brew install lean-ctx    # macOS / Linux\nnpm install -g lean-ctx-bin                          # Node.js\ncargo install lean-ctx                               # Rust\npi install npm:pi-lean-ctx                           # Pi Coding Agent\n\n---\n\n# pip install lean-ctx-sdk\nfrom lean_ctx import compress\nmessages = compress(messages, model=\"claude-sonnet-4\")\n```\n\n```ts\n// npm install lean-ctx-sdk\nimport { compress } from \"lean-ctx-sdk\";\nmessages = await compress(messages, { model: \"gpt-4o\" });\n```\n\nFramework adapters included (LiteLLM, LangChain, Vercel AI SDK). → **[compress() cookbook](docs/guides/compress-sdk.md)**\n\n**Thin `/v1` contract clients — [`lean-ctx-client`](https://pypi.org/project/lean-ctx-client/) ([npm](https://www.npmjs.com/package/lean-ctx-client) · [crates.io](https://crates.io/crates/lean-ctx-client)).** Wrap the full `/v1` tool, event and session API over the process boundary — never links the engine, so it stays stable as lean-ctx evolves.\n\n```bash\npip install lean-ctx-client     # Python (imports as `leanctx`)\nnpm install lean-ctx-client     # TypeScript / Node\ncargo add lean-ctx-client       # Rust\n```\n\nStart the server with `lean-ctx serve`, then point a client at it. → **[API reference](https://leanctx.com/docs/api-reference/)**\n\n---\n\n## License\n\nApache License 2.0 — see [LICENSE](LICENSE).\n\n\n--- lean-ctx: ctx_compose bundles search+read+symbols in one call ---","github_created_at":"2026-03-23T19:48:59+00:00","created_at":"2026-07-11T23:37:18.483945+00:00","updated_at":"2026-08-04T12:01:12.061355+00:00","categories":[{"slug":"ai-agents","name":"AI Agents","url":"https://www.graphcanon.com/categories/ai-agents","markdown_url":"https://www.graphcanon.com/categories/ai-agents.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/ai-agents"},{"slug":"developer-tools","name":"Developer Tools","url":"https://www.graphcanon.com/categories/developer-tools","markdown_url":"https://www.graphcanon.com/categories/developer-tools.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/developer-tools"}],"tags":[{"slug":"ai-agents","name":"ai-agents"},{"slug":"context-engineering","name":"context-engineering"},{"slug":"context-intelligence","name":"context-intelligence"},{"slug":"rust","name":"rust"},{"slug":"token-optimization","name":"token-optimization"}],"trust":{"provenance":{"is_fork":false,"github_id":1189918673,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-04T12:01:11.220Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":30,"days_since_push":0,"last_release_at":"2026-08-04T07:50:00Z"},"security_summary":{"status":"no_manifest","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T23:37:26.648Z","medium_count":0,"scan_profile":"mcp_manifest","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-04T12:01:11.724Z"},"languages":{"value":["rust"],"source":"github.language","observed_at":"2026-08-04T12:01:11.724Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-08-04T12:01:11.724Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When you require granular, localized oversight over what your AI can visualize, learn from, and store within its operations.","If your project involves more than 70 MCP tools or uses multiple programming languages and needs token optimization to keep costs down.","For development environments where data privacy and security are paramount, as LeanCTX ensures that context management is handled locally."],"when_not_to_use":["When there is a dependence on cloud-based solutions for context intelligence, since LeanCTX operates as a local binary.","If your setup does not need context layering or token optimization. In such cases, using LeanCTX would incur overhead without providing significant benefits."],"source":"enrich:decision_facts","observed_at":"2026-07-14T18:03:23.544Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"LeanCTX serves as a context intelligence layer for AI agents, providing localized control over read access and memory management while optimizing token usage for numerous MCP tools, all powered by a local Rust binary."}]}}