Claude Code Limit Hit? Keep Working with claude-code-local
When Claude Code hits its usage limit mid-task, claude-code-local lets you continue the same session on a local or free cloud model. Here is the guide.
Your usage limit runs out in the middle of a feature. The agent has already read every file, the plan is clear, and only two fixes and one test are left. Then a message appears: you have reached the usage limit, try again in a few hours.
This guide shows how to keep going in the same session, using claude-code-local. It can run the same Claude Code interface on a local model or a free cloud model until your limit resets.
In short
When your Claude Code usage limit runs out mid-task, you do not have to wait for hours. The free repo claude-code-local lets you type exit, then keep going, and continue the same conversation on a local model running on your computer or a free cloud model. It is not Claude, but for small tasks it is enough to keep you from getting stuck.
The problem: an hour before the deadline, and the screen stops
This always happens at the worst moment. You are in the middle of a feature, the agent has already read all the files, the plan is clear, and two fixes and one test are left. Then the message appears: you have reached the usage limit, try again in a few hours.
At that point you have three options. You can wait. You can upgrade to a more expensive plan. Or you can open another tool and explain everything from the beginning, because all the context stayed in the session that stopped.
claude-code-local was built for this moment. It does not replace Claude. It gives you a spare wheel: the same conversation, the same folder, the same Claude Code interface, with a different engine under the hood until your limit resets.
What is claude-code-local?
claude-code-local is an open source project under the MIT license, in the repo nicedreamzapp/claude-code-local on GitHub. As of November 16, 2026, it has about 3,500 stars and 650 forks.
It does two things:
- It runs Claude Code against a model on your computer. On Mac with Apple Silicon, it uses MLX. On Linux and Windows, it uses llama.cpp. No API key is required.
- It adds a command called keep going. This command finds your last conversation in the project folder and continues it on a free cloud model or a local model.
Important: the install does not change the regular claude command. It keeps working with your subscription as usual.
Who is this for?
- People who hit the usage limit in the middle of work and want to finish a small task
- People who work on sensitive code and want it to stay on their computer
- People who want to try local models without learning a new tool
- People who work offline, on a plane, or on a train
This is less suitable for people who expect Claude-level quality on a large refactor or architecture planning. More on that below.
What do you need before you start?
- Mac: Apple Silicon, meaning M1 or newer. The install adds Python 3.12 and Claude Code if they are missing.
- Linux or Windows: git, Python 3, and Claude Code
- Free disk space for the model, from a few gigabytes to tens of gigabytes depending on the model size
How do you install it?
On Mac or Linux, run one command:
curl -fsSL https://raw.githubusercontent.com/nicedreamzapp/claude-code-local/main/install.sh | bash
If you prefer to read the script before you run it, which is a good habit, clone the repo and run the setup script:
git clone https://github.com/nicedreamzapp/claude-code-local
cd claude-code-local
bash setup.sh
On Windows, in PowerShell:
irm https://raw.githubusercontent.com/nicedreamzapp/claude-code-local/main/install.ps1 | iex
To start it after installing:
- Mac: double-click Claude Local on your desktop
- Linux: run the command claude-local
- Windows: double-click Claude Local on your desktop
How does the keep going command work?
- Your usage limit runs out. Inside Claude Code, type exit.
- In your terminal, type keep going.
- A short menu opens with free cloud models and local models.
- Choose a model. The conversation continues from the same point.
If you installed manually, you need to add the hook once. On Mac, run:
echo 'source "$HOME/claude-code-local/scripts/keepgoing-shell.sh"' >> ~/.zshrc
On Linux, use the same line but write it to ~/.bashrc. On Windows, the installer adds keep going for you, and it works in both PowerShell and cmd.
There is also an automatic handoff when your limit runs out. A hook opens a new window in the same folder and continues the conversation without you typing anything. The setup is described in docs/AUTO-HANDOFF.md in the repo, and you need to add it yourself to your Claude Code settings file.
Which model will you get for your computer?
On Mac, the installer picks a model based on memory:
| Memory | Model |
|---|---|
| 8 GB | Qwen 3.5 2B |
| 16 GB | Qwen 3.5 4B |
| 32 to 63 GB | Gemma 4 12B |
| 64 to 95 GB | Gemma 4 31B |
| 96 GB and up | Qwen 3.8 27B |
On Linux and Windows:
| Hardware | Model |
|---|---|
| NVIDIA card with 24 GB | Qwen 3.5 9B |
| NVIDIA card with 12 GB | Qwen 3.5 4B |
| AMD card or Vulkan | The largest model that fits in the card's memory |
| CPU only | A 4B or 9B model, depending on memory |
On Linux and Windows, you can also pick a model yourself. Install it once, then run it as usual with claude-local:
CCL_MODEL_ID=gemma-4-12b python3 ~/claude-code-local/portable/ccl.py install
The list of available models is in portable/catalog.json in the repo.
For speed, these numbers come from the project developers themselves, not an independent source, on a Mac M4 Pro. Qwen 3.5 4B, the model for 16 GB machines, runs at about 22 tokens per second. Qwen 3.5 2B, the model for 8 GB machines, runs at about 92 tokens per second. On a weaker computer, it will be slower.
How do you connect free cloud models?
If your computer is weak, the keep going menu also offers free cloud models through OpenRouter. You need a free OpenRouter key and one line in the settings file:
- Mac and Linux: ~/.config/claude-code-local/keepgoing.env
- Windows: %USERPROFILE%\.config\claude-code-local\keepgoing.env
OPENROUTER_API_KEY=your-free-key
Two things to know. Free cloud models can be busy at certain hours. And in this mode, your conversation is sent to OpenRouter, so it is not a good fit for sensitive code.
What about privacy?
In local mode, according to the project documentation, the code stays on your computer. The only connection from Claude processes is to localhost:4000. You can check this yourself while a session is running:
lsof -a -i -p "$(pgrep -d, -f claude)"
The project's launch files also turn off Claude Code's background traffic using documented environment variables, such as CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC and DISABLE_AUTOUPDATER.
A simple rule of thumb:
- Client or work code: only a local model, or Claude itself
- Personal project or open source code: a free cloud model is also an option
These statements come from the project's documentation, not from an independent security audit.
What are the limits?
- A local model is weaker than Claude. The developers themselves write that on machines with 8 or 16 GB, it is best to ask for one clear step at a time.
- Free cloud models are not always available.
- Some extras, such as controlling it from an iPhone and automatic handoff for background agents, only work on Mac.
- If Claude Code asks you to log in, your version is too old and needs to be updated.
In practice, this fits a small fix, writing a test, explaining code, or finishing a task you already started. For a large refactor, it is better to wait for your limit to reset.
Do you have a Gemini account? Here is how to connect it directly to Claude Code
Claude Code sends its requests to the address set in the ANTHROPIC_BASE_URL variable. If you point it to a middleman layer that translates requests to another provider, the same interface works with a different model. Anthropic documents this pattern in the Claude Code LLM gateway guide.
The most documented option is LiteLLM. Here is a basic config file, config.yaml:
model_list:
- model_name: gemini-3.8-flash
litellm_params:
model: gemini/gemini-3.8-flash
api_key: os.environ/GEMINI_API_KEY
Start the proxy. In the LiteLLM documentation, it runs on port 4000. That is the same port claude-code-local uses, so if both are installed on your machine, choose a different port:
export GEMINI_API_KEY=your-key
export LITELLM_MASTER_KEY=sk-a-long-random-key
litellm --config config.yaml --port 4001
In another terminal, start Claude Code against it:
export ANTHROPIC_BASE_URL=http://localhost:4001
export ANTHROPIC_AUTH_TOKEN=sk-a-long-random-key
export ANTHROPIC_MODEL=gemini-3.8-flash
claude
Safety note: compromised versions of LiteLLM were reported in the past, and the claude-code-local project itself removed it because of supply chain concerns. Install only an up-to-date version from the official source. A popular alternative is claude-code-router, which routes Claude Code requests between different providers and models.
DeepSeek does not need a proxy at all, because it has an endpoint in Anthropic's format. According to DeepSeek's official documentation:
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=your-deepseek-key
export ANTHROPIC_MODEL=deepseek-flash
claude
Which alternative model should you choose? A comparison with Sonnet 5.5
If you want a permanent backup and not just an emergency fix, you can connect a cheap paid model. The table is sorted from strongest to weakest. Prices are in US dollars per million tokens, input and output, as of November 2026. Most scores were reported by the vendors themselves, so treat them as a direction, not an exact measurement.
| Model | Terminal-Bench 4.0 | DeepSWE 1.1 | Input and output price | Best for |
|---|---|---|---|---|
| Claude Sonnet 5.5 | 70.6 | 71.0 | $2 and $10 | Serious work, the reference point |
| Kimi K3.1 Pro | 65.7 | 75.5 | $2 and $10 | A quality backup when your limit runs out |
| Gemini 3.8 Flash | No data | 73.7 | $0.75 and $3.75, launch price through end of 2026 | Those already in the Google ecosystem |
| DeepSeek V4.1 Flash | 42.3 | 77.0 | $0.15 and $0.60, double during peak hours | Simple tasks on a budget |
| GLM 5.3 | 37.9 to 41.8 | 66.9 | $1.40 and $4.40, or a subscription from $18 per month | A fixed monthly price |
| Gemma 4 local | No data | No data | Free | Sensitive code and small tasks |
GLM 5.3 has two different scores on Terminal-Bench 4.0, because DeepSeek and Moonshot published different runs of the same test.
Three takeaways from the table:
- Terminal-Bench is the closest test to real work in a terminal. There, only Kimi comes close to Sonnet. In the independent testing by Artificial Analysis, the only source that ran both under the same conditions, Kimi K3.1 Pro even came out slightly ahead of Sonnet 5.5, with 67 percent versus 64 percent.
- Price per token is not price per task. Gemini 3.8 Flash is cheap per token, but in Artificial Analysis measurements, it uses many tokens and ends up expensive per task.
- Kimi, DeepSeek, and GLM are Chinese providers. For work code or client code, a local model or Claude is the better choice.
My recommended split
- Claude: serious work
- Kimi K3.1 Pro: a quality backup when your limit runs out in the middle of something important
- DeepSeek V4.1 Flash: simple tasks on a budget
- claude-code-local with a local model: sensitive code, offline work, and small tasks
5 tasks to try first
- Ask for an explanation of one file in the project
- Write one test for an existing function
- Fix a small bug you already found
- Rename a variable across several files
- Write a short README for the project
Start with one clear task. A small local model gets confused when you give it five tasks at once.
Sources
- claude-code-local on GitHub (https://github.com/nicedreamzapp/claude-code-local)
- Claude Code LLM gateway guide (https://code.claude.com/docs/en/llm-gateway)
- LiteLLM: Claude Code with non-Anthropic models (https://docs.litellm.ai/docs/tutorials/claude_non_anthropic_models)
- DeepSeek: connecting to Claude Code (https://api-docs.deepseek.com/quick_start/agent_integrations/claude_code)
- Google: What's new in Gemini 3.8 Flash (https://aistudio.google.com/docs/whats-new-gemini-3.8)
- Artificial Analysis: model comparison and cost per task (https://artificialanalysis.ai/models/releases)
- Morph: DeepSeek V4.1 Flash (https://www.morphllm.com/deepseek-v4-1-flash)
- Morph: Kimi K3.1 Pro vs. Claude (https://www.morphllm.com/kimi-k3-1-vs-claude)
- SayGM: GLM 5.3 pricing (https://saygm.com/blog/glm-pricing)
Questions people ask
What is claude-code-local?
It is a free, open source project under the MIT license that runs Claude Code against a model on your own computer. On Mac with Apple Silicon it uses MLX, and on Linux and Windows it uses llama.cpp, with no API key required. It also adds a keep going command that continues your last session on a local model or a free cloud model.
How do I continue a Claude Code session after the usage limit runs out?
After you install claude-code-local, type exit inside Claude Code, then type keep going in your terminal. A short menu opens with free cloud models and local models, and you pick one. The conversation continues from the same point in the same folder.
Does claude-code-local change the regular claude command?
No. According to the project documentation, the install does not touch the claude command, and it keeps working with your regular subscription. When your usage limit resets, you can go back to it.
Does my code stay on my computer?
In local mode, according to the project documentation, yes. The only connection from Claude processes is to localhost:4000, and you can check this with lsof while a session runs. If you choose a free cloud model through keep going, the conversation is sent to OpenRouter, and this is a claim from the project, not an independent security audit.
Which local model fits my computer?
On Mac, the installer picks the model for you based on memory. On Linux and Windows, it picks based on your graphics card. The full table is in the guide below.
