Claude Code vs Codex vs Cursor: What Coding Agents Really Cost in 2026
< BlogDeep Dives
November 9, 2026
16 minutes read

Claude Code vs Codex vs Cursor: What Coding Agents Really Cost in 2026

Vincent Pistor
Vincent PistorVP Commercial

Claude Code, Codex, and Cursor are coding agents that read repositories, edit files, and carry out multi-step tasks. While their subscriptions can look similar at the entry level, the included usage, model access, and charges after that allowance runs out determine what you end up paying.

The less obvious variable is context: the code, conversation, tool outputs, and instructions sent back to the model as a task progresses. In this post, we’ll first compare the three vendors’ 2026 plans, then look at how that recurring input affects usage limits and token-priced costs, using a real Claude Code usage report and our own persistent-memory measurements.

Here’s how the current plans and representative model rates stack up:

Claude CodeCodexCursor (The X Subscription)
Entry planPro, $20/mo ($17 annual)Plus, $20/moPlus, $8/mo (Premium, $30/mo, adds Claude and GPT at API prices)
Heavy-use plansMax, $100; Ultra, $200Pro 100, $100; Pro 200, $200; Pro 500, $500Super, $100; Ultra, $200
Business / Team seatStandard, $25/mo ($20 annual); Premium, $125/mo ($100 annual)Standard, $25/mo ($20 annual); Premium, $125/mo ($100 annual)$30, $100, or $200 per seat/mo
Example model, API rate per 1M tokensSonnet 5.5: $2 input, $10 output, $0.10 cache readGPT-6.1 Sol: $2 input, $10 output, $0.10 cached inputGrok 4.7: $2 input, $6 output, $0.50 cache read
Usage windowFive-hour limit plus weekly limit on most paid plans; Ultra has no five-hour limit for verified accounts (Anthropic verifies them automatically)Five-hour and weekly limits on Plus and Business Standard; Pro 100/200/500 and Business Premium currently have no five-hour limitOne weekly pool of Cursor-model usage shared across Cursor and Grok products
When included usage runs outUsage credits continue at standard API rates once enabledPlus and Pro users can buy credits; Business workspaces with flexible pricing can buy workspace creditsPrepaid top-ups; third-party Claude and GPT models use API list pricing, plus the Cursor Token Rate on eligible Teams requests

Prices and usage limits were checked against Anthropic, OpenAI, and Cursor on November 1, 2026. The API token rates in the table are for reference: subscription allowances aren’t necessarily drawn down at those rates. Plans change frequently, so check the vendor pages before relying on the figures presented here.

Why the plan price doesn’t tell you how much usage you get

Models don’t remember earlier calls, so every request resends whatever context the agent needs to continue the task.

Anthropic says that Claude Code sends the conversation so far, project context such as CLAUDE.md and files it has read, and the new prompt. As sessions grow, /compact and automatic compaction reduce that history.

Codex and Cursor have their own compaction mechanisms, but the same cost pressure applies — more retained context means more input for subsequent calls to process.

Prompt caching makes repeated context much cheaper without eliminating its token usage. Sonnet 5.5 and GPT-6.1 Sol currently charge 5% of the fresh-input rate for cache reads, whereas Grok 4.7 in Cursor charges 25%. Cache hits need an exact prefix match, so a change early in the context sends everything after it back through at the fresh-input rate.

Three calls in one coding-agent session: call 1 sends a prompt with a little project context, call 8 adds conversation history, files read, tool results, and instructions, and call 25 passes a much larger accumulated context through compaction before it reaches the model

Each call resends what came before it. Fresh input is billed at the full rate, a cached prefix at a lower rate, and compaction summarizes the history once it grows large.

Anthropic puts the average Claude Code cost across enterprise deployments at about $13 per developer per active day, or $150–$250 per developer per month — that’s metered enterprise spend. A Pro subscriber pays a flat $20, uses the plan’s allowance first, and can then add usage credits.

