leanrea README

项目的 README,来自 github.com/aicodeking/leanrea。合并为一个 markdown 文件:README.md。

leanrea

One 8 KB skill file that does what REA does: no MCP server, no 207 tools, no setup.

REA (Reverse Engineer Anything) puts an MCP layer between your agent and tools it can already use: asar, otool, nm, go version -m, jadx, apktool, Ghidra, tshark, binwalk, sqlite3. leanrea drops that layer. It tells the agent which command is fastest for each kind of target, gives it ready-to-paste recon commands, and lists the traps that REA's code handles for you. The agent then runs the real tools itself.

REA 6.5.0 leanrea
What gets installed 25 MB npm package + MCP server one SKILL.md
Instructions 23.5 KB skill + 48.8 KB references 8 KB
Tools added to the agent 207 (3.35 MB of definitions) 0 (uses Bash)
Context for "Reply OK", all tools loaded 400.7k tokens, $1.60 34.5k tokens, $0.09

Benchmark

Claude Code headless (claude -p), Sonnet 5.5, macOS arm64. 4 reverse-engineering tasks × 3 reps × 3 arms, with the arms run side by side. Answers are graded against hand-made keys.

arm total wall time cost turns tokens score
leanrea 388 s $2.17 55 2.40 M 74/75
no skill 479 s $2.21 81 3.11 M 67/75 (one refusal)
REA (MCP + its skill) 627 s $3.36 124 5.93 M 75/75

Against REA, leanrea had 38% less wall time, 35% lower cost, 56% fewer turns and 60% fewer tokens, at the same accuracy. Its one partial miss named an older IPC channel instead of the v2 one (both channels exist).

The tasks:

The same operation run through REA's CLI vs the raw command:

operation REA raw
Go build info 0.56 s go version -m: 0.06 s
Mach-O overview 3.32 s otool + dyld_info + nm: 0.04 s
Electron app analysis (real desktop app) fails on asar integrity until you pass a flag, then 47.9 s and 140 MB of JSON asar extract + rg -uu: 4.8 s, 24 KB

Full tables, the context-overhead runs and caveats: bench/BENCHMARK.md. Raw per-run metrics: bench/results/final.jsonl.

Caveats:

Install

npx skills add aicodeking/leanrea

This uses the skills CLI. It finds the leanrea skill and asks which agents to install it for: Claude Code, Codex, Cursor, Gemini CLI, OpenCode and the others it supports.

Common variants:

npx skills add aicodeking/leanrea -g                    # install for your user, in every project
npx skills add aicodeking/leanrea -a claude-code -y     # Claude Code only, no prompts
npx skills add aicodeking/leanrea -g -a '*' -y          # every supported agent, user level
npx skills update leanrea                               # pull the latest version later

Manual install, if you prefer:

git clone https://github.com/aicodeking/leanrea
mkdir -p ~/.claude/skills && cp -R leanrea/leanrea ~/.claude/skills/

If an agent has no skills support, paste leanrea/SKILL.md into its rules or system prompt; it is plain text.

Use it:

/leanrea How does the search feature in Foo.app work? Show the evidence.

What's in the skill

Reproduce the benchmark

Needs macOS with the target Electron app installed (see bench/setup.sh), gh from Homebrew, Node, and Claude Code logged in.

cd bench
./setup.sh        # installs [email protected], copies the targets into bench/work (gitignored)
./run_all.sh      # 36 runs, about $8 on Sonnet
./ctx.sh          # context-overhead probe
python3 mcp_list.py node work/rea-install/node_modules/rea-agents/scripts/rea.mjs --mcp   # REA tool count + size

The answer keys in tasks.json match the app versions used here and a gh built with go1.27.1. Other versions need new keys.

Credit

REA is an impressive, well-documented project by the morluto team. Most of the gotchas in this skill came from reading their code and docs. leanrea isn't affiliated with REA. It is just a test of whether a model with plain tools and a short note can do the same work faster.

MIT licensed.

leanrea (aicodeking/leanrea)

正在搜索数据库…

4.3K ·GitHub
这是什么?leanrea 是一个仅 8 KB 的技能文件(SKILL.md),它教编程智能体直接使用 otool、nm、jadx、apktool 等普通命令行工具来逆向分析应用和二进制文件,而不是通过 REA MCP 服务器及其内置的 207 个工具来完成。
它是 REA 那样的 MCP 服务器,还是别的东西?它根本不是 MCP 服务器。它只是一个纯文本的 SKILL.md 文件,会被加载到智能体的指令中;它不增加任何工具,智能体只是通过 Bash 自己运行真正的命令行工具。
我需要先安装 REA 或 MCP 服务器吗?不需要。leanrea 有意去掉了 MCP 层以及 REA 所需的 25 MB npm 包,转而依赖智能体本来就能通过 Bash 调用的命令行工具,例如 asar、otool、nm、go version -m、jadx、apktool、Ghidra、tshark、binwalk 和 sqlite3。
速度和成本的数据有多可靠?基准测试只在一个模型(Sonnet 5.5)和一台机器上每组运行了 3 次;Ghidra、Hopper 和 jadx 都没有安装,因此原生任务两组都改用了 Xcode 工具。leanrea 唯一一次答错时,说的是较旧的 IPC 通道,而不是当前的 v2 通道。
它实际上支持哪些编程智能体?凡是支持技能的智能体都可以使用,已通过 skills CLI 安装器确认支持 Claude Code、Codex、Cursor、Gemini CLI 和 OpenCode;不支持技能的智能体,也可以把纯文本的 SKILL.md 粘贴到其系统提示词中使用。
为什么不直接用 REA,而要选这个?与 REA 相比,在准确率相同的情况下,leanrea 的总耗时少 38%,成本低 35%,对话轮次少 56%,token 用量少 60%。原因是它不需要加载 207 个 MCP 工具定义(约 40 万 token),只告诉智能体该运行哪条原始命令。
这个技能能处理哪些类型的目标?它的路由功能涵盖 Electron/asar 应用、Mach-O 和原生二进制文件、Go/Rust/.NET 二进制文件、Android APK、WASM、SQLite、plist 文件、pcap/HAR 文件、固件,以及网站或运行时跟踪,每类都附有现成的首步命令。
基准测试是如何进行的?在 macOS arm64 上,使用 Claude Code 无界面模式(claude -p)和 Sonnet 5.5,对四项逆向工程任务各运行 3 次,共分 3 组(leanrea、无技能、REA),并依据手工制作的标准答案对结果评分。
leanrea 是 REA 的官方产品吗?不是。leanrea 与 REA 没有关联,它是通过阅读 REA 的代码和文档构建的,目的是验证:只使用普通工具加一份简短说明的模型,能否比 REA 更快、更便宜地达到相同结果。
大小
<0.1 MB
星标
4.3K
更新
提交Oct 17
时长
1个月
提交 · 90 天