Beginner 9 minIDE

Free Claude Code? Pricing, options, and models locaux

Free Claude Code? No, not in its standard form: Anthropic's coding agent installs without payment, but it only works with a paid subscription or an API account billed based on usage. This guide explains what's free and what's not, compares subscriptions with token-based billing, and reviews the real ways to pay less, including connecting a local model through Ollama. The technical setup is covered in a separate tutorial.

By Thomas P.·Update 2026-10-10·Tested on Windows, macOS, and Linux

#Free Claude Code: the short answer

Claude Code is a coding agent: a command-line program with extensions for VS Code and JetBrains IDEs that reads your repository, edits files, runs commands, and fixes its errors. The program itself can be downloaded and installed for free. But it does nothing on its own: every action goes through a Claude model hosted by Anthropic, and access to that model is what you pay for.

Claude.ai's free plan provides access to web chat, not Claude Code. To use the agent, you need either a paid subscription (Pro, Max, Team, or Enterprise) or an API account on the Anthropic Console, billed by the number of tokens consumed. There is no permanent free version of Claude Code with Claude models.

The software
Free. Install via npm, a script, or editor extensions, with no payment.
Claude models
Paid. Either included in a subscription with usage limits or billed by the token through the API.
Claude.ai's free plan
Does not cover Claude Code. It is for chat in the browser or app.
A local model instead of Claude
Possible without a subscription: Claude Code accepts a compatible server, and Ollama provides one. The quality is not that of Claude models.
i
What this guide covers
The pricing question and options for reducing it. Step-by-step configuration of Ollama in Claude Code is covered in our dedicated tutorial, linked at the end of the page. This guide also does not compare coding agents with one another.

#What's free and what's paid at Anthropic

The Local Copilot Kit

This guide gets you to the model. The kit gets you to the coding copilot in your editor.

  • Lifetime online access
  • PDF + files
  • Lifetime updates

Anthropic sells access to its models in two distinct ways, and Claude Code can use either one. The distinction matters because the bill looks completely different depending on which path you choose.

Claude.ai free plan
Limited chat in the browser and app. No access to Claude Code, no API access.
Pro and Max subscriptions
Monthly plan for one person. Claude Code is included, within a usage volume that resets every few hours, with a weekly cap. Max is a higher Pro tier, with several times more usage.
Team and Enterprise subscriptions
Same principle, billed per seat, with centralized administration. Claude Code is available through them depending on the contract options.
API through the Anthropic Console
No plan: you pay for every million input tokens and every million output tokens. The price depends on the model (smaller models cost less than larger ones), and output tokens cost more than input tokens.
!
Amounts change: read the official page
We deliberately don't reproduce pricing here. Anthropic changes it, adds tiers, and changes the model lineup without notice. Only Anthropic's pricing page, linked at the end of this guide, is authoritative when you make your decision. As a rough figure, already mentioned in our Ollama + Claude Code guide: the entry-level subscription costs around twenty dollars per month. Prices are shown in dollars, before taxes; VAT is added according to your country.

One point that often surprises people: with a subscription, the account is the same one you use for Claude.ai. You sign in to Claude Code with your Claude credentials, and the volume used by the agent is shared with your chat conversations. With the API, you create a key in the Console, add credit, and each Claude Code session deducts from that credit.

#Subscription or API: which costs less?

The answer depends on usage volume. A coding agent consumes far more tokens than a chat: on every turn, it sends the conversation history, the contents of read files, and command results back to the model. In a medium-sized repository, a single refactoring task can easily represent several hundred thousand input tokens. When billed by the token, this volume shows up on the bill; with a subscription, it is absorbed by the plan up to the window limit.

Occasional use
A few sessions per week on personal projects: the entry-level subscription is generally sufficient, and its cap protects you from an unpleasant surprise.
Heavy daily use
The agent runs all day: the subscription remains predictable, but window limits become noticeable. Max or the API become the two options to compare against your own usage.
Team
Team or Enterprise for seat management and unified billing; the API for shared internal tools.
Automation
Scripts, continuous integration, and the Agent SDK use the API and a key, not a personal subscription.

With the API, Claude Code displays the cost of the current session. With a subscription, it displays the limit status. These two commands are the first thing to check before trying to reduce costs: you can only reduce effectively what you measure.

In a Claude Code session
/cost     # dépense de la session (facturation API)
/usage    # limites restantes de l'abonnement
/compact  # résume la conversation pour alléger le contexte
/model    # change de modèle (un modèle plus petit coûte moins cher)
→
Prompt caching works in your favor
The Anthropic API charges less for input tokens that have already been sent and cached. Claude Code benefits from this automatically for the session history. In practice, chaining tasks in the same session costs less than restarting the agent from scratch with the same context, as long as the conversation remains reasonable.

