You know the screen: session limit reached, 100% used, reset at 1 PM. It kills your flow every time.
Here is the fix. You can run Claude Code completely free, offline, and without any usage limits by pointing it at a local open-source model through Ollama. No API key, no Max plan, no credit cap. The catch? Your computer does the heavy lifting, and it will be slower than the hosted version.
This guide walks you through the whole setup in eight steps. You will install Ollama, pick the right model for your hardware, pull it down, install Claude Code, and connect the two with one command. Then you will test it and see exactly what you are trading for the freedom.
By the end, you will have a working local setup and a clear idea of whether your machine can handle it. Let's get that limit screen out of your life.
Quick Tips Before You Start
Check your free space
The 30B model needs about 19 GB of disk, so clear room before you pull.
Know your RAM
You need roughly 18–20 GB of free unified memory or VRAM for the full 30B build.
Close other apps
Local models eat resources, so shut down heavy programs before you launch.
Have your install command ready
You will paste one line into the terminal, so keep it handy.
Expect a wait
The download takes a few minutes, and responses are not instant. Patience helps.
1. Ollama runs the model on your machine

Once the session limit has you looking for a way out, the first thing to grab is Ollama. It's the piece that actually does the work, because it downloads and runs open-source language models straight on your laptop, desktop or PC. No cloud, no subscription, no key sitting between you and the model.
Go to ollama.com and get the build for your operating system, then run the installer the way you'd run any other app. When it opens you'll land in a plain chat window that looks a lot like ChatGPT, Gemini or Claude. You can type in it and get answers immediately, which is a nice way to confirm the thing actually works.
Now close that window, because you don't need it for any of this. Ollama is the engine; Claude Code is the dashboard you'll be using. Leaving the chat open holds memory you'll want for the model later, and on a 16 GB machine that matters more than you'd think.
💡 Tip: Ollama runs in the background after install, so you can close the window and it will still be ready when you need it.
| Model | Tag to pull | Rough hardware | Best for | Catch |
|---|---|---|---|---|
| Qwen3-coder 30B | qwen3-coder:30b | 18–20 GB free RAM/VRAM, 19 GB disk | Most capable local option for standard PCs | Slow responses; needs a beefy machine |
| Qwen3-coder 480B | qwen3-coder:480b | Hundreds of GB; effectively a supercomputer | Not practical for home use | Will not run on a standard PC |
| GLM-4.7 | glm-4.7 | Similar to 30B class | Alternative to Qwen3-coder | Check Ollama page for exact size |
| OpenAI open models | Varies | Not recommended | None for this use case | Described as weak and unused by most people |
2. The recommended models are Qwen3-coder and GLM-4.7

Having the engine installed doesn't mean every model on the shelf is worth pulling. On the Ollama homepage there's a Claude Code section with a recommended list, and it mixes three names: Qwen, GLM by Z, and two open-source OpenAI models.
Skip the OpenAI pair. They're known to be weak and hardly anyone uses them for real coding work. The two that earn their download are Qwen3-coder and GLM-4.7 – both built with code in mind, so either gives you something usable inside Claude Code.
If you're torn, start with Qwen3-coder. It's the one with the most walkthroughs behind it, so when something misbehaves you're troubleshooting a well-worn path instead of guessing.
3. Pick a model size your hardware can run

Qwen3-coder comes in roughly two builds: a 30B version and a 480B version, and the gap between them is the whole decision. Bigger generally means smarter, but it also means heavier, and anything above about 40 billion parameters simply won't run on a standard PC.
The 480B build effectively needs a supercomputer. Even a high-spec MacBook Pro struggles with it. A gaming PC with a serious graphics card might carry you slightly past the 40B line, but for most machines the 30B version is the realistic ceiling.
Capability is the reason it's still worth it. Benchmarks put Qwen3-coder well ahead of DeepSeek, plain Qwen3 and Gemini 2.5. If you want to see how the big hosted models stack up against each other, Claude vs ChatGPT vs Gemini puts all three through the same tasks. So pick the 30B unless you know exactly what your hardware can take – it's the sweet spot between a model that's clever and one that actually loads.
⚠️ COMMON MISTAKE
Do not grab the biggest model
Downloading the 480B build because it looks more powerful is the fastest way to waste hours. It will not load on a normal machine, and you will have burned hundreds of gigabytes of disk for nothing. Stick to the 30B tag unless you have verified you have the memory.
4. Pull the model with one terminal command

