К основному содержанию
плагин

cheapag — плагин для Claude Code: что делает и как установить

Плагин cheapag для Claude Code перепоручает написание кода дешёвым моделям, оставляя планирование и ревью основной модели. Экономит токены на рутинных задачах через внешний MCP-сервер.

MIT ★ 341 обновлён 2026-11-16

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add muaaz9329/cheap-ag
/plugin install cheapag@cheap-agent
Открыть на GitHub

Что делает cheapag

Плагин передаёт генерацию кода рабочим моделям через MCP-сервер с инструментами delegate, research, reply, jobs и land. Основная модель в Claude Code пишет план и проверяет правки, а черновую реализацию берут внешние исполнители. Доступны пресеты cheapest, balanced и strongest, которые настраивают связку исполнителя и эскалации под выбранного провайдера.

Конфигурация хранится в ~/.config/cheapag/config.json, а локальные параметры репозитория можно задать в cheapag.json. Пользовательские команды /cheapag:allow, /cheapag:model, /cheapag:provider, /cheapag:clean и перехватчик правок /cheapag:hook управляют разрешениями и моделями.

Для работы нужен настроенный аккаунт провайдера вроде OpenRouter, DeepSeek, OpenCode Go или OpenCode Zen, который подключается через команду npx cheap-agent login.

Какие задачи решает

  • сократить расход токенов на кодогенерацию в Claude Code
  • делегировать черновые правки сторонним моделям
  • отслеживать размер системного префикса и кэша сессии
  • защитить кодовую базу от прямых правок через хук

Примеры запросов агенту

  • /cheapag:status
  • /cheapag:allow
  • /cheapag:hook

Как установить cheapag

Через маркетплейс плагинов

/plugin marketplace add muaaz9329/cheap-ag
/plugin install cheapag@cheap-agent

По шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой

Вопросы о cheapag

Как установить cheapag в Claude Code?

В сессии Claude Code выполните по очереди две команды: /plugin marketplace add muaaz9329/cheap-ag, затем /plugin install cheapag@cheap-agent.

Что делает плагин cheapag?

Он разделяет роли: флагманская модель в Claude Code проектирует решение и проверяет результат, а сторонние дешёвые модели выполняют реализацию через MCP-инструменты.

Что нужно для работы cheapag?

Нужно настроить провайдера (OpenRouter, DeepSeek, OpenCode Go или OpenCode Zen) с помощью команды npx cheap-agent login.

Исходный текст

plugin · MIT
# Cheap Agent plugin for Claude Code

Gives Claude the Cheap Agent MCP server (`delegate`, `research`, `reply`, `jobs`, `land`), the plan-writing skill, `/cheapag:status`, and the user-only commands `/cheapag:allow`, `/cheapag:model`, `/cheapag:provider`, `/cheapag:clean` and `/cheapag:hook`.

## Worker models

`npx cheap-agent login` asks which worker models to use, after the provider. Each preset picks the implement and escalation models for your provider (OpenCode Go, OpenCode Zen, OpenRouter or DeepSeek):

- **cheapest**: the lowest worker spend. Claude takes over more often when the worker fails.
- **balanced** (the default): the preset the benchmark measured and recommends.
- **strongest**: the strongest cheap models, for when you would rather pay the worker than have Claude take over.

Measured on SWE-bench Verified (OpenRouter): Flash's worker cost is about $0.005 per easy task and $0.03 per hard one; GLM-5.3 costs about $0.06 on the hard ones, and there Claude used 1.5x fewer tokens than with Flash, because GLM-5.3's failures cost Claude less to recover from. On the hard tier alone GLM-5.3 showed no gain, so `balanced` keeps Flash everywhere and `strongest` (GLM-5.3 for every task) is opt-in. `cheapest` is the same as `balanced` today.

The choice goes into `models` in `~/.config/cheapag/config.json`. Run `npx cheap-agent login --preset <cheapest|balanced|strongest>` to switch without the prompts. `ping` and `cheapag status` show it as `preset=<name>`. For a finer choice, set `models` (`implement`, `research`, `escalation`, `fallback`, as full `provider/model` names) in a repo's `cheapag.json`, which overrides the user config, or in the user config itself; answering `custom` (or `--preset custom`) makes login leave it as you wrote it. Changing the models after `/cheapag:allow` makes the next job ask for it again, with the new list.

## What it costs to keep in context

Everything Claude Code loads at session start is sent again on every turn: the system prompt, tool definitions, every enabled skill's description, plugin instructions and CLAUDE.md. A bigger prefix means each turn costs more, and a prefix that changes between sessions is rewritten at full price instead of read from cache. Measured on a real machine (Claude Code 2.1.285), a session that only answers "OK" cost $0.10 with ~100 user plugins and skills enabled, against $0.02–0.04 with only what the task needs.