Model improvements can reduce that expense: Anthropic says Opus 5.5 costs about 40% less per task than Opus 5. But even with a more efficient model, repeated context can continue consuming allowance or credits throughout a long session.

The same growing context hits rolling usage limits in Claude Code, a shared Work and Codex allowance in ChatGPT, and a weekly pool or prepaid credit balance in Cursor. The sections below outline how each of the products handles them.

Claude Code: Terminal-first automation with rolling usage limits

Claude Code pairs subscriptions with rolling usage limits. Anthropic says the conversation history grows faster than anything else sent with a request, and that it’s where both cost and context limits originate. Two people on the same plan can reach those limits at very different times: short, focused sessions consume less allowance than long runs that accumulate files, tool results, and conversation history.

Anthropic’s advice is to run /clear when starting a new task and /compact when continuing a long one; it calls /clear “the single most effective lever for both quality and cost.”

CLAUDE.md is sent with every turn, so whatever goes into Claude Code’s memory files is a fixed cost on every call.

Solid choice for: Terminal-first engineering workflows and long autonomous runs where Claude is already the preferred model family.

Probably not for: Those who want several model families inside the same coding tool, or heavy usage without rolling or weekly limits.

Codex: Included with ChatGPT, with a shared allowance

Codex is included with ChatGPT plans and shares its allowance with ChatGPT Work, OpenAI’s agent for delegating multi-step tasks across your apps and files. In December 2026, Plus, Pro, and Business plans move to one token-based allowance for all of ChatGPT and Codex, with Instant chat excluded.

Long context is also cheaper inside the subscription: GPT-6.1 Sol API requests above 272K input tokens cost 2× for input and cache and 1.5× for output across the whole request, while subscription usage in Codex carries no long-context surcharge.

Solid choice for: Existing ChatGPT subscribers who want Codex included in the same account and can plan Work and coding usage against one allowance.

Probably not for: Anyone who needs to forecast coding usage precisely, since from December coding shares one allowance with all ChatGPT use outside Instant chat.

Cursor and Grok: IDE-first coding with a shared weekly pool

On October 12, 2026, xAI introduced The X Subscription, which bundles Grok, Grok Bot, Cursor, and X Premium in one plan. Its weekly pool includes Cursor models such as Grok and Composer and is shared across Cursor and Grok products. Third-party models such as Claude and GPT aren’t included in that pool; Premium and higher individual plans can use them at API list price from prepaid credit, and eligible requests on Teams and Enterprise add the $0.25-per-million Cursor Token Rate.

Beyond the included pool, Grok 4.7’s output is cheaper than Sonnet 5.5’s ($6 vs $10 per 1M tokens), but its cache reads cost five times as much ($0.50 vs $0.10). A call carrying 50K cached and 2K fresh tokens costs about $0.029 in input on Grok 4.7, against $0.009 on Sonnet 5.5. Requests above 256K in Cursor bill at twice the standard rate.

Solid choice for: Users who want an IDE-centered coding agent and are comfortable using Grok or Composer for included usage.

Probably not for: Companies standardized on Claude or GPT that expect those models to be included in the Cursor subscription price.

What 48 hours of heavy agent use can consume

In August 2026, a Claude Code Max 20x subscriber published an analysis of 48 hours of local transcripts on the Claude Code issue tracker. Priced at API list rates, mostly for Opus 5, those two days came to $1,876: $1,121 in cache reads, $585 in cache writes, $169 in output, and under $1 of fresh input. The subscriber paid only the flat Max fee; $1,876 is what the same usage would have cost on the API.

Several sessions had grown to roughly the 1M-token ceiling, and a single instruction fanned out to 20–47 API calls on average. The author estimated that capping the auto-compaction window at 200K tokens would cut the per-call floor from roughly $0.50 to $0.10.

A 14-day follow-up found that requests above 500K tokens made up about a quarter of requests but more than half of cache-read spend. The same logs show oversized sessions stopping abruptly on August 20: none exceeded 471K afterward, and spend on contexts of 600K or more went from $2,508 before that date to $0 after. The author only changed their own compaction setting, to 500K, on August 23, so the setting can’t explain the drop.

