MoonClaude 🌙
Moon for Claude: Run Claude Code fully autonomously on external LLMs (e.g. Qwen, Gemini, MiniMax, OpenAI) through a LiteLLM proxy, while enjoying zero-downtime hot reloading and an Antigravity-grade persistent AI memory engine.
🌐 Visit the Official Landing Page for interactive setup guides and documentation.
🚀 Features
- Lean & Stable Routing: MoonClaude now uses a "Lazy Injection" strategy—it only registers the models you select. This prevents rate-limit spikes and "no deployments available" errors by keeping the LiteLLM router lean and stable.
- True Zero-Downtime Hot Reloading: Press
Alt+Mdirectly in the proxy terminal to instantaneously swap the active model. MoonClaude dynamically intercepts the routing under the hood—no proxy restarts, no lost context in the CLI, no downtime. - Antigravity-Grade Project Memory:
- Auto-discovers and enforces
MOONCLAUDE.mdglobal project instructions into Claude Code's system prompts. - Generates cross-session, highly structured summarization context representing your recent AI coding sessions, intelligently managing your AI's working context without maxing out open files.
- Easily browse transcripts natively with
moon history.
- Auto-discovers and enforces
📦 Installation & Setup
1. Prerequisites
If you haven't already, you need Node.js installed to run Anthropic's official Claude Code CLI.
# Install Claude Code globally via npm
npm install -g @anthropic-ai/claude-code
2. Install MoonClaude
MoonClaude is available directly on PyPI!
pip install moonclaude
3. Initialize Settings
Run the interactive setup wizard to map your API keys (OpenRouter, Gemini, Groq) and select your preferred chat models.
moon setup
🏃 Quick Start (Dual-Terminal Mode)
MoonClaude works best when you can see the API logs in real-time. We've automated this into a seamless Dual-Terminal workflow.
The Recommended Path: Simply run the following command in your project directory:
moon launch
What happens next?
- This terminal transforms into the MoonClaude Proxy log viewer. You'll see every API call, token count, and latency metric here. You can also press
Alt+Mhere to swap models instantly. - A new terminal window will automatically pop up and launch
claude(Claude Code) linked to the proxy.
You're now ready to code with full visibility!
🎛️ Core Commands
moon setup Interactive wizard for API keys and preferred models
moon launch Quick launch (starts proxy in background, then launches Claude)
moon chat Launch Claude connected to the proxy
moon start Start LiteLLM proxy in the foreground with live token monitoring
moon switch Fast CLI model switcher
moon history Interactive rich browser for your past conversation logs
moon memory Detailed control over the project memory context engine
moon status Display system health, active models, and paths
moon Show CLI help and commands
Compatibility: MoonClaude preserves the old
claude-ext ...legacy command aliases. Your legacy~/.claude-extconfig will automatically migrate to~/.moonclaude/at launch!
♻️ Zero-Downtime Hot Reloading
When you are deep in a Claude Code debug session, discovering your chosen model is failing can be frustrating.
Instead of dropping context:
- Keep the proxy running in the foreground (
moon start). - Press
Alt+M. - Select a new LLM from your interactive UI overlay.
- MoonClaude dynamically pre-warms its internal router injection without dropping the proxy connection. Your next prompt in the Claude Code terminal instantly bridges over to the new model!
🧠 Memory Engine
MoonClaude injects long-term memory into Claude Code.
MOONCLAUDE.md: Place this file in your project root. MoonClaude automatically reads it and appends it to your AI's persistent context across all sessions.- Context Compression: When you boot
moon chat, MoonClaude evaluates your last 20 sessions and constructs an elegant, compressed timeline of files you've modified, goals you've accomplished, and context you shouldn't forget. - Session Replay: Type
moon historyto explore Rich-formatted logs of all of your previous AI code iterations.
🛡️ Bypassing Claude Restrictions
Claude Code by default only supports Anthropic models and requires an active initial authentication to their servers. To use MoonClaude, you must authenticate once via the official CLI:
claude login
Follow the browser prompt to log into your Anthropic Developer account. Don't worry—MoonClaude will route the actual requests away from Anthropic to your selected free providers instead.
Routing Through MoonClaude
To ensure you don't hit Anthropic's paid API, never run claude directly. Always launch your environment with:
moon chat
# OR
moon launch
MoonClaude sets local HTTP proxy environmental variables (under the hood) to seamlessly override Anthropic's endpoints. Your prompts instantly hit Gemini, Llama, or Qwen instances safely and securely!
License
MIT
Metadata
Release files for moonclaude 2.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| moonclaude-2.1.4.tar.gz | 40.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moonclaude-2.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 83.0 kB
Release files / moonclaude-2.1.4.tar.gz
| Download URL | moonclaude-2.1.4.tar.gz |
|---|---|
| Size | 40.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2fa5273e6574d0166826ebd075e582f34f9e5aed8958474bd1a3003fd0fd549
|
|
BLAKE2b-256 checksum How to use checksums |
2c4c2783f0853fb452c1f32710e3545bdf3cdfc4377e2f31887cc7b152c6fe16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / moonclaude-2.1.4-py3-none-any.whl
| Download URL | moonclaude-2.1.4-py3-none-any.whl |
|---|---|
| Size | 42.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00187c3e6914e21b00843890948a74bf74af4eb2e8cdbbdc0d4c66f09d71715f
|
|
BLAKE2b-256 checksum How to use checksums |
c4bd64e63bd33f303375f16236646116bdddf9dcf4534cad3842bd4e65d57ec7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|