Claude Code can cap its own spending mid-run with a max-budget flag, and hand back JSON that matches a schema you wrote yourself. That is the real difference between these tools. Not the chat window.
Codex is a terminal agent written in Rust, open source, with an exec command for repeatable workflows and configurable approval modes before it edits or runs anything. Gemini CLI gives you sixty model requests a minute and a thousand a day free on a personal Google account. Kimi K3 carries a context window of just over a million tokens, and its K2.7 Code model is tuned for coding with a 256K window.
All four will write you a working script on the first afternoon. The gap shows up on the thirtieth run, when the thing is supposed to work without you watching it.
Gemini CLI does the same job with output-format json, which you pipe into jq to pull the response, the token counts, and the tool statistics. Both read from stdin, so you can send a crawl log or a diff straight in and redirect the answer to a file. Claude Code caps piped input at ten megabytes, and anything larger has to go in as a file path instead.
That single property changes what you can build. Output that comes back as validated JSON turns a chat agent into a component you can drop into a nightly job, which is the whole point when you are scoring a few thousand pages rather than fixing one bug.
Caching is the other lever. Kimi charges three dollars per million input tokens on a cache miss and thirty cents on a hit, against fifteen dollars per million output, so a job that hits the same large file repeatedly gets an order of magnitude cheaper after the first pass. Gemini's free allowance covers a thousand requests a day, which is more than most scheduled jobs need.
Which means the choice between Claude, Codex, Gemini, and Kimi Code matters less than how you drive whichever one you land on.
Codex approaches the same problem from the permissions side, with approval modes you set before it edits files or runs commands. It also speaks the Model Context Protocol, so it can reach third-party tools and context, and it accepts images and can search the web without leaving the terminal. Both matter more than model quality once the script runs on a schedule, because a job that silently picks up a teammate's config is a job you cannot debug.
Run the boring bulk work on the free allowance, and save the metered account for the parts that need judgment. A nightly crawl summary does not need the strongest model available, and paying for one is how a twenty-dollar month quietly becomes an eighty-dollar month.
Codex is a terminal agent written in Rust, open source, with an exec command for repeatable workflows and configurable approval modes before it edits or runs anything. Gemini CLI gives you sixty model requests a minute and a thousand a day free on a personal Google account. Kimi K3 carries a context window of just over a million tokens, and its K2.7 Code model is tuned for coding with a 256K window.
All four will write you a working script on the first afternoon. The gap shows up on the thirtieth run, when the thing is supposed to work without you watching it.
Structured output decides how much glue code you write
Every one of these agents can print to a terminal. Fewer can hand you something a program can read without guesswork. Claude Code takes text, JSON, or stream-json as output formats, and the JSON-schema flag returns a validated object in a structured output field, so you stop writing parsers for prose.Gemini CLI does the same job with output-format json, which you pipe into jq to pull the response, the token counts, and the tool statistics. Both read from stdin, so you can send a crawl log or a diff straight in and redirect the answer to a file. Claude Code caps piped input at ten megabytes, and anything larger has to go in as a file path instead.
That single property changes what you can build. Output that comes back as validated JSON turns a chat agent into a component you can drop into a nightly job, which is the whole point when you are scoring a few thousand pages rather than fixing one bug.
Cost control belongs in the command, not in your head
Runaway spending is the standard beginner injury, and it is avoidable. The max-budget-usd flag stops a print-mode run once it has spent the amount you named, and a JSON response carries total cost for the call plus a per-model breakdown, so a script can log its own bill.Caching is the other lever. Kimi charges three dollars per million input tokens on a cache miss and thirty cents on a hit, against fifteen dollars per million output, so a job that hits the same large file repeatedly gets an order of magnitude cheaper after the first pass. Gemini's free allowance covers a thousand requests a day, which is more than most scheduled jobs need.
Which means the choice between Claude, Codex, Gemini, and Kimi Code matters less than how you drive whichever one you land on.
Reproducibility is the part beginners skip
An agent that reads your local setup gives different answers on different machines. Claude Code has a bare mode that skips auto-discovery of hooks, skills, plugins, MCP servers, and project memory files, so only the flags you pass explicitly take effect. The documentation recommends it for scripted calls and says it will become the default for print mode in a future release.Codex approaches the same problem from the permissions side, with approval modes you set before it edits files or runs commands. It also speaks the Model Context Protocol, so it can reach third-party tools and context, and it accepts images and can search the web without leaving the terminal. Both matter more than model quality once the script runs on a schedule, because a job that silently picks up a teammate's config is a job you cannot debug.
Run the boring bulk work on the free allowance, and save the metered account for the parts that need judgment. A nightly crawl summary does not need the strongest model available, and paying for one is how a twenty-dollar month quietly becomes an eighty-dollar month.