benjamin-plus-skill README

The project's README from github.com/JetBrains/benjamin-plus-skill. As one markdown file: README.md.

Benji — the benjamin-plus mascot

“Beware of little expenses; a small leak will sink a great ship.”
— Benjamin Franklin

benjamin-plus

A token-efficiency skill for coding agents.
It changes how the agent looks things up and waits — never what it builds.

Measured: up to −18 % cost and −22 % tokens per task, quality unchanged.


What the skill teaches

An agent pays twice for every clumsy lookup: once for the step itself, and again every time the growing conversation gets re-read. So the skill teaches five habits:

  1. Recon in one pass. Gather the facts up front in one combined step instead of poking at the repo five separate times. And before copying a format or convention, look at two real examples, not one.
  2. Keyhole reads. When the agent only needs to see something, it reads 50 lines, not the whole file. Data it will actually transform is never truncated.
  3. Probe the environment once. Check every dependency in one command and install whatever is missing in one go, instead of discovering them one crash at a time.
  4. Green means the task's own check. If the task says how to verify, that command is the definition of done. A missing compiler is still the agent's problem to fix, and a check that fails twice means the approach is wrong, not the symptom. When it passes: stop.
  5. Polling is a step. A build that hasn't finished has nothing new to say. Check on it every 30 seconds, not every second. On some agent platforms, polling alone turned out to be nearly half of all steps.

The skill's full text: RULESET.md (~745 tokens injected).

What to expect

Median paired savings across six metrics

Token consumption by arm

Install — inject it, don't "install" it

Same skill, two delivery methods, tested head-to-head: injected, it saves (−17.9 % cost median on the charts above; −4.4 % even on the harder Java/Codex setup) — as a discoverable skill folder, it saves nothing (−0.5 %, n.s.; agents burned steps just finding SKILL.md). So: inject.

git clone https://github.com/JetBrains/benjamin-plus-skill ~/.benjamin-plus

Claude Code — add to ~/.claude/settings.json (verify with /hooks, or just ask Claude Code to add it):

{ "hooks": { "SessionStart": [ { "matcher": "startup|resume|clear|compact",
  "hooks": [ { "type": "command", "command": "cat ~/.benjamin-plus/injected-instruction.md" } ] } ] } }

…or per-project, zero config: cat ~/.benjamin-plus/injected-instruction.md >> CLAUDE.md

Codex CLI — AGENTS.md is loaded into every session; no hook needed:

cat ~/.benjamin-plus/injected-instruction.md >> ~/.codex/AGENTS.md   # or >> AGENTS.md in a repo

Any other agent — append injected-instruction.md to the system prompt. That's the whole integration (~3 KB).

How it was measured

This skill wasn't written once and shipped. It came out of auto research: an agent working in a loop against the benchmark. Mine ~1,200 old agent traces for where the money actually goes, draft rules, run a paired A/B, read the failing trajectories, revise, run again. Six versions later, only the rules that survived the evidence were left. Everything that traded quality for savings got deleted along the way, which turned out to be most of the clever ideas.

The measurement itself is a paired A/B. Same agent, same model, same tasks, same container images; the only difference between the arms is the injected skill text. 80 paired SkillsBench tasks (Claude Code 2.1.201 in Docker sandboxes, Sonnet 5, low effort), Wilcoxon on the paired deltas, a sign test on rewards, and a per-trial adoption check: the payload reached the model in 80 of 80 treated runs and 0 of 80 controls. Trials that failed on one side only were retried before anything was counted. Every number and caveat lives in EXPECTED-RESULTS.md.

Feedback

Found a regression, a workload where it loses money, or a rule that misfires on your stack? Open an issue — ideally with the paired numbers (with/without) and, if you can, a trace. Results from other benchmarks and harnesses are especially welcome; that's how v6 got its polling rule.

License

MIT.

benjamin-plus-skill (JetBrains/benjamin-plus-skill)

Searching Database…

Что это?Benjamin-Plus — это скилл экономии токенов для кодинг-агентов: он обучает пяти привычкам, связанным с поиском информации и ожиданием (а не с тем, что агент строит), и по замерам снижает затраты до 18% без потери качества.
Это плагин, который я устанавливаю, или текст, который я встраиваю в промпт агента?Это не устанавливаемый пакет — это короткий файл правил (RULESET.md, около 745 токенов), который вы встраиваете прямо в системный промпт агента или в хук; упаковка в виде обнаруживаемой папки-скилла в тестах ничего не сэкономила, потому что агенты тратили шаги только на поиск SKILL.md.
Как добавить его своему агенту?Для Claude Code допишите правила в CLAUDE.md (например, командой 'cat ~/.benjamin-plus/injected-instruction.md >> CLAUDE.md') или подключите через хук в ~/.claude/settings.json; для Codex CLI добавьте их в AGENTS.md, так как этот файл загружается в каждой сессии; любому другому агенту допишите injected-instruction.md в его системный промпт.
Какие кодинг-агенты могут его использовать?Он тестировался на Claude Code 2.1.201 (Sonnet 5) и Codex CLI (gpt-5.6-luna), но работает с любым кодинг-агентом, чей системный промпт или контекст вы можете редактировать — API-ключи и дополнительный инструментарий не нужны.
Экономия всегда одна и та же?Экономия зависит от того, насколько раздуты ваши базовые сессии, — примерно от −10% до −18% затрат; идентичный прогон против более компактного базового уровня днём ранее дал лишь −10%, а сравнение качества (7 лучше/5 хуже/68 ничьих) не имело статистической мощности, чтобы исключить малые эффекты в любую сторону.
Какие пять привычек обучает скилл?Собирать факты одним объединённым разведочным проходом вместо множества мелких запросов, читать только нужные строки файла (чтение «через замочную скважину»), проверять все зависимости за один заход, считать команду верификации самой задачи определением готовности и засчитывать ожидание как шаг, проверяя раз в 30 секунд, а не каждую секунду.
Как разрабатывался и тестировался Benjamin-Plus?Агент в цикле разбирал около 1200 старых трасс агентов, составлял черновики правил и прогонял парные A/B-тесты на 80 задачах SkillsBench (Claude Code 2.1.201, Sonnet 5) в шести ревизиях, оставляя только правила, подтверждённые данными.
Он работает только на Claude Code?Нет — он также замерялся на Codex CLI с gpt-5.6-luna на наборе Java SWE-bench (675 парных повторов), показав −4,4% затрат при неизменной доле решённых задач, так что подход переносится между окружениями.
Насколько велик встраиваемый payload?Вся интеграция — около 3 КБ текста, причём само ядро правил — всего около 745 токенов после встраивания в системный промпт.
Creator
JetBrains
Size
1 MB
Stars
332
Updated
CommitAug 25
Age
2mo
Commits · 90 Days