跳到正文
cccskills
免费在 GitHub 公开

lean-ctx

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.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md4.1 KB
  • scripts/install.sh2.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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:

  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 symbolctx_search(action="symbol", name=…)
Find code by meaningctx_search(action="semantic", query=…)
Find a text/regex patternctx_search(pattern=…, path=…)
Who calls X / what calls X makes`ctx_callgraph(action="callers"
Read a file you will editctx_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"
Re-check a file after editingctx_read(path, mode="diff")
Run a command (build, test, git, …)ctx_shell(command) — output is compressed
List files / directory shapectx_glob(pattern) / ctx_tree(path, depth)
Remember across sessions`ctx_session(action="finding"

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)

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

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/docs

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Review how the lean-ctx ctx_* MCP tools performed in the current session and file upstream issues for confirmed problems. Use when the user asks to review/audit lean-ctx tool performance, says "lean-ctx review", asks why ctx_* tools failed or fell back to native tools, or wants to report a lean-ctx bug.

中文简介正在准备中。当前显示原文说明。

yvgude/lean-ctx38902026年10月19日 更新

查看 yvgude 的全部技能

报告此技能的问题