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.
#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.
#What's free and what's paid at Anthropic
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.
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.
#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.
- 01Choose the model based on the taskClaude 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.
- 02Limit what the agent readsEvery 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.
- 03Clean up the sessionRun /clear between unrelated tasks, and /compact when a long conversation continues. Sending a two-hour history with every message is the first major expense.
- 04Prefer the subscription for regular useA 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.
- 05Use a cloud provider you already have a contract withClaude 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.
- 06Delegate part of the work to a local modelThis 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.
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.
- 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.
#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.
#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
Is Claude Code free?+
Can you try Claude Code for free?+
How much does Claude Code cost?+
Claude Code with Ollama: is it really free?+
Can a local model match Claude in Claude Code?+
Does Claude Code work offline?+
#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.
- Use Ollama in Claude Code and Cursor: step-by-step configuration
- OpenCode + Ollama: the open-source coding agent in the terminal
- Cline + Ollama: 100% local coding agent in VS Code
- Free local Copilot: Cline, Tabby, and CodeGeeX
- Free LLM APIs: the real comparison and the local option
- Ollama Cloud: pricing, reviews, and limitations
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.
- Anthropic: pricing page (subscriptions and API)
- Anthropic: Claude Code official page
- Claude Code documentation: overview and installation
- Ollama documentation: integration with Claude Code
Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.