lean-ctx
Skill3.9k starsChanged 4 months agoApache-2.0View on GitHub
Pick the right lean-ctx tool for reading, searching, understanding and running code with fewer tokens and fewer round trips. Use when lean-ctx MCP tools (ctx_*) are available or when a command output, file read or search would be large.
- Pipes a download into a shell
1 other project uses a version of this.
Trending
Less talk lately.about the whole repository
Most recently taken up by
- zaka33333-hash/claude-skillstheir own version, first seen May 14, 2026
Who's talking about yvgude/lean-ctx
- @rusttrending.bsky.social“yvgude / lean-ctx: Lean Cortex -- the cognitive context layer for agentic systems. 51+ MCP tools, 10 read …”Bluesky · May 24, 2026 · 6 likes
- @qdrddr.bsky.social“Context reduction for local #development. #MCP tools, #CLI, Hooks to #Harness #codeagents. Build-in …”Bluesky · May 9, 2026 · 5 likes
- dirge-code/dirge“feat: Janet compression plugin + /plugins slash command”GitHub · Jun 10, 2026 · 1 reactions
- Amitro123/knowledgeBase-Agent“Clean up the Google Sheet so the graph gets real topics (Category values, duplicates, empty tabs)”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.yvgude.lean-ctx: 3.10.2 → 3.10.5”GitHub · Oct 4, 2026
The biggest 5 of 44 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 44
Talked about on GitHub and Bluesky (44 times).
On GitHub · 41
- Jun 10, 2026feat: Janet compression plugin + /plugins slash command — dirge-code/dirge1 reaction · 2 comments
- Oct 4, 2026Clean up the Google Sheet so the graph gets real topics (Category values, duplicates, empty tabs) — Amitro123/knowledgeBase-Agent0 reactions · 3 comments
- Oct 4, 2026agent-skills.github.yvgude.lean-ctx: 3.10.2 → 3.10.5 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.yvgude.lean-ctx: init at 3.10.2 — sudosubin/agents.nix0 reactions
- Sep 20, 2026Freshness: lean-ctx v3.10.1 -> v3.10.5 — thoroc/context-radar0 reactions
36 more on GitHub
- Sep 17, 2026Feature request: add lean-ctx as a Token Saver (external /v1/compress — verified compatible with the Headroom slot) — decolua/9router0 reactions
- Sep 6, 2026Feature request: MCP Tasks support for background ctx_shell jobs with polling fallback and standardized status notifications — tryweb/ai-engkit0 reactions · 2 comments
- Aug 30, 2026feat: add custom agent tool SDK — Thinkery-AG/leanctx-sdk0 reactions
- Aug 14, 2026claude-proxy-rs: expand text-noise pattern catalog (LeanCTX-inspired) — tstapler/consolette0 reactions · 1 comment
- Aug 11, 2026Add lean-ctx — conda-forge/staged-recipes0 reactions · 2 comments
- Aug 11, 2026claude-proxy-rs: expand text-noise pattern catalog (LeanCTX-inspired) — tstapler/dotfiles0 reactions · 1 comment
- Aug 2, 2026Freshness: lean-ctx v3.9.12 -> v3.10.1 — thoroc/context-radar0 reactions
- Jul 30, 2026Token Optimizer List — haseeb-heaven/token-zero-studio0 reactions · 1 comment
- Jul 26, 2026docs(rules): correct lean-ctx tool-denial claims and cap's per-project skill assertion — arjaygg/dotfiles-omerxx0 reactions
- Jul 19, 2026Freshness: lean-ctx v3.9.11 -> v3.9.12 — thoroc/context-radar0 reactions
- Jul 17, 2026renovate(mise): Update dependency github:yvgude/lean-ctx to v3.9.5 — y-miyazaki/config0 reactions
- Jul 16, 2026Freshness: lean-ctx unrecorded -> v3.9.11 — thoroc/context-radar0 reactions · 1 comment
- Jul 15, 2026fix(github-release): update release github:yvgude/lean-ctx ( v3.9.8 → v3.9.10 ) — david-driscoll/home-operations0 reactions · 1 comment
- Jul 14, 2026Update dependency github:yvgude/lean-ctx to v3.9.9 - autoclosed — david-driscoll/dotfiles0 reactions · 1 comment
- Jul 11, 2026ci: add clippy, fmt, and cargo-deny gates behind a CI Green aggregator — getappz/agentflare0 reactions · 2 comments
- Jul 10, 2026Update dependency github:yvgude/lean-ctx to v3.9.5 — david-driscoll/dotfiles0 reactions · 1 comment
- Jul 8, 2026[Bug]: WSL agent discovery fails when claude/codex are shell aliases; please use type -P or absolute path detection — stablyai/orca0 reactions · 1 comment
- Jul 8, 2026[Build Infra] lean-ctx install step fails with HTTP 403 — GitHub API rate limit blocks CI — tryweb/ai-engkit0 reactions · 1 comment
- Jul 6, 2026fix(github-release): update release github:yvgude/lean-ctx ( v3.9.0 → v3.9.1 ) — david-driscoll/home-operations0 reactions · 1 comment
- Jul 5, 2026lean-ctx Integration — toon-format/toon-rust0 reactions · 1 comment
- Jul 2, 2026docs(readme): update lean-ctx comparison row — headroomlabs-ai/headroom0 reactions · 1 comment
- Jul 2, 2026docs(readme): fix lean-ctx Reversible column — it ships 5 recovery paths — headroomlabs-ai/headroom0 reactions · 2 comments
- Jul 2, 2026README "Compared to" table: lean-ctx row lists Reversible: No — it ships five recovery paths — headroomlabs-ai/headroom0 reactions
- Jul 2, 2026fix: Verifiable Memory Vault: external time-anchor (RFC 3161 + transparency log) + C2PA composition (fixes #1740) — alex-place/lantern-os0 reactions · 4 comments
- Jun 30, 2026Verifiable Memory Vault: external time-anchor (RFC 3161 + transparency log) + C2PA composition — alex-place/lantern-os0 reactions · 3 comments
- Jun 19, 2026[Request]: LeanCTX — ScoopInstaller/Main0 reactions
- Jun 12, 2026Stack with lean-ctx — paql4711/agent-space0 reactions
- Jun 6, 2026content(mcp): add LeanCTX MCP Server — JSONbored/awesome-claude0 reactions · 2 comments
- Jun 5, 2026Lean-Ctx support — cortexkit/aft0 reactions · 3 comments
- May 25, 2026refactor: replace RTK/Reasonix with lean-ctx, fix config schema — alfathhh/hataf-hermes0 reactions
- May 25, 2026refactor: replace RTK + Reasonix with lean-ctx, fix config schema — alfathhh/hataf-hermes0 reactions
- May 21, 2026Investigate LeanCTX — mnemosyne-systems/orangu0 reactions
- May 9, 2026Lean-ctx — github/gh-aw-firewall0 reactions
- Apr 28, 2026Add lean-ctx to Tools section — jim-schwoebel/awesome_ai_agents0 reactions
- Apr 24, 2026[FEATURE] Ability to replace rtk with lean-ctx — headroomlabs-ai/headroom0 reactions · 1 comment
- Apr 17, 2026Plugin proposal: lean-ctx — Claude Code context optimization MCP (649⭐, Rust, zero telemetry) — EnterOS-AI/enter-os-core0 reactions · 1 comment
On Bluesky · 3
- May 24, 2026yvgude / lean-ctx: Lean Cortex -- the cognitive context layer for agentic systems. 51+ MCP tools, 10 read modes, 95+ shell patterns. Up to… — @rusttrending.bsky.social6 likes and reposts
- May 9, 2026Context reduction for local #development. #MCP tools, #CLI, Hooks to #Harness #codeagents. Build-in #knowledgegraph, BM25 & Vector search.… — @qdrddr.bsky.social5 likes and reposts
- Jun 10, 2026公式READMEは、通常の削減を 60-90%、99%級は cached re-reads と案内している。しかも「session memory persists across chats」「knowledge graph」とも書いている。💎… — @sara-echosphere.bsky.socialsays it tested it0 likes and reposts · 1 reply
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- zaka33333-hash/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- rust/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/compression-safety.mdcCursor rule
- llms.txtllms.txt
- lean-ctx-reviewSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Never wait by polling: Do not loop sleep + status checks (see below).
- Very specific: line 38
Do not read or search through ctx_shell (cat, sed -n, grep, rg): that bypasses the read cache and symbol index.
- Very specific: line 43
If the host lists lean-ctx tools by name only, load what the task needs in
- Very specific: line 44
one: call, e.g. select:mcp__lean-ctx__ctx_compose,mcp__lean-ctx__ctx_search,mcp__lean-ctx__ctx_read.
- Very specific: line 45
Do not fall back to ctx_shell for everything because it happens to be loaded.
- Very specific: line 52
Prefer the host's own background execution that notifies on completion (Claude Code: Bash with run_in_background, or Monitor).
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LeanCTX — Context Gateway for AI Systems
Control what your AI can see. LeanCTX Engine provides local context selection, supported access and content controls, and evidence of observed context operations for existing agents: Select → Control → Prove. Recovery depends on source or archive availability and access permissions. LeanCTX SDK is the separate integration surface for applications.
lean-ctx shapes context before it reaches you: cached reads, compressed shell output, focused search, recovery to exact source. Two rules beat every detail:
- Fewer round trips beat smaller outputs. One call that answers the question is cheaper than three small ones. Never add a call just to save a few hundred tokens.
- Never wait by polling. Do not loop
sleep+ status checks (see below).
Intent → tool
| You want to… | Call | ||
| Understand how something works (unknown location) | ctx_compose(task) — ranked files + source in one call; use it FIRST instead of search→read→read | ||
| Find the exact definition of a symbol | ctx_search(action="symbol", name=…) | ||
| Find code by meaning | ctx_search(action="semantic", query=…) | ||
| Find a text/regex pattern | ctx_search(pattern=…, path=…) | ||
| Who calls X / what calls X makes | `ctx_callgraph(action="callers" | "callees", symbol=…)` | |
| Read a file you will edit | ctx_read(path, mode="anchored") → edit with ctx_patch, or the host's native edit tool | ||
| Read a file only for context | `ctx_read(path, mode="signatures" | "map"); a range: mode="lines:N-M"` | |
| Re-check a file after editing | ctx_read(path, mode="diff") | ||
| Run a command (build, test, git, …) | ctx_shell(command) — output is compressed | ||
| List files / directory shape | ctx_glob(pattern) / ctx_tree(path, depth) | ||
| Remember across sessions | `ctx_session(action="finding" | "decision" | "task", value=…); durable project facts: ctx_knowledge(action="remember", …)` |
Do not read or search through ctx_shell (cat, sed -n, grep, rg):
that bypasses the read cache and symbol index. Use ctx_read / ctx_search.
Deferred tools (ToolSearch)
If the host lists lean-ctx tools by name only, load what the task needs in
one call, e.g. select:mcp__lean-ctx__ctx_compose,mcp__lean-ctx__ctx_search,mcp__lean-ctx__ctx_read.
Do not fall back to ctx_shell for everything because it happens to be loaded.
A tool named here that your tool list lacks (the default profile shows a
small core) is still callable: ctx_call(name="ctx_knowledge", arguments={…}).
ctx_call(name="ctx_discover_tools", arguments={"query": "…"}) lists all of them.
Long-running commands
- Prefer the host's own background execution that notifies on completion
(Claude Code:
Bashwithrun_in_background, orMonitor). Start it, then continue other work or end the turn — you will be told when it finishes. ctx_shell(run_in_background=true)jobs do not notify by themselves. Check a job at most once when you actually need its result; neversleepin a loop.
Truncated output
Compressed or archived output ends with a recovery handle. Fetch only the
slice you need: ctx_expand(id, search=… | head=N | json_path=…), or
ctx_read(path, raw=true) for exact bytes. Do not re-run the command.
Without MCP (CLI)
lean-ctx read <file> -m signatures # or map | diff | lines:N-M
lean-ctx grep <pattern> [path]
lean-ctx -c "<command>" # only where the shell is not already wrapped
lean-ctx raw "<command>" # exact, uncompressed outputSetup
which lean-ctx || curl -fsSL https://raw.githubusercontent.com/yvgude/lean-ctx/main/skills/lean-ctx/scripts/install.sh | bash
lean-ctx setup # editor wiring, hooks, rules, this skill
lean-ctx doctor # verifyDocs: https://leanctx.com/docs
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