- **Disable plugins you are not using** (`/plugin` → disable). Each enabled plugin adds its skills and instructions to every turn of every session.
- **Mark skills you only call by name** with `disable-model-invocation: true` in their `SKILL.md` frontmatter. Their descriptions then stay out of the context. Cheap Agent's `allow`, `clean` and `hook` already do this.
- **Keep CLAUDE.md under ~200 lines.** It is part of every turn. Move rarely needed detail into files Claude reads on demand.
- **Pin the Claude Code version** (`DISABLE_AUTOUPDATER=1`) during long stretches of work. An update changes the system prompt, so the next session rewrites the whole cached prefix.
- **For scripted runs** (`claude -p`): `--setting-sources project` skips user plugins and settings, and `--exclude-dynamic-system-prompt-sections` keeps per-machine details (cwd, git status) out of the cached prefix. The `includeGitInstructions: false` setting drops the commit/PR boilerplate when the agent never commits.

`cheapag status` prints the prefix size of this repo's most recent Claude Code session, when its transcript is readable (`claude prefix: 18.4k tokens on the first turn …`). Under ~20k is lean; 40k+ usually means plugins or skills the work doesn't use.

## Sessions, `/clear` and the cache TTL

Claude Code caches the session prefix. Every turn that starts within the cache's lifetime reads it at a tenth of the input price, instead of writing it again at more than the input price. How you split work into sessions decides how often you pay the full write.

- **One session per block of work.** Starting a fresh `claude` for every small task writes the whole prefix each time. Inside a session it is written once and then read.
- **`/clear` between unrelated tasks.** It's free: the prefix stays cached, and only the conversation is dropped. It also keeps old, unrelated context from distracting Claude on the next task.
- **Pick the TTL for how you work.** The default 1-hour cache suits all-day work with pauses. For short bursts of back-to-back tasks, `CLAUDE_CODE_PROMPT_CACHE_TTL=5m` makes cache writes cheaper ($5 instead of $8 per million tokens on Opus), as long as you never idle more than five minutes. After a longer pause, the next turn rewrites the prefix.
- `cheapag status` shows the last session's cache use: `claude cache: 14 requests, 91% of input from cache, 1h TTL`. A low percentage on a long session means the prefix kept changing (plugins toggled, an update, idle gaps past the TTL).

On a Pro or Max plan these are dollar estimates at API prices. Anthropic says cached tokens count less toward plan limits, but publishes no ratio.

© muaaz9329 · MIT · muaaz9329/cheap-ag

Похожие плагины

Все плагины по теме «Настройка агента: память, контекст, субагенты» →
cost-accrual-tracker curiositech Скилл cost-accrual-tracker для Claude Code и пяти других платформ, который считает расходы на API в режиме реального времени во время выполнения LLM-запросов. Фиксирует частичные затраты даже при прерванных запросах. CX Codex +1 175установок cost-verification-auditor curiositech Скилл cost-verification-auditor для Claude Code сверяет оценку стоимости токенов с фактическими расходами по API. Запускается для поиска причины расхождения прогноза и счёта. CX Codex +1 175установок caveman-evidence-review JuliusBrussee Скилл caveman-evidence-review читает данные Caveman Cloud о расходах LLM, трассах и маршрутизации. Подходит для проверки того, куда уходит бюджет проекта. CX Codex +1 128 400установок anomalies Son Nguyen Команда anomalies находит сессии с аномальным расходом токенов и денег через расчёт z-score в дашборде Agent Monitor. CX Codex +1 ★ 1 198звёзд репо benchmark-vllm-model chalk-ai Скилл benchmark-vllm-model считает стоимость токена и запроса для модели на vLLM: поднимает сервер на GPU, гоняет нагрузку и делит цену железа на замеренную пропускную способность. CX Codex +1 1 900установок exploring-llm-costs PostHog Скилл exploring-llm-costs для Claude Code разбирает расходы на LLM в PostHog по моделям, пользователям, трассам и другим измерениям. Он подключается к вопросам о скачке затрат и настройке графика или оповещения. CX Codex +1 416установок

Из того же набора8

clean Скилл clean для Claude Code удаляет старые worktree Cheap Agent и журналы заданий. Флаг --all очищает всё, что не выполняется сейчас. CX Codex +1 ★ 341звёзд репо status Скилл status для Claude Code показывает состояние задач Cheap Agent в репозитории. Он выводит список запущенных работ, недавние результаты, статус согласия и лимиты расходов. CX Codex +1 ★ 341звёзд репо hook Скилл hook для Claude Code включает и выключает защиту правок в репозитории. Защита перенаправляет крупные изменения и третью правку одного файла за ход агенту-делегату. CX Codex +1 ★ 341звёзд репо allow Скилл allow для Claude Code управляет согласием на передачу кода во внешние модели Cheap Agent. Он запускается для настройки области доступа и параметров обработки данных в репозитории. CX Codex +1 ★ 341звёзд репо provider Скилл provider для Claude Code переключает воркера на настроенного провайдера и переносит согласие репозитория. Ключ при этом не запрашивается. CX Codex +1 ★ 341звёзд репо model Скилл model для Claude Code настраивает основную и запасную языковые модели воркера. Запускает пошаговый выбор вариантов через CLI-утилиту cheap-agent. CX Codex +1 ★ 341звёзд репо plan-writing Скилл plan-writing для Claude Code готовит или исправляет план Cheap Agent перед вызовом инструмента делегирования cheapag. Он включается для изменений больше ~20 строк, нескольких файлов или после отклонения плана. CX Codex +1 ★ 341звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой