muaaz9329/cheap-ag

A plugin for Claude Code and Codex: Frontier models (such as Opus) are responsible only for reading requirements, writing plans, and making final decisions. The actual coding is delegated to cheaper models via channels like OpenRouter and DeepSeek, performed within an isolated copy of the project. A change is only considered valid if it first produces tests that fail before the fix and pass after the fix.

A plugin for Claude Code and Codex: Frontier models (such as Opus) are responsible only for reading requirements, writing plans, and making final decisions. The actual coding is delegated to cheaper models via channels like OpenRouter and DeepSeek, performed within an isolated copy of the project. A change is only considered valid if it first produces tests that fail before the fix and pass after the fix.

Stars 230 (+27 / 24h)

Reasoning

  • The author's goal is to make Claude / ChatGPT subscription quotas last longer: In self-tests on SWE-bench Verified, the same tasks showed a significant reduction in Opus token usage; limitations are also noted—of the hardest 9 bugs, 6 were solved, compared to 7 when using Opus alone, with little savings for very small changes.
  • Changes are made in git worktree copies, and tests are run by the plugin itself rather than relying on the model's claims; only passing changes return to your project as uncommitted states, never automatically committing or pushing; if cheaper models get stuck, Sonnet or the main model takes over.

Usage

  • Requires Node.js 20+, Claude Code or Codex, and an API Key for one of OpenRouter, DeepSeek, OpenCode Go, or Command Code (top up a few dollars).
  • Run npx cheap-agent, select the channel and model tier, paste the Key, and it will add itself to Claude Code; then execute /cheapag:allow once in each project. For Codex, install using codex plugin marketplace add muaaz9329/cheap-ag and codex plugin add cheapag@cheap-agent.
  • Use /cheapag:status to view tasks and costs, and /cheapag:hook on to force the main model to delegate coding tasks.

Risks

  • After executing /cheapag:allow, your project code is sent to the selected cheaper model provider; the first task on Windows takes approximately 2 minutes to start, and old processes may remain if the engine crashes.
  • The quota savings ratio is based on the author's self-tests; the license is MIT, and the repository was created on 10 month 28 day.

Open

GitHub

Explore the latest AI Radar updates