This is the part where you're sitting at the terminal with the model page open, ready to actually fetch something. On the Ollama model page for Qwen3-coder, copy the tag exactly as it's written. Then type `ollama pull` followed by that tag and hit Enter – for the 30B build the command reads `ollama pull qwen3-coder:30b`.
The download takes a couple of minutes, depending on your connection. You're pulling the entire model onto your own machine, so it's a real file of around 19 GB, not a stream. Keep the terminal open and let it finish; interrupting halfway leaves you with a partial pull you'll have to redo.
When it's done, open Ollama and click the model selector. The model you just pulled won't show a download button any more, and that's your confirmation it's sitting locally and ready.
As a quick sanity check, type Hello in the Ollama chat window and see if it answers. If it does, the model is alive and you can move on to wiring it into Claude Code.
💡 Tip: If the pull seems stuck, check your internet connection and free disk space. The 30B model needs about 19 GB.
What the free setup really costs
Figures are for the qwen3-coder:30b build; the 480B build needs hundreds of GB and a supercomputer.
5. Claude Code still has to be installed

Because you're swapping the brain, not the tool. Claude Code handles file operations, tool calls and the whole coding environment – the model thinks, but Claude Code is what actually touches your project.
Search for download Claude and grab the installer from the official page. The alternative is to copy the install command from the Claude Code page, paste it into your terminal and press Enter. Either route works; pick whichever you find less fiddly.
The catch is the order. Install Claude Code before you try the launch step, because the launcher expects it to already be on the machine. Get that wrong and you'll spend ten minutes debugging a problem that's really just a missing app.
6. One launch command connects Claude Code locally

Now that the model is sitting on your disk, the last step is the one that makes it actually do something. In your terminal, run `ollama launch claude` with the config flag – that tells Ollama to look at what you have installed and let you pick from the list.
Choose qwen3-coder when it appears, and expect it to show up under two names, one of them the latest alias. The tool then asks whether you want to launch Claude Code now, so confirm, and it warns you that Claude Code can read, write and execute files in the current directory. Take that seriously and only open it in a folder holding trusted files.
Once you are inside, glance at the model name displayed, something like qwen3-coder:30b. That label is your proof a local model is answering, not a hosted one, and from here the session limits are someone else's problem. Running models on your own terms also means seeing when they wander, as Claude losing interest in a demo shows.
💡 Tip: If the launch command fails, double-check that Ollama is running in the background and that you typed the config flag correctly.
⚙️ The whole setup from start to finish
Install Ollama
No account or API key needed; it runs fully offline once set up.
Pick a model
GLM-4.7 is the fallback if Qwen3-coder won't fit; the OpenAI builds are listed but flagged as weak.
Match hardware
Order: free RAM/VRAM first, then disk. 30B needs ~18-20 GB memory and ~19 GB disk; 480B needs hundreds of GB and is out of reach. On 16 GB, pick a smaller quantised tag.
Pull the model
Copy the exact tag from its Ollama model page, paste after `ollama pull`. The latest alias pulls the same weights.
Install Claude Code
Use the official download page or the install command on the Claude Code page; skip any API-key or subscription step.
Connect them
It may offer the model under two names (one the latest alias) so either works. Confirm the launch, then dismiss the trusted-files warning only in a folder you trust – it can read, write and execute there.
Verify
Expect hosted-Claude speed to be gone: a 3 + 3 prompt answers correctly but can take a long while. Close other memory-hungry apps first, then check the model label reads `qwen3-coder:30b`.
7. No key, no subscription, no credit cap

