Claude Code Local is an MIT-licensed local AI backend for running Claude Code with open-weight models on an Apple Silicon Mac. You keep the familiar Claude Code workflow for reading files, editing code, running commands, and using MCP servers while an MLX-native server handles model inference on your Mac.
The server speaks the Anthropic API directly. Claude Code sends requests to localhost:4000, and the server translates model-specific tool calls into the format Claude Code expects. This single-process design removes the extra translation proxy found in many local setups and reduces prompt-processing overhead.
Your Mac’s unified memory sets the practical model range. A 16 GB Mac can start with Hermes 4 14B, while Macs with more memory can run Gemma, Qwen, Llama, Muse-Glimmer, or DeepSeek routes.
Claude Code Local also includes an optional native agent for faster long sessions. It loads the same MLX models in process, uses a compact stable prompt, and preserves reusable prompt-cache state across turns.
Features
- Runs open-weight models through an MLX-native server that implements the Anthropic Messages API.
- Preserves Claude Code file, shell, search, edit, permission, project-instruction, and MCP workflows.
- Translates Gemma, Llama, Qwen, and related tool-call formats into Anthropic
tool_useblocks. - Repairs malformed tool calls and retries detected tool intent up to two times.
- Reuses the shared prompt prefix across turns and trims each cache to the correct conversation boundary.
- Provides an optional native MLX agent with Bash, Read, Write, Edit, Glob, and Grep operations.
- Publishes the Agent-12 benchmark with open tasks, judges, and a reproducible runner.
- Includes launchers for Claude Code, the native agent, browser control, hands-free voice, and phone access.
- Supports models from about 8 GB to 81 GB, with setup choices for 16 GB through 128 GB Macs.
Use Cases
- Continue routine Claude Code work after reaching a hosted usage limit.
- Inspect private source code and legal or internal documents through local model inference.
- Trace a failing test, edit the affected files, and run the test command from a terminal agent.
- Use a 16 GB Mac for code explanations, contained fixes, scripts, and focused tool-driven tasks.
- Run larger local coding models on a high-memory Mac for repository searches and longer agent sessions.
How to Use Claude Code Local
Install the Local Backend
Claude Code Local requires an Apple Silicon Mac, Python 3.12 or later, enough storage for the selected model, and a current Claude Code binary. Install Claude Code first, then run the repository installer:
curl -fsSL https://claude.ai/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/nicedreamzapp/claude-code-local/main/install.sh | bashThe installer detects unified memory, selects a starter model, installs the MLX environment, downloads the weights, and creates Claude Local.command on the Desktop. Model downloads range from about 8 GB for Hermes 4 14B to about 81 GB for the two-bit DeepSeek V4 Flash route.
You can inspect the repository before running its setup script:
git clone https://github.com/nicedreamzapp/claude-code-local
cd claude-code-local
bash setup.shStart a Claude Code Session
Open Claude Local.command. The launcher starts the local server, points Claude Code at http://localhost:4000, and supplies the local authentication values. Enter a focused coding task from the project directory and review each requested file or command permission.
Choose a Model for Your Mac
Start with the automatic selection, then use the published benchmark results to test a stronger route that fits your memory. Keep enough free unified memory for macOS, Claude Code, the KV cache, and active project operations.
| Unified Memory | Practical Starting Route | Model Footprint or Role |
|---|---|---|
| 16 GB | Hermes 4 14B | About 8 GB; focused coding and tool use |
| 32 to 48 GB | Gemma 4 12B | Smaller daily coding route |
| 64 to 95 GB | Gemma 4 31B or Qwen3.6-35B-A3B | Longer sessions and stronger agent tasks |
| 96 GB or more | Qwen 3.8 27B bf16, Qwen 3.5 122B, or Llama 3.3 70B | Large dense or MoE models |
| 128 GB or more | DeepSeek V4 Flash | About 81 GB at two-bit; long-context route |
Run the Native Agent
The native agent loads an MLX model in the same process as the agent loop. Its compact fixed prompt keeps the reusable prefix stable during long conversations. Launch a supplied Native Engine command file or run:
AGENT_MODEL=lmstudio-community/Qwen3-Coder-30B-A3B-Instruct-MLX-8bit \
AGENT_DIALECT=native \
python3 agent/agent.pyUse AGENT_DIALECT=native for a model with a reliable native tool-call template. Set AGENT_DIALECT=prompted when the model needs the XML tool format defined in the system prompt. The native route provides its own terminal interface and does not load the Claude Code harness.
Agent-12 Model Benchmarks
Agent-12 evaluates completed filesystem work in a fresh sandbox for every task. It uses fixed token caps, temperature zero, and judges checked against known good and bad solutions. The score comes from the required files and behavior.
| Model | Task Results | Hard-Suite Time |
|---|---|---|
| Qwen3.6-35B-A3B, MLX 8-bit | 12/12 easy; 8/8 hard | 125 seconds |
| Qwen3-Coder-30B-A3B, MLX 8-bit | 12/12 easy; 7/8 hard | 392 seconds |
| Gemma 4 31B, MLX 4-bit | 11/12 easy; 8/8 hard | 348 seconds |
| DeepSeek V4 Flash, two-bit ds4 | 12/12 easy; 8/8 hard | 551 seconds |
Claude Code Route vs Native Engine
Both routes run local MLX models and provide file and shell operations. The Claude Code route keeps Claude Code commands, permissions, project instructions, and MCP compatibility. The native engine focuses on a smaller stable prompt and direct cache control for lower local latency.
| Area | Claude Code Route | Native Engine |
|---|---|---|
| Interface | Claude Code terminal agent | Repository’s own terminal agent |
| Prompt | Claude Code harness with local reductions | About 550 stable system tokens |
| Integrations | Claude Code permissions, commands, and MCP servers | Bash, Read, Write, Edit, Glob, and Grep |
| Long-session latency | Depends on harness and cache reuse | 0.36-second first token in the published 4.5K-context Gemma test |
| Best fit | Existing Claude Code projects and integrations | Fast local coding sessions with the included operations |
Alternatives and Related Resources
- Use Claude Code with Any Free & Local Models – Free Claude Code Proxy
- SmallCode: Fast, Free, Local AI Coding Agent for Small LLMs
- OpenClaude: Open-Source Coding Agent for Cloud and Local Models
- Claude Code Commands Cheat Sheet (2026)
- Codebase Memory MCP Server: Persistent Code Graph for AI Agents
- The Ultimate Claude Code Resource List 2026: Agents, Skills, Plugins & More
- 10 Best CLI AI Coding Agents in 2026: Open-Source & Commercial
Pros
- Licensed under the MIT.
- Local model inference has no per-token API charge.
- Agent-12 supplies reproducible task results for model selection.
- The 16 GB Hermes route supports focused coding tasks on a base MacBook.
Cons
- Requires an Apple Silicon Mac.
- Model weights consume about 8 GB to 81 GB of storage.
- Local-model accuracy varies by model, cache precision, prompt length, and task complexity.
FAQs
Q: Does Claude Code Local support Intel Macs, Windows, or Linux?
A: The included MLX server and launchers target Apple Silicon Macs. The repository does not provide an equivalent Intel, Windows, or Linux inference path.
Q: Why does the launcher show a Claude sign-in prompt?
A: The local launchers rely on current Claude Code support for the bare local route. Upgrade Claude Code with npm install -g @anthropic-ai/claude-code@latest, then reopen the launcher.
Q: What does an ablated model change?
A: Abliteration suppresses a model’s learned refusal direction. It does not increase general reasoning ability, and each upstream model license continues to apply.
Q: How can I reproduce the published results?
A: The Agent-12 tasks, judges, runner, and judge-validation checks are available in the public Agent-12 repository. The native-agent cache test runs through python3 bench/agent_bench.py.
Changelog
- August 23, 2026: Current checkouts correct cross-session prompt-cache state, use Hermes 4 14B as the 16 GB starting route, and include the native agent path.