#Reduce your bill without leaving Claude Code

Before changing tools, several settings reduce token consumption, and therefore API cost or the rate at which a subscription reaches its limit. They require no installation.

  1. 01
    Choose the model based on the task
    Claude models do not all cost the same. Renaming variables, writing a unit test, or explaining a function does not require the most expensive model. Switch to the smallest model with /model for these tasks, and return to the larger model for architecture or difficult debugging.
  2. 02
    Limit what the agent reads
    Every file you read enters the context and stays there until the session ends. Give precise instructions (“modify only the payment module”), avoid launching the agent on a huge repository without scope, and keep your CLAUDE.md file short: it is injected on every turn.
  3. 03
    Clean up the session
    Run /clear between unrelated tasks, and /compact when a long conversation continues. Sending a two-hour history with every message is the first major expense.
  4. 04
    Prefer the subscription for regular use
    A plan caps your spending. If you see that your monthly API bill is higher than the price of a subscription, switch. The reverse is also true: infrequent use costs less per token.
  5. 05
    Use a cloud provider you already have a contract with
    Claude Code officially works with Claude models served by Amazon Bedrock, Google Vertex AI, and Microsoft Foundry. If your company already has credits or a commitment with one of them, the bill goes through that account, under the provider's terms.
  6. 06
    Delegate part of the work to a local model
    This is the most radical option: zero subscription cost for tasks assigned to the local model. It has limitations, detailed in the next section.

#Claude Code with a local model: what changes

Claude Code communicates with its model through Anthropic's Messages API. Since its recent versions, Ollama exposes an API compatible with this format, and Claude Code accepts an alternative server address through the ANTHROPIC_BASE_URL variable. The result: you keep Claude Code's interface, commands, and behavior, but the responding model is an open-weight model downloaded to your machine. No token is sent to Anthropic, and no subscription is required.

Quick method with a recent Ollama
ollama launch claude
# Ollama propose un modèle, puis démarre Claude Code branché dessus

The Ollama documentation also describes the manual method using environment variables, which is useful for a script or alias. Our tutorial Ollama in Claude Code and Cursor explains it in detail, along with model selection and context settings; we do not repeat it here.

!
This is not Claude
A local model with 9 to 30 billion parameters, in Q4 quantization, does not match Claude models on long agent tasks: chaining ten dependent tool calls, maintaining context across an entire repository, or fixing a subtle error. It handles short, well-defined tasks well. Promising equivalence would be false; the right use is hybrid.
What you gain
No more subscription for tasks assigned to the local model, no data sent to a third party, offline operation, and no window limit.
What you lose
The quality of Claude models for long-form reasoning, contexts of several hundred thousand tokens, and knowledge of the latest libraries.
What you still pay for
The hardware and electricity. A graphics card running under load for hours shows up on your energy bill, even if the overall cost remains well below a subscription.
The model must handle tools
Claude Code relies on tool calls (read, edit, execute). A model without this capability makes the agent unusable. The families cited on this site for coding—Qwen3-Coder, Devstral, gpt-oss, and GLM Flash—support it.

On the hardware side, the site's guidelines apply: a 7-billion-parameter model in Q4 uses about 5 GB of VRAM, a 14B model about 9 GB, and a 32B model about 19 GB, not counting the context. A RTX 3060 with 12 GB is the practical minimum for a coding agent; a 16-to-24 GB card or a Mac with unified memory opens up 24B to 30B models, which are much more comfortable in agent mode. A large context—32,000 tokens or more—is necessary for an agent to read multiple files; it consumes memory in addition to the model.

i
A “cloud” model from Ollama is not local
The Ollama selector also offers models whose names end in cloud. They run on Ollama's servers, with a limited free tier followed by a paid offering. Handy for trying a very large model, but your data leaves your environment and the cost returns. Our guide covers Ollama Cloud's limitations in detail.

#Compatible providers: pay less without hardware

Between an Anthropic subscription and a local model, there's a third option: keep Claude Code, but connect it to a different remote server than Anthropic's. Three provider categories are available, with very different guarantees.