Picture a flight, a train, or a locked-down office where the Wi-Fi is gone and you still need to get work done. That is exactly when this setup earns its keep, because the model and Claude Code are both running on your own machine with no Anthropic API key and no Claude subscription behind them.
The cap is gone too. There is no credit meter quietly draining as you work, and nothing to top up halfway through a task. Offline use is real, even though you will not always see it in a demo, since recording a demo itself needs the internet.
So what can you actually do? The same things you would normally do in Claude Code: build software, connect to APIs, query a database, or dig through a big stack of email lists. The catch is memory.
Close the extra apps before you start. The model is hungry for your computer's resources, and freeing up a couple of gigabytes of RAM makes a noticeable difference to how quickly it responds. Your browser tabs can wait.
What you gain vs. what you give up
You gain
- Zero cost: no API key, no subscription
- Unlimited use, no session caps
- Works completely offline
- Full control over your data
You give up
- Speed: responses can take a long time
- Capability: local models are less smart
- Hardware: needs 18–20 GB free RAM/VRAM
- Disk: about 19 GB for the 30B model
8. Local models are slower and less capable

Slow enough to notice. A test prompt of 'what is 3 + 3' came back correct, but it took a very long time to arrive – and part of that was screen recording stealing resources from the same machine.
The core truth underneath the test result is that local models are not instant the way hosted ones feel. You need a beefy machine to get decent speed, and plenty of people will have to settle for smaller, less intelligent models just to get an answer at all.
There is no great solution right now for running the very best models locally for free. The hardware gap is real, and no amount of configuration closes it.
For a lot of coding work, though, the 30B model is good enough. A typical case: ask it to write a small function that parses a CSV and it will get there, just on its own schedule.
You wait longer, and in return you never see a session limit again. If you are patient and your machine can carry the load, that trade is the whole point.
💡 Tip: Try smaller quantised versions if the 30B model is too slow. They use less memory and run faster, at the cost of some accuracy.
Check RAM, VRAM and disk first

Before you pull anything, check that your machine can actually hold it, because a 30B build wants roughly 18 to 20 GB of free unified memory or VRAM plus about 19 GB of disk. A 480B build is another world entirely: hundreds of gigabytes, and really a supercomputer job rather than something a standard PC handles.
If you are sitting on 16 GB of RAM, do not force the full 30B build. Look for a smaller quantised tag on the model page and pull that instead, because otherwise you will watch a download crawl and then run out of memory anyway.
Here is how to check, and it takes two minutes. On macOS, open System Settings > General > Storage for disk, and Activity Monitor > Memory for what is free. On Windows, Task Manager > Performance covers both. On Linux, run `free -h` for memory and `df -h` for disk.
Do this first and you skip the wasted evening: a giant download that fills your drive and still cannot load.
Local model jargon, decoded
Frequently Asked Questions
Do I need an Anthropic API key to use Claude Code with Ollama?
No. Once Claude Code is connected to your local Ollama model, it does not use an Anthropic API key or a Claude subscription. The local model handles all requests.
Will the 30B model run on a 16 GB MacBook?
It will be tight. The 30B build needs about 18–20 GB of free unified memory, so on a 16 GB machine you should look for a smaller quantised tag instead of the full 30B version.
How long does it take to download the model?
It depends on your internet speed, but typically a few minutes for the 30B model. The file is about 19 GB, so a fast connection helps.
Can I use Claude Code offline with this setup?
Yes. Once the model is downloaded and Claude Code is connected, you can work completely offline. No internet is needed for the model to respond.
What if the launch command does not work?
Make sure Ollama is running in the background. Check that you typed the command exactly: `ollama launch claude` with the config flag. Also ensure Claude Code is installed and up to date.
Pick your first pull based on your machine
If you have 24 GB or more of free unified memory or VRAM, start with qwen3-coder:30b. It is the best balance of capability and speed for a local setup. On a 16 GB machine, grab a smaller quantised tag instead of the full 30B build.
If the model stalls or Claude Code will not launch, the first troubleshooting step is to verify Ollama is running in the background. Then re-run `ollama launch claude` with the config flag and select your model again. Nine times out of ten, that fixes it.
You now have a path to unlimited, free Claude Code. The trade-off is speed and capability, but the freedom from session limits is real.
Ready to ditch the session limit?
Open your terminal and run `ollama pull qwen3-coder:30b` to start your first local setup today.