SKILL·1D44F7

lean-ctx-review

yvgude
更新于 4 days ago
3,738
343
3,738
在 GitHub 上查看
文档aimcp

关于

This skill audits the performance of lean-ctx MCP tools by analyzing Claude Code session transcripts to identify when ctx_* tools failed or fell back to native alternatives. It extracts detailed call data and provides structured triage rules to file upstream bug reports for confirmed issues. Use it when users request tool performance reviews, encounter failures with ctx_* tools, or want to report lean-ctx bugs.

快速安装

Claude Code

推荐
主要方式
npx skills add yvgude/lean-ctx -a claude-code
插件命令备选方式
/plugin add https://github.com/yvgude/lean-ctx
Git 克隆备选方式
git clone https://github.com/yvgude/lean-ctx.git ~/.claude/skills/lean-ctx-review

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

lean-ctx session review

Upstream repo: yvgude/lean-ctx (https://github.com/yvgude/lean-ctx).

Reads a Claude Code session transcript, so it applies to agents that write ~/.claude/projects/*/*.jsonl. Other harnesses need their own extractor; the triage rules below are harness-independent.

1. Extract

Run from this skill's directory (needs python3):

python3 scripts/scan_session.py

Defaults to the newest transcript under ~/.claude/projects/*/ — the live Claude Code session. Pass a path to review a different one. -d N dumps call #N in full.

The script reports facts, not verdicts: every ctx_* call in order, which results the harness flagged is_error, which calls repeated identical arguments, which asked for raw/fresh output, and how many native Read/Grep/Bash calls happened. It deliberately does not guess which of those is a problem — that judgment is yours, below.

Transcripts run to megabytes, so read the table, not the raw JSONL.

2. Triage

Start from is_error. In practice every genuine tool failure carries it. Then read the call list for the softer signals: identical retries, raw/fresh re-reads, native calls clustered right after a ctx_* call, or a sequence that only completed once ctx_* was abandoned.

Before absolving anything, do these two things

Skipping them is how this review returns a false "nothing to report". Both cost one command each.

Search the tracker for the guard or tool you are about to excuse. Do this during triage, not at step 4. A closed issue defines intended behaviour: if a shipped fix says a form is supported and you just watched it fail, that is a regression and one of the most valuable things this review finds. It also stops you re-filing a settled design decision.

gh issue list --repo yvgude/lean-ctx --search "<guard or tool keyword>" --state all

Probe the stated rationale — never accept a message's self-description. An error explains itself, and that explanation can be wrong. Three checks, each one command:

  • Does the sanctioned alternative achieve the same thing? If the block is bypassable through a route the message itself recommends, it constrains syntax, not capability. Sometimes that is deliberate (structured input parses reliably where a shell string does not) — decide which, do not assume.
  • Does the stated reason match the observed rule? Vary one axis at a time. A guard blaming payload size that actually keys on path, or blaming a pipe on a command that is piped, is misdiagnosing itself.
  • Does the message contradict itself? A rejection that also states the rejected form is allowed is a finding on its own, whichever way the policy should go.

A wrong diagnostic is a real bug even when the block is correct: it sends the next caller down a route that cannot work.

Not a finding

  • Words inside returned content. A file containing http.StatusConflict, a git rebase printing CONFLICT (content):, gh returning "mergeable":"CONFLICTING", a test run printing not found. The tool returned exactly what was asked for. Judge the tool's own behaviour, never the payload's vocabulary.
  • Self-reference. Any result that quotes a previous scan, this skill, or a transcript will echo every error word in it.
  • Guard blocks — only after they survive the probe above. Inline env overrides (GIT_EDITOR=), shell redirects (>/>>), non-allowlisted commands, paths outside the project root. "It offered an alternative and the alternative worked" is not enough to clear one: that is true of a guard whose reason is wrong, whose rule is different from its description, or that contradicts itself. Clear it only once the stated rationale holds up.
  • Malformed tool input. InputValidationError on __unparsedToolInput is the caller's own JSON serialization — commonly a raw tab or newline inside a string — rejected before lean-ctx ever ran.
  • My own wrong arguments, a genuinely missing file, a failing build.

Confirmable

The tool did something wrong or unhelpful given correct input:

  • wrong, lossy, or truncated output where the mode promises otherwise
  • content injected into output documented as verbatim, or anything that breaks a documented output format (e.g. corrupting batch-read separators)
  • a crash, hang, or schema mismatch against the documented parameters
  • a documented mode behaving differently than described
  • a retry that only succeeded after dropping to native tools
  • a wrong or self-contradicting diagnostic, even where the block itself is right — naming the wrong cause sends the next caller down a route that cannot work, and costs more than the block did
  • a regression against a closed issue: a shipped fix says the form is supported, and it is not

3. Reproduce

No minimal repro, no issue. Re-run the exact tool and arguments. If it passes, try to isolate the trigger; if you cannot, do not file — report the observation to the user instead, saying plainly that it did not reproduce and what you tried. Guessing at internals is worse than silence.

lean-ctx --version for the version line.

Zero confirmed findings is a valid and common result. Say so and file nothing.

4. File

Only for confirmed findings, one issue per distinct problem. You searched the tracker during triage; widen it here if the finding shifted:

gh issue list --repo yvgude/lean-ctx --search "<keywords>" --state all

Skip if already reported — and read the close text before re-filing, since a closed issue may have already conceded the point you are about to raise. When a finding contradicts a closed fix, cite it and frame the issue as the gap in that fix. Otherwise:

gh issue create --repo yvgude/lean-ctx --title "..." --body-file <file>

Body: what happened, expected, minimal repro (exact tool + args), version, OS. No speculation about internals. End every issue body with the Claude Code attribution footer. Report the issue html_url back to the user.

GitHub 仓库

yvgude/lean-ctx
路径: skills/lean-ctx-review
0
agentic-codingaiai-agentsai-codingclaude-codecontext-engineering
FAQ

常见问题

什么是 lean-ctx-review Skill?

lean-ctx-review 是一个 Claude Skill,作者为 yvgude。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 lean-ctx-review 相关的任务。

如何安装 lean-ctx-review?

使用本页的安装命令:将 lean-ctx-review 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。

lean-ctx-review 属于哪个分类?

lean-ctx-review 属于文档分类。

lean-ctx-review 可以免费使用吗?

可以。lean-ctx-review 已收录在 AIMCP,可免费安装。

相关推荐技能

railway-docs
文档

Railway Docs Skill可实时获取最新的Railway官方文档,确保回答的准确性。当开发者询问Railway功能特性、工作原理或分享docs.railway.com链接时,应优先使用此技能。它通过专门的LLM优化文档源提供最新信息,避免依赖过时记忆来回答技术问题。

查看技能
n8n-code-python
文档

该Skill为在n8n平台的Python代码节点中编写代码提供专家指导,特别适用于需要使用_input/_json/_node语法、Python标准库或了解n8n中Python限制的场景。它强调JavaScript应作为首选方案,仅当需要特定Python功能或对Python语法更熟悉时才使用Python。Skill提供了快速入门模板和关键注意事项,帮助开发者在n8n中高效编写Python代码。

查看技能
archon
文档

Archon Skill为开发者提供了基于RAG的语义搜索和项目任务管理功能,可通过REST API访问知识库。它支持文档搜索、网站爬取、文件上传和版本控制,适用于技术文档查询和项目管理场景。首次使用时需要配置Archon主机地址,建议在处理外部文档时优先使用该Skill。

查看技能
n8n-code-javascript
文档

这个Skill为n8n工作流中的JavaScript代码节点提供专业指导,涵盖数据处理、HTTP请求和日期操作等核心场景。它详细解释了如何正确使用n8n特有的`$input`/`$json`语法、`$helpers`工具以及DateTime对象,并包含关键的错误排查和模式选择建议。开发者通过该Skill能快速掌握Code节点的正确返回格式、数据访问方法和常见陷阱解决方案。

查看技能