Officially supported clouds
Amazon Bedrock, Google Vertex AI, and Microsoft Foundry serve the real Claude models. Claude Code supports them natively; billing follows the cloud account. Same quality, different bill, and sometimes a chosen data location.
Open-weight model hosts
Several open-model developers (Z.ai's GLM, Moonshot's Kimi, DeepSeek, MiniMax, among others) expose an API in Anthropic's format and document its use with Claude Code, generally at lower prices. Claude is no longer responding: quality depends on the model selected, and the servers are often outside the European Union.
Enterprise gateways
A proxy such as LiteLLM, placed in front of multiple providers, can route each request to the cheapest suitable model, with cost tracking by team. Claude Code connects to it like any compatible server.

Before entrusting your code to a compatible provider, verify five points: actual compatibility with the Messages API and tool calls, the accepted context size, the hosting country and data-use terms, the price per million input and output tokens, and whether a spending cap exists. A low rate without a cap remains a risk.

!
Confidential code: read the terms
A cheaper provider may retain your requests or use them to train its models. For code covered by a confidentiality agreement or subject to the GDPR, the only option without data transfer is a local model; otherwise, use a cloud with European hosting and a clear contract.

#Free alternatives to Claude Code

If the goal is a coding agent without a subscription, rather than Claude Code specifically, open tools can do the same work with a local model. They're free in the strict sense: no license, no plan. The hardware remains.

OpenCode + Ollama
Open-source coding agent in the terminal, very similar to Claude Code in use. Ollama can launch it directly with a local model. See our OpenCode + Ollama guide.
Cline + Ollama
Coding agent in VS Code, with plan mode and execution mode. Our Cline + Ollama guide details the setup and which models work well for different amounts of VRAM.
Local alternatives to Copilot
For code completion in the editor, Tabby and CodeGeeX complement Cline. See our guide to free Copilot alternatives.
Free APIs with quotas
Some providers offer limited free usage, sometimes in exchange for your data. Our comparison of free LLM APIs explains where they fall short and when local is the healthier option.

The word “free” needs clarification. A local agent on a 12 GB card works with no monthly expense, but it consumes electricity and assumes you already have a suitable computer. If you need to buy a graphics card, compare its price with several years of subscription fees before deciding; the calculation is different for recreational use and daily professional use.

#Which option is right for you: decision matrix

Want to try Claude Code without paying
Install it, connect it to Ollama with a 9B to 14B coding model. You get to explore an agent's interface and behavior; you are not evaluating Claude's quality.
Independent developer, regular use
Pro subscription, then Max if the limits get in the way. A local model in parallel for simple tasks and offline work.
Confidential or NDA-protected client code
Local model for this repository, with Claude Code or OpenCode as you choose. Cloud for everything else.
Team of several people
Team or Enterprise, or an already-contracted cloud (Bedrock, Vertex, Foundry) with Claude Code connected to it. A gateway if you want project-level cost tracking.
Small budget, 12 GB card
Local agent with a 9B model in Q4, accepting its limitations. Entry-level subscription during the month when a project requires more.
No graphics card
Subscription, or a compatible provider after verifying the terms. A local model running on the CPU alone is too slow for a coding agent.

#Frequently asked questions

Claude Code: pricing and free options
Is Claude Code free?+
The software is free; usage is not. Claude Code works only with a paid Claude subscription (Pro, Max, Team, Enterprise) or an API account billed by the token. Claude.ai's free plan does not provide access.
Can you try Claude Code for free?+
There is no documented permanent free trial for Claude Code with Claude models; any promotional offers are announced on Anthropic's website. The free way to test the interface is to connect Claude Code to a local model through Ollama.
How much does Claude Code cost?+
It depends on the route: a monthly subscription fee, or a bill proportional to token usage with the API. Amounts change; Anthropic's pricing page is authoritative. For regular use, the subscription is generally more predictable.
Claude Code with Ollama: is it really free?+
Yes, in the sense that there is no subscription or per-token bill: Ollama and open-weight models are free. You pay for the hardware and electricity, and you give up the quality of Claude models on long tasks.
Can a local model match Claude in Claude Code?+
No. A 9 to 30B model in Q4 handles short, well-scoped tasks, not long agent sessions on a large repository. The sensible approach is hybrid: local for everyday and confidential work, Claude for difficult tasks.
Does Claude Code work offline?+
Only with a local model. Connected to Ollama, the agent needs no connection. With a subscription or the API, every action goes through Anthropic's servers.

#Go further

You now know what's free or paid, and which option fits your situation. The logical next step is setup, covered in the following guides.

Guide written on October 10, 2026. The access rules (free plan without Claude Code, subscriptions, or API) match Anthropic's documentation; the amounts aren't reproduced here because they change, and the official pricing page is authoritative. The method for connecting through Ollama follows the integration page in Ollama's documentation, whose commands change from one version to the next.

Did this guide help you?

Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.