"Claude vs GPT-5 for coding" is the wrong shape of question, because neither name refers to one model. Inside Terminal X, "Claude" is four model ids that land on three different endpoints, and "GPT-5" is five current ids plus two legacy aliases. The table that picks between them is a set of literal branches in our parser's system prompt, so this page can show you the rules and the per-call prices instead of a vibes ranking.
The short version: new code goes to Claude Opus 5. Reading, explaining and refactoring existing code goes to Claude Sonnet 5. Cross-file review goes to Opus with a reviewer brief, not a builder brief. Terminal and shell work, strict JSON and function-calling go to GPT-5. Those aren't positions we're arguing for. They're the branches the router already takes on every request, and the rest of this page explains why each one is there and what it costs.
Terminal X exposes model families as short ids, and the id is what determines both the endpoint and the price. 'claude-code' is the code and website builder; it resolves to Claude Opus 5. 'claude-sonnet' resolves to Claude Sonnet 5. 'claude-opus' also lands on Opus 5, but arrives with a reviewer brief rather than a builder brief, which changes the output more than people expect. 'claude-fable' is the Claude 5-family flagship, Claude Fable 5. On the OpenAI side, 'gpt-5' resolves to GPT-5.6 Terra, 'gpt-5-pro' to GPT-5.6 Sol Pro, 'gpt-5-mini' to GPT-5.6 Luna, 'gpt-5-nano' to GPT-5 Nano, and 'gpt-5-codex' to GPT-5 Codex.
Those distinctions matter because the price spread inside one family is wider than the spread between families. Opus 5 bills at $5.00 per million input tokens and $25.00 per million output. Sonnet 5 bills at $2.00 and $10.00. GPT-5.6 Terra sits between them at $2.50 and $15.00. GPT-5 Codex is actually the cheapest premium coder on input at $1.25, with $10.00 output. Choosing "Claude" or "GPT-5" at the brand level tells you close to nothing about what a task will cost. Choosing the right variant is worth 4x.
Before the parser picks any Claude model for a code task, it runs one decision gate: is the user asking me to write new code, or asking me to read and explain existing code? Write new code goes to 'claude-code'. Read or explain existing goes to 'claude-sonnet'. "Write me X", "build Y", "set up Z", "show me how to wire W", "create a function that…" and "implement…" all fall on the write side.
That gate exists because of a specific failure mode we shipped and then fixed. Users write things like "just a quick one-liner", "no comments", "minimal, don't add extras", and a naive router reads those as cheap-model signals and downgrades to a small model. They aren't routing signals, they're brevity signals. The rule now says brevity affects the description the model receives, not the model choice, so the brief becomes "output ONLY the function body, no surrounding text" while the model stays on Opus. The counter-example the rule calls out is genuinely small: "what does this regex mean?" is a factual lookup, not code generation, and that one really does belong on a cheap model.
Refactoring is treated as reading, not writing. Refactor, improve readability, restructure existing code all route to 'claude-sonnet'. The reasoning is that a refactor is constrained by code that already exists, so instruction-following and faithfulness matter more than raw generation strength, and Sonnet 5 does that at 40% of Opus's token rate.
Code generation, refactor and debug-by-building default to 'claude-code'. The reason written next to that branch is that it tops SWE-bench Pro, with 'gpt-5-codex' as the first fallback and 'claude-opus' as the second. Treat that ranking as a snapshot: benchmark leadership rotates every few months, and the fallback chain exists precisely so a single lab having a bad quarter doesn't sink your output.
Code review is a separate branch and it deliberately does not use the builder. Review, explain, and "is this code right" route to 'claude-opus', with the stated reason being cross-file bug reasoning at a low false-positive rate. There's an explicit instruction not to use 'claude-code' as a reviewer, because a builder briefed to produce working code tends to rewrite rather than critique.
Hard architectural questions get their own exception. "Why does this work this way", deep debugging by explanation rather than by code change, and design-tradeoff questions go to 'claude-opus'. This is the branch most people never think to ask for, and it's the one that saves the most time on a legacy codebase.
There's also a scheduling behaviour worth knowing if you build web pages. When a prompt asks for a site with images, the parser schedules the image tasks first and makes the 'claude-code' build depend on every one of them, so the builder receives the real generated URLs and embeds them as actual img tags. Without that dependency link the model invents placeholder URLs and you get a page full of broken images.
Terminal and CLI agentic work is GPT-5's lane in our table. "Run this in a shell", "set up this repo", "fix the build" route to 'gpt-5' as the balanced default. The hardest agentic, scientific or security-flavoured work escalates to 'gpt-5-pro', and the reason recorded there is a #1 Terminal-Bench 2.1 result at 88.8%. 'claude-code' is the fallback on that branch, not the default.
Strict structured output is the other clear GPT-5 win, and it shows up twice in the rules. Strict-JSON output and function-calling demos route to 'gpt-5' because of native strict json_schema support. If your task is "parse this and give me conforming JSON every single time", that constraint is enforced by the API rather than by prompt discipline, and that's a real engineering difference rather than a quality opinion.
The honest mark against it: one line in our own table tells the parser to avoid GPT-5 as a code reviewer, citing high false-positive recall. That's a first-party routing preference, not a published benchmark, and it cuts both ways. If your workflow is "surface everything that might be wrong and I'll triage", high recall is exactly what you want. We optimise the default for people who don't want to triage.
Named models always win. If you type "use Codex to write a scraper", you get 'gpt-5-codex' even though 'claude-code' is the unnamed default. Same for "code in Codestral" and "use Qwen Coder". An explicit model name outranks every default in the table.
One Terminal X credit equals $0.006 of real API spend. Every task gets a pre-flight credit quote before it runs, then the actual charge is metered from the response: per-call cost is (input tokens x input rate + output tokens x output rate) / 1,000,000, and credits charged is that cost divided by $0.006, rounded up. A reconciliation pass adjusts the deduction against the pre-flight quote after each task, so a short prompt on an expensive model doesn't get billed like a long one.
The 60-credit quote on 'claude-code' looks alarming next to the others, so here's what's behind it. Sixty credits is $0.36 of API spend, and a full website build on Opus 5 is by far the most token-heavy routine operation in the product. That number is also a cap rather than a floor: on one measured build the real spend was about $1.51, and Terminal X absorbed the difference rather than billing past the quote. A single short code snippet routed to 'claude-code' costs far less than 60 credits once the meter reconciles.
For plan sizing: Basic is $4.99 for 400 credits per month. That's roughly six full website builds at the quoted rate, or about eighty GPT-5 turns at 5 credits each, or several hundred turns on the cheap coding lane. Every plan unlocks every coding model, and there is no model gating on text or code at all — the only Business-only families in the product are Kling and Runway Aleph, both video.
Not every code task deserves a flagship. When a prompt signals speed or low stakes explicitly ("quick", "fast", "I just need a helper", "speed over quality"), the parser drops to 'gpt-5-mini' at $1.00 in and $6.00 out. If you mention open source, OSS, or Llama, it routes to 'gpt-oss-120b' at $0.03 in and $0.15 out, or 'deepseek-v3.1' at $0.21 and $0.79.
The dedicated cheap coders are Codestral at $0.30 in / $0.90 out and Qwen3 Coder at $0.22 in / $1.80 out. Both quote at 1 credit. For boilerplate, small utility functions, test scaffolding and syntax translation, the gap to Opus 5 is not worth the price jump — Codestral's input rate is about 1/17th of Opus 5's and its output rate about 1/28th. The gap does open up on multi-file work, on anything requiring the model to hold an architecture in its head, and on debugging where the bug isn't where the symptom is.
You don't have to settle the argument. Ask Terminal X to compare models on a prompt and it fans the task out into one variant per model, then adds a synthesis pass that shows each take and calls a verdict. If you name the models, it uses exactly those. If you say "try three LLMs" without naming any, the default trio is Claude Sonnet, GPT-5 and Gemini Flash.
The fuse step quotes at 5 credits and runs on Sonnet over an input containing every variant answer. Costs are additive, so comparing Opus 5 against GPT-5 Codex on one prompt costs both models plus the fuse. That's the honest tradeoff of an ensemble: you pay for every take. It's worth it on a decision you'll live with for months, and wasteful on a helper function.
The web app is not an IDE agent. It has no index of your repository, no access to your local filesystem, and no ability to produce a diff against your working branch. You paste code or attach files, and you get code back.
The one surface that does touch your machine is the TX Agent CLI — the tx command, installed from npm. It runs locally and has consent-gated file-read, file-write, file-edit and shell tools, so it can change files in place. It is still a terminal agent rather than an editor plugin, and it has no whole-repo index. If you want a model that reads an entire codebase and proposes diffs inside your editor, an IDE-integrated tool is the right category.
The GitHub connector can create repos and push, and it quotes at 10 credits, but that's a connector action rather than repo-aware editing. It doesn't read your whole codebase for context before it writes.
There is no per-project configuration that pins a house style, no linting or CI integration, and no human in the loop reviewing output. Everything on this page describes automated model selection, not a service. And the benchmark claims baked into the routing table are point-in-time; they were current when the rules were last tuned and they will shift. The fallback chains exist because we assume they will.
| Terminal X id | Resolves to | $ / 1M in | $ / 1M out | Quoted credits | Routed for |
|---|---|---|---|---|---|
| claude-code | Claude Opus 5 | $5.00 | $25.00 | 60 | Writing new code, full websites, multi-file builds |
| claude-opus | Claude Opus 5 | $5.00 | $25.00 | 6 | Code review, architecture reasoning, deep debugging |
| claude-sonnet | Claude Sonnet 5 | $2.00 | $10.00 | 4 | Refactors, explaining existing code, restructuring |
| gpt-5 | GPT-5.6 Terra | $2.50 | $15.00 | 5 | Terminal/CLI agentic work, strict JSON, function calling |
| gpt-5-pro | GPT-5.6 Sol Pro | $5.00 | $30.00 | 12 | Hardest agentic and security work |
| gpt-5-codex | GPT-5 Codex | $1.25 | $10.00 | 4 | Named "Codex" requests; first fallback on code gen |
| gpt-5-mini | GPT-5.6 Luna | $1.00 | $6.00 | 2 | Explicit fast/cheap low-stakes code help |
| codestral | Codestral | $0.30 | $0.90 | 1 | Cheap lane: boilerplate, utilities, scaffolding |
| qwen-coder | Qwen3 Coder | $0.22 | $1.80 | 1 | Cheap lane alternative |
| claude-fable | Claude Fable 5 | $10.00 | $50.00 | 15 | Explicit "best, cost no object" asks only |
They win different branches. Terminal X sends new code generation to Claude Opus 5 and code review to Claude Opus with a reviewer brief, and sends terminal/shell agentic work, strict JSON and function-calling to GPT-5. Our own routing table also tells the parser to avoid GPT-5 as a code reviewer because of high false-positive recall, which is a preference rather than a benchmark. If you want one answer: Claude for producing and auditing code, GPT-5 for driving a shell and for guaranteed-shape structured output.
One credit is $0.006 of API spend. A GPT-5 turn quotes at 5 credits, a Sonnet 5 refactor at 4, an Opus 5 review at 6, and a full website build on Opus 5 at 60 (about $0.36). The quote is pre-flight; the actual charge is metered from real token counts as (input x rate + output x rate) / 1M, divided by $0.006 and rounded up, then reconciled against the quote. Short prompts on expensive models are billed as short prompts.
Yes. An explicit model name always outranks the default. Saying "use Codex to write a scraper" routes to gpt-5-codex even though claude-code is the unnamed default for new code. The same applies to Codestral and Qwen Coder.
Because claude-code resolves to Claude Opus 5 at $5/$25 per million tokens, and a whole-site build is the most token-heavy routine operation in the product. Sixty credits is also a cap rather than a floor. One measured build cost about $1.51 in real API spend and Terminal X absorbed the difference instead of billing past the quote.
Not from the web app — it has no repository index, no local filesystem access, and cannot produce a diff against your branch. You paste code or attach files and get code back. The TX Agent CLI is the exception: it runs on your machine and has consent-gated file-read, file-write, file-edit and shell tools, so it can change files in place, though it still has no whole-repo index. The GitHub connector can create a repo and push at 10 credits, but that is a connector action, not repo-aware editing.
Yes. Ask for a comparison and Terminal X fans the task into one variant per model plus a synthesis pass that shows each take and calls a verdict. Name the models and it uses exactly those; say "three LLMs" without naming and the default trio is Claude Sonnet, GPT-5 and Gemini Flash. The fuse quotes at 5 credits, and costs are additive across every variant.
Or skip the comparison shopping: Terminal X routes one prompt to the right model automatically — and runs several in parallel when a job needs more than one.