That report ran mostly on Opus 5, and Anthropic says Opus 5.5 costs 40% less than Opus 5 on typical workloads. The context each call carries grows the same way on either model.

At current Sonnet 5.5 rates, 50K cached input tokens plus 2K fresh ones cost about $0.009 in input charges, compared with roughly $0.104 if all 52K tokens are fresh. Both examples exclude output and cache-write charges. Each call is cheap; the bill grows because long sessions make thousands of them, carrying a cached prefix that keeps growing.

Two prompts side by side, without and with prompt caching: both carry the same repeated context plus a new request and use the same amount of the context window, but with caching the repeated part is billed at a lower cached rate

Prompt caching bills the repeated prefix at a lower rate. The prompt itself is just as long and takes the same space in the context window.

How persistent memory impacts context costs

An AI agent memory system can reduce the amount of durable project knowledge that has to stay in the active conversation. Instead of carrying the same repository facts, decisions, or earlier findings through every later turn, a coding agent like Claude Code or Codex can store them once and retrieve a much smaller context when they become relevant again. The working context for the current task still has to be sent; what memory removes is material carried forward only so the agent can recall it later.

A memory corpus of code files, docs, tickets, chat notes, decisions, and summaries passes through query and retrieval, which returns a few relevant pieces (a file, a decision note, an API detail, a previous fix) as a small working context for the agent

A memory layer stores the project corpus once and retrieves only the few pieces the current task needs, so the prompt carries those instead of the whole corpus.

We measured this in our token-cost study, using one cognee configuration with a fixed top_k=10. Full-context prompting sent the entire 201,987-token corpus with every question; retrieval through cognee averaged 1,864 tokens. On a corpus 12.5× smaller (16,075 tokens), retrieval averaged 1,118 tokens, so query-time context grew far more slowly than the corpus.

The larger run used Sonnet 4.5, now deprecated, so the figures below apply its list rates ($3 input, $15 output, $0.30 cache read) to the study’s measured token counts; the study itself didn’t test caching. At those rates, full context costs about $0.61 of input per question ($0.06 if served entirely from cache), against roughly half a cent for retrieved context. The study puts break-even at about 23 questions, counted in tokens; in dollars it takes longer, because graph extraction is output-heavy and output cost five times as much as input on Sonnet 4.5.

The cost of building memory depends on how the graph is extracted. Since September 2026, cognee can run extraction with GLiNER, a small encoder that pulls entities and relationships out locally, and v1.6.0 made that the keyless default, paired with local fastembed embeddings, so ingestion needs no paid model API. Here’s how each option compares on the larger corpus:

How the memory is builtOne-time costWhen memory becomes cheaper than full context
LLM summarization and LLM graph extraction (the study, Sonnet 4.5)about $45after ~76 questions; ~830 if full context is always cached
LLM summaries, graph extracted by GLiNER (estimate)about $9.50after ~16 questions; ~170 if full context is always cached
Fully local GLiNER path, no paid model API during ingestion$0 in paid model API tokens; local compute still requiredfrom the first question
cognee Cloud at $1 per 1M tokens processed~$0.20 if 202K tokens are billablefrom the first question; ~4 if full context is always cached

These rows compare input charges only, exclusive of answer generation, retrieval infrastructure, storage, and local compute. The study’s corpora were deliberately fact-dense, so ingestion costs will vary by codebase.

The Cloud row assumes the 202K corpus tokens are what gets billed, and the free Cloud tier includes 1M tokens.

The GLiNER rows are also untested on answer quality: the open-source extractor is a demo of our production one, which has higher accuracy and broader label coverage, and we haven’t yet compared its graphs with LLM-built ones.

