I pay for Claude Code every month, and the Max plan costs $200. So I wondered: can a free model running on my own Mac do the same job? No subscription, no internet, nothing sent anywhere. I spent a whole day finding out, broke it three times along the way, and then put it head to head with the real Claude on six coding tasks.
Ollama is free and runs open-weights models locally. Pull a model once and Claude Code can talk to it instead of Anthropic. The catch on a Mac is memory: the graphics chip can only use about two thirds of your RAM. On 24 GB that is roughly 18 GB, and the context needs memory on top of the model, so the newest big models do not really fit. A model that does not fit spills onto the CPU and crawls.
| Your RAM | Model | Download | Tested? |
|---|---|---|---|
| 16 GB | ornith:9b | 5.6 GB | Ran on 24 GB, see results |
| 24-32 GB | gpt-oss:20b | 14 GB | Yes - best local result |
| 48 GB+ | qwen3.8:27b | 18 GB | Not tested |
Ollama even has an official command for this, ollama launch claude. I tried it on a
failing test suite and asked it to fix the bug. The answer had nothing to do with my task. Ollama
sizes the default context by your memory, and on my Mac that was 4,096 tokens -
while Claude Code sends about 10,000 tokens of instructions and tool definitions
before your task even starts. The model loses the plot, and the worst part: Claude Code still
reports the run as completed, no error. The fix is a copy of the model with a 64k context.
It does not know a local model, so it assumes it can remember 200,000 tokens and never compacts the conversation in time. You have to tell it the real window.
In auto mode every action gets an extra check by a classifier model. On a local model that is an extra slow call each time, and halfway through a task a billing notice popped up and blocked everything - even though nothing is billed at all.
I wrapped all three fixes into cc-local. It starts Ollama, picks a model for your
RAM, makes the 64k copy, tells Claude Code the real window, routes every model slot (main,
background, sub-agents) to the local model so nothing goes to Anthropic, and starts in
accept-edits mode. Your normal claude command stays untouched.
cc-local --doctor # checks your machine for every trap above
cc-local # Claude Code on the local model, in the current folder
The doctor check tests it end to end on your own Mac: context window, whether the model fits the GPU, speed in tokens per second, and a real Claude Code request that proves only the local model was used. On my M5 Pro, gpt-oss:20b ran at about 66 tokens per second, 100% on the GPU.
One task proves nothing, so I built a small benchmark: six tasks - four everyday ones (fix a bug, add a feature, build a CLI, build a Snake game) and two hard ones (a strict spec with lots of rules, and a bug from a vague user report). Every result is checked by hidden tests the model never sees, and every task runs three times, because local models can get lucky once.
| Task | Claude (cloud) | gpt-oss:20b | ornith:9b |
|---|---|---|---|
| Fix a bug | 3/3 · 9 s | 3/3 · 48 s | 3/3 · 52 s |
| Add a feature | 3/3 · 16 s | 3/3 · 115 s | 3/3 · 74 s |
| Build a CLI | 3/3 · 15 s | 3/3 · 45 s | 3/3 · 7.6 min |
| Build a Snake game | 3/3 · 21 s | 0/3 | 0/3 |
| Follow a strict spec | 3/3 · 24 s | 2/3 · 195 s | 0/3 |
| Bug from a user report | 3/3 · 13 s | 3/3 · 148 s | 2/3 · 60 s |
| Total | 18/18 · 5 min | 14/18 · 41 min | 11/18 · 93 min |
The way they fail is interesting. gpt-oss sometimes wrote the whole Snake game into the chat and never saved the file. The small ornith model often did the work and then kept going - over 100 steps - until Claude Code stopped with "prompt is too long".
For small, clear tasks, for private code that cannot leave your machine, or for working offline, a local model is honestly enough, and it costs nothing. When the task is vague, has lots of rules, or you need it right the first time, you pay for Claude. And time matters too: five minutes against forty-one.
Run Claude Code on your own machine with all three fixes, and test any model yourself before you trust it.
Patreon members ($5/month) get it with all my other tools, or buy just this one for $9.
cc-bench --runs 3 on your own machine before you trust a single result.The three traps on screen, the fix, and every result, including the Snake games.
Claude Code itself is free to install. With Ollama and an open-weights model it runs entirely on your own computer, with no subscription or API key - after fixing the context window and two other settings.
Not quite. In my 6-task benchmark Claude scored 18/18 in 5 minutes, gpt-oss:20b 14/18 in 41 minutes and ornith:9b 11/18 in 93 minutes. Simple, clear tasks were fine; vague and rule-heavy ones were not.
On a 24-32 GB Mac, gpt-oss:20b had the best local result. On 16 GB, ornith:9b fits. The model has to fit the GPU (about two thirds of a Mac's RAM), or it becomes very slow.
Usually the context window: Ollama's default on a 24 GB Mac was 4,096 tokens, while Claude Code sends about 10,000 tokens before your task. Give the model a 64k context.
Private code, offline work or a team that cannot send anything to the cloud: setting up local models and tooling that actually works is the kind of thing I do at KorFlux.