Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/yvgude/lean-ctx/templatesnpx skills add yvgude/lean-ctx --skill templatesgit clone --depth 1 https://github.com/yvgude/lean-ctxWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00042 | $0.00898 |
| Opus 5 | $0.00021 | $0.00449 |
| Sonnet 5 | $0.00008 | $0.00180 |
| Haiku 4.5 | $0.00004 | $0.00090 |
Grade C, and why
lean-ctx scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Downloads and executes remote codehighSupply chain
curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.
which lean-ctx || curl -fsSL https://raw.githubusercontent.com/yvgude/lean-ctx/main/skills/lean-ctx/scripts/install.sh | bash Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
which lean-ctx || curl -fsSL https://raw.githubusercontent.com/yvgude/lean-ctx/main/skills/lean-ctx/scripts/install.sh | bash How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
lean-ctx — Local Context SDK for AI Agents
Setup
which lean-ctx || curl -fsSL https://raw.githubusercontent.com/yvgude/lean-ctx/main/skills/lean-ctx/scripts/install.sh | bash
lean-ctx setup
Tool Visibility Profiles
| Profile | Tools advertised |
|---|---|
| Lean (default, unpinned) | ctx_read, ctx_shell, shell, ctx_search, ctx_glob, ctx_tree, ctx_session, ctx_compose, ctx_callgraph, ctx_patch*, ctx_call, ctx_expand |
minimal |
ctx_read, ctx_shell, ctx_search, ctx_glob, ctx_tree; ctx_call is also advertised as the fallback invoker |
standard |
Minimal + ctx_compose, ctx_explore, ctx_knowledge, ctx_session, ctx_callgraph, ctx_graph, ctx_delta, ctx_execute, ctx_expand, ctx_overview, ctx_url_read, ctx_patch; ctx_call is also advertised as the fallback invoker |
power |
Full public tool registry |
* Lean hides ctx_patch for clients with a reliable native editor. Disabled
tools, role policy, and client compatibility can further narrow every profile.
Shell Hook (use instead of raw exec)
lean-ctx -c "git status"
lean-ctx -c "cargo test"
lean-ctx -c "npm install"
lean-ctx ls src/
ctx_read Modes
| Mode | When |
|---|---|
anchored |
Files you will edit (full text + N:hh| anchors for ctx_patch) |
full |
Verbatim cached read |
map |
Context-only (deps + exports) |
signatures |
API surface only |
diff |
After edits (changed lines) |
aggressive |
Large files, syntax-stripped; JSON arrays row-deduped (lossless) |
entropy |
Shannon filtering |
task |
Task-relevant lines |
lines:N-M |
Specific range |
auto |
System selects optimal |
Re-reads may use the local cache. Set fresh=true to bypass it.
Redundant JSON (arrays of like objects) is crushed losslessly into a compact
_defaults + per-row form; if a slice was dropped, recover it with
ctx_expand(id, json_path=… | search=…).
File Editing
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 72 lines · 42 tokens per session scan C 31febfba9276
lean-ctx is a skill published in the GitHub repository yvgude/lean-ctx (3,681 stars, last pushed yesterday), licensed Apache-2.0. It adds 42 tokens to every session and 898 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
Agent Browser Automation
Fast Rust-based headless browser automation CLI with Node.js fallback for AI agents, featuring navigation, clicking, typing, snapshots, and structured commands optimized for agent workflows.
codesynapse-cli
Use this skill to answer codebase architecture questions, trace dependencies, find callers/callees, calculate blast radius, and explore the code graph. ACTIVATE when the user asks "how does X work", "what handles Y", "where is Z defined", "explain the mechanism", "who calls", "blast radius", "shortest path", "trace…
feishu
Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.
interview
Ask one useful structured question at a time only when material product/implementation choices are genuinely missing; remember answers and produce a brief/spec. Discoverable facts should be investigated instead of asked.
migrate-better-result-3
Migrate a TypeScript codebase from better-result 2.x to 3.0. Use when upgrading better-result across the TaggedError syntax, removed Result serialization helpers, recovery inference, matching, or retry APIs.
browse-and-evaluate
Use when exploring the ai-agent-skills catalog to find, compare, and evaluate skills before installing. Always use --fields to limit output size and --dry-run before committing to an install.