# Repository Briefing: nicedreamzapp/claude-code-local
> Source: https://repoforai.com/repo/nicedreamzapp/claude-code-local (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/nicedreamzapp/claude-code-local
- **Official Docs / Website**: https://nicedreamzapp.github.io/claude-code-local/
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (97/100 · Maintenance 35/35 · Adoption 22/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v1.0.0 (2026-11-03) — https://github.com/nicedreamzapp/claude-code-local/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: Self-Hosted, Local AI, CLI, GPU, API
- **Momentum**: 3,575 ★ total (+5 24h / +37 7d) · 651 forks
- **Topics**: `ai-privacy`, `anthropic`, `apple-silicon`, `claude-code`, `local-ai`, `local-llm`, `macos`, `mlx`, `offline-ai`, `on-device-ai`, `private-ai`, `qwen`
- **When to Use**: Best for: Claude Code users who want a self-hosted fallback for scoped edits, local commands, and conversation continuity after hosted usage limits. Skip if: You need hosted Claude’s model behavior, consistent results on long multi-step changes, or an authenticated shared inference endpoint out of the box.

## Overview
```text
### Architecture & Core Mechanics
Claude Code remains the client and tool runner. On Apple Silicon, a launcher points `ANTHROPIC_BASE_URL` at the Python MLX service in `proxy/server.py`, which serves the Anthropic Messages API with streaming. The server translates Gemma, Qwen, and Llama-style tool output and repairs malformed tool JSON. Unlike an OpenAI-compatible server paired with a separate Anthropic adapter, this path handles protocol compatibility at the inference endpoint.

The MLX service reuses the prompt cache across turns. Separately, `agent/agent.py` provides a standalone terminal coding agent with a short, fixed system prompt designed to preserve cache reuse. Session handoff sits in the launcher layer: `bin/keepgoing` and `bin/keepgoing.py` locate the last Claude Code conversation for the current folder; Linux and Windows use `portable/ccl.py keepgoing` with llama.cpp. The core integration is at the model API, not through an MCP server.

### Key Capabilities & Differentiators
`keep going` is the main workflow: exit hosted Claude Code and resume the conversation with a local model while retaining the client’s file editing and command tools. OpenRouter is an optional keyed cloud route, not part of offline inference. The macOS setup selects among Qwen 3.5 2B/4B, Gemma 4 12B/31B, and Qwen 3.8 27B by memory tier. Qwen 4 is not part of the available lineup.

The 8 GB and 16 GB Mac profiles both use 16K context and support image input. On an M4 Pro, the 2B and 4B profiles recorded about 92 and 22 tokens/s, with server memory peaks of 4.2 GB and 10.6 GB, respectively. Both passed a scoped Claude Code check covering file reads, edits, script execution, and image description. The 27B Agent-12 result (12/12 easy, 7/8 hard) came from that benchmark’s own harness, not from Claude Code.

### Trade-offs & Limitations
This is a practical fallback for teams that want to keep the Claude Code interface after hitting hosted usage limits. The handoff preserves the conversation, not the model’s behavior: a 2B or 4B local model is better suited to one clear step at a time than a long, loosely specified refactor. The M4 Pro token rates measure generation under specific configurations; they do not establish end-to-end edit latency or cross-platform performance.

Compared with assembling a generic local server and protocol translator, the MLX route reduces integration work for this client but makes model-specific tool parsing part of the stack you depend on. Local execution shifts cost toward hardware, memory, and maintenance. Keep the endpoint on loopback: `sk-local` is not checked. Treat OpenRouter and logged-in browser or remote-access add-ons as separate trust decisions, and review their data paths and terms independently.

### Hardware & Deployment Guide
On an M1-or-newer Mac, `setup.sh` provisions Python 3.12, selects and downloads a model, and creates `Claude Local.command`. A manual MLX setup uses a Python 3.12 virtual environment with `mlx-lm` and starts the service via `scripts/start-mlx-server.sh`; the local API example uses `localhost:4000`. Linux uses `install.sh` and Windows uses `install.ps1` to select a pinned llama.cpp build and a model for the available hardware.

Plan for initial downloads of dependencies and model weights; afterward, the local inference path needs no Anthropic key or subscription. `scripts/doctor.sh` checks core components on macOS and Linux. Operationally, v0.6.0 introduced the add-on bundle, v0.7.0 added automatic model selection for 8 GB and 16 GB Macs, and v1.0.0 foregrounded the exit-and-resume workflow. Start with the core install and add browser, voice, or remote-access components only if needed.
```

## Key Capabilities
```text
- Protocol: `proxy/server.py` streams Anthropic Messages responses directly from the MLX service.
- Tool compatibility: Normalizes Gemma, Qwen, and Llama-style tool calls and repairs malformed tool JSON.
- Session handoff: `keep going` finds the last Claude Code conversation for the current folder; plain `claude` retains the hosted path.
- Runtime selection: MLX on Apple Silicon; pinned llama.cpp builds on Linux and Windows, selected for NVIDIA, AMD, or CPU execution.
- Small-Mac sizing: 8 GB and 16 GB profiles use 16K context, with measured server peaks of 4.2 GB and 10.6 GB, respectively.
- Verification: Parser tests run without model weights; the running-server tests exercise multi-step tool calls.
```

## Quick Start / Clone
```bash
curl -fsSL https://raw.githubusercontent.com/nicedreamzapp/claude-code-local/main/install.sh | bash
```