Line chart of cumulative cost over 100 repeated questions: full context climbs steeply from $0, LLM-built memory starts at about $45 and breaks even after about 76 questions, GLiNER graph memory starts at about $9.50 and breaks even after about 16, and local GLiNER has no paid API cost for ingestion

Cumulative input cost on the study's 202K-token corpus. The less a memory costs to build, the fewer questions it takes to undercut sending the full context.

Which plan makes sense for which usage pattern?

Your usagePricing tier to start withDoes persistent memory change the cost?
A few short, focused coding sessions each weekEntry subscription: Claude Pro, ChatGPT Plus, or X Subscription Plus if its included models are sufficientLittle. Short sessions give caching and compaction less accumulated context to manage.
Heavy daily use with long autonomous runsHigher-usage Claude, ChatGPT, or X Subscription tierNoticeably. Durable information can be retrieved when needed instead of occupying the active context across a long run.
Repeated questions over a stable codebase or other persistent corpusAny tier; choose by preferred model and interfaceMost. The study’s numbers apply here directly: one ingestion cost spread across many later questions.

Whichever tier you start on, the part of the cost you control is how much context each call carries. In the 48-hour report, requests above 500K tokens were a quarter of all calls and more than half of cache-read spend, so clearing between tasks and compacting long sessions early lowers usage on any plan. If your sessions often run long, compare models on cache-read price before output price: cache reads are what a long session pays on nearly every call.

Adding a persistent memory layer like cognee makes sense once the same material keeps reappearing in your requests, such as architecture notes, conventions, or earlier findings re-sent every session or carried through a long one. In our study, full-context prompting sent the whole 202K-token corpus with every question, while cognee retrieved an average of 1,864 tokens — less than 1% of that.

FAQ

Answers to the most common questions from this guide.

Is Claude Code included in a Claude Pro subscription?

Yes. Claude Pro costs $20 a month, or $17 a month billed annually, and includes Claude Code under a five-hour limit and a weekly limit. Max ($100) gives five times Pro’s usage, and Ultra ($200) has no five-hour limit for verified accounts. If you hit a limit, you can enable usage credits, billed at standard API rates.

Does Cursor’s X Subscription include Claude and GPT models?

No. The included weekly pool is limited to Cursor models: Grok 4.7, Grok 4.6, Grok 4.5, and Composer 2.5. On Premium ($30 a month) and higher plans, Claude, GPT, and Gemini are available at API list price from prepaid credit, and eligible Teams and Enterprise requests add a $0.25-per-million Cursor Token Rate.

What happens when you hit Codex usage limits?

Plus and Business Standard have five-hour and weekly limits; Pro plans and Business Premium currently have no five-hour limit, though weekly limits can still apply. Past the limit, Plus and Pro users can buy credits, and Business workspaces with flexible pricing can buy workspace credits. From December 2026, Plus, Pro, and Business plans move to one token-based allowance shared across ChatGPT and Codex.

Why do long coding sessions use up limits faster?

Every request resends the conversation so far, the files the agent has read, tool results, and instructions, so each call in a long session carries more input than the last. Prompt caching makes that repeated input cheaper but still counts it. Running /compact or /clear in Claude Code, or relying on automatic compaction, cuts how much each call carries.

Can persistent memory lower coding agent costs?

It can when much of the repeated context is reusable project knowledge. In our token-cost study, cognee retrieved an average of 1,864 tokens per question instead of sending the full 201,987-token corpus. Building the memory has its own cost, so the savings depend on how many later questions reuse it.

Related reading

Coding Agents Don't Need Bigger Context Windows — They Need Better Memory
5 AI Memory Tools for Small Models and Local Agents (2026)
AI Observability Tools: 8 Platforms for Tracing AI Agents in 2026
Get started

Cognee is the fastest way to start building reliable Al agent memory.

Cognee Cloud
Latest
Claude Code vs Codex vs Cursor: What Coding Agents Really Cost in 2026
Coding Agent Memory with cognee: Hooks, Capture, and Recall
Dataset Routing in cognee: How recall() Picks Which Datasets to Search