lean-ctx
Use LeanCTX Context Gateway tools to select task-relevant code context, apply supported controls, reuse local knowledge and inspect recorded evidence.
Skill by yvgude
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/yvgude-lean-ctx
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity, agent-building, knowledge-base, monitoring-observability
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Shell scripts
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/lean-ctx
What's inside
- Skill name
lean-ctx- Description
- Use LeanCTX Context Gateway tools to select task-relevant code context, apply supported controls, reuse local knowledge and inspect recorded evidence. Use when lean-ctx MCP tools (ctx_*) are available or file, search or command output needs a focused view.
- License
- Apache-2.0
- Instructions
- 80 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Instructions call the network
Files (2)
- SKILL.md
- install.sh · scripts/
SKILL.md (first lines)
# 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 → Learn → Prove. Learn means local task and
knowledge continuity, not model training. 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:
1. **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.
2. **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 the host's native edit tool, or `ctx_call(name="ctx_patch", arguments={…})` |
| 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_call(name="ctx_knowledge", arguments={"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 (Claude Code's ToolSearch), 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: `Bash` with `run_in_background`, or `Monitor`). 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; never `sleep` in 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)
```bash
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 output
```
## Setup
```bash
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 # verify
```
Docs: https://leanctx.com/docsFrom yvgude/lean-ctx, Apache-2.0.
More from yvgude/lean-ctx
- 0.847score
lean-ctx-review
yvgude
Review how the lean-ctx ctx_* MCP tools performed in the current session and file upstream issues for confirmed problems.
SkillAFreshness: A★ 3.9KClaude Code +9 - 0.625score
AGENTS.md · yvgude/lean-ctx
yvgude
AGENTS.md from yvgude/lean-ctx: 250 lines covering Mandatory Routing Decision (Direct or Swarm), Integration Mode: Replace, Subagent Compatibility (Cursor /…
TemplateAFreshness: A★ 3.9KCodex +5 - 0.609score
Cursor rules · yvgude/lean-ctx
yvgude
1 Cursor rule file from yvgude/lean-ctx: compression-safety.
TemplateAFreshness: A★ 3.9KCursor
Signals
- Stars
- 3,896
- Forks
- 356
- Open issues
- 9
- Last commit (this folder)
- Oct 19, 2026 (8 days ago)
- Last release
- Oct 11, 2026 (16 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/yvgude/lean-ctx
- Website
- leanctx.com
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from yvgude
- 0.847score
lean-ctx-review
yvgude
Review how the lean-ctx ctx_* MCP tools performed in the current session and file upstream issues for confirmed problems.
SkillAFreshness: A★ 3.9KClaude Code +9 - 0.625score
AGENTS.md · yvgude/lean-ctx
yvgude
AGENTS.md from yvgude/lean-ctx: 250 lines covering Mandatory Routing Decision (Direct or Swarm), Integration Mode: Replace, Subagent Compatibility (Cursor /…
TemplateAFreshness: A★ 3.9KCodex +5 - 0.609score
Cursor rules · yvgude/lean-ctx
yvgude
1 Cursor rule file from yvgude/lean-ctx: compression-safety.
TemplateAFreshness: A★ 3.9KCursor
Cite this page
lean-ctx skill. Agent Mart. https://agentmart.dev/skills/yvgude-lean-ctx (last updated 2026-10-24)