Use 60% less Opus
in Claude Code

Your frontier model plans. A half-cent model writes the code and proves it with a test. Your plan lasts 2–3x longer. Now in Codex too.

npx cheap-agent
or Check out or contribute on GitHub

Free · works with Claude Code and Codex · DeepSeek via OpenRouter, DeepSeek or OpenCode Go

Two real Claude Code sessions side by side, same prompt: Claude Code alone climbs to 233k Opus tokens, Claude Code with Cheap Agent stops at 132k, and the cheap model costs $0.007. Both pass their tests.
Two real sessions, same prompt, sped up about 20x. Alone: 233k Opus tokens. With Cheap Agent: 132k, plus $0.007 for the cheap model.

The numbers

Tested on SWE-bench Verified: real bugs from real open-source projects, graded by the official harness. Same prompts in Claude Code with Opus, with and without Cheap Agent.

63%less Opus to add a feature (154k → 57k tokens). Both versions pass all their tests.
59%less Opus on 7 everyday bug fixes. 7 of 7 solved, same as Claude Code alone.
$0.005what the cheap model cost to write that whole feature.
Opus tokens, Claude Code alone vs with Cheap Agent: adding a feature 154k vs 57k (63% less); 7 everyday bug fixes 1.6M vs 655k (59% less); 9 of the hardest bugs 3.0M vs 1.3M (55% less), 6 of 9 solved vs 7 of 9.

What I won't hide: on the 9 hardest bugs it solved 6 where plain Opus solved 7. On tiny jobs there's nothing to save. It shines on real features and real fixes in real code.

How it works

You keep using Claude Code or Codex exactly as before. Cheap Agent is an MCP server and plugin that changes who does the typing.

  1. Your frontier model plans

    Turns your ask into one short task. Reads no code.

  2. A cheap model codes

    In its own git worktree: writes a failing test, fixes the code, makes it pass.

  3. Cheap Agent checks

    Runs the tests itself. Only passing work lands, uncommitted.

  4. It tells you

    Reads a 10-line result. If the cheap model got stuck, a helper finishes (Sonnet in Claude Code), not your frontier model.

Why I built this

The idea: get $200-plan usage out of the $100 Claude plan, and $50–70 worth out of the $20 plan, with a few dollars of DeepSeek doing the typing.

I've met a lot of students, mostly in developing countries, who really want Opus for the hard problems and simply can't afford $100 a month. This is a small effort from my side. It won't make Opus ten times cheaper, but something is better than nothing.

Install in one minute

You need Claude Code or Codex, Node.js 20+, and an API key with a few dollars on it from OpenRouter, DeepSeek or OpenCode Go.

Let Claude Code set it up

Paste this into Claude Code. It asks what you want, then gives you one command to run.

Set up Cheap Agent (npm: cheap-agent) for me.
1. Ask me: which provider (OpenRouter recommended, DeepSeek or OpenCode Go), and which models (balanced is the default; cheapest, strongest, or my own provider/model).
2. Check that node is 20+ and the claude CLI is installed.
3. If I picked my own model, save {"models":{"implement":"<model>"}} in ~/.config/cheapag/config.json, keeping what else is there.
4. Give me the command to run in my terminal: npx cheap-agent login --preset <my choice, or custom>, and which number to pick for my provider (1 OpenCode Go, 2 OpenRouter, 3 DeepSeek). I run it and type my API key there. Never ask for my key.
5. When I say done, check `claude mcp list` shows cheapag, then tell me to run /cheapag:allow in a new Claude Code session in my project.

Or do it yourself

  1. Run this in your terminal:
    npx cheap-agent
  2. Pick a provider (OpenRouter if unsure), press Enter for the recommended models, paste your API key into the hidden prompt.
  3. In each project, run this once in Claude Code:
    /cheapag:allow

That's it. Ask Claude for changes like you always do. A few dollars lasts hundreds of tasks. macOS, Linux and Windows (Windows needs Git for Windows).

In Codex

  1. Log in (skip this if you already did it for Claude Code; say no when it offers to add itself to Claude Code):
    npx cheap-agent
  2. Add the plugin:
    codex plugin marketplace add muaaz9329/cheap-ag
    codex plugin add cheapag@cheap-agent
  3. Start codex in your project and trust the 3 cheapag hooks when it asks. Then, once per project:
    $cheapag:allow

That's it. Ask Codex for changes like you always do. One login and one OK per project cover both Claude Code and Codex.

FAQ

How do I make my Claude Code or Codex plan last longer?

Install Cheap Agent. Your frontier model keeps planning and deciding, while a model that costs about half a cent per task writes the code. In my tests with Opus, it used 55–63% fewer tokens for the same work.

Is a half-cent model actually any good?

On its own, no. With a written task from your frontier model, a test it has to pass, and Cheap Agent running that test, it is right most of the time. When it can't finish, it says so and a stronger model takes over.

Where does my code go?

To the model provider you pick (OpenRouter, DeepSeek or OpenCode Go), and only after you run /cheapag:allow ($cheapag:allow in Codex) in that project. Your API key stays on your machine and never goes into the chat.

Will it commit or push anything?

Never. Changes land uncommitted, so you review the diff like any other.

Does it work with Claude Pro and Max, and with ChatGPT plans in Codex?

Yes. It works with any Claude Code login, and with Codex on a ChatGPT plan. It saves your frontier model's usage, so it matters most on plans with usage limits.

Is Cheap Agent free?

Yes. You only pay the model provider for the cheap model, usually a few dollars for hundreds of tasks. It's open source under the MIT license: anyone can use it, change it and share it, companies included.