Skip to main content

Moon for Claude: run Claude Code on external LLMs via LiteLLM

Project description

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.


🚀 Features

  • Free OpenRouter Models: Interactively fetch and route your prompts through any of the 25+ completely free models on OpenRouter, or configure your own premium API keys (Gemini, Groq, OpenAI).
  • True Zero-Downtime Hot Reloading: Press Alt+M directly 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.md global 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.

📦 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

The easiest way to launch the proxy and jump straight into Claude Code is a single command. Open your project folder and run:

moon launch

(If you haven't run setup yet, it will guide you through it first!)

Manual Control: If you prefer running the Proxy and Claude independently, open two terminals:

  • Terminal 1: Run moon start (Starts the LiteLLM routing proxy)
  • Terminal 2: Run moon chat (Launches Claude Code seamlessly attached to the proxy)

🎛️ 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-ext config 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:

  1. Keep the proxy running in the foreground (moon start).
  2. Press Alt+M.
  3. Select a new LLM from your interactive UI overlay.
  4. 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.

  1. 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.
  2. 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.
  3. Session Replay: Type moon history to explore Rich-formatted logs of all of your previous AI code iterations.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moonclaude-2.1.0.tar.gz (38.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moonclaude-2.1.0-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file moonclaude-2.1.0.tar.gz.

File metadata

  • Download URL: moonclaude-2.1.0.tar.gz
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for moonclaude-2.1.0.tar.gz
Algorithm Hash digest
SHA256 09efe1b86696802b8e8b605d27f2aded4fcf67b0df200dde7ceac8a57264779c
MD5 98879c00ee77e402b77b4162556cdbda
BLAKE2b-256 126ff8bfe0b6b5cdee91ce2c4e519c9ccbded5214eb5ee4dc364f825e474200e

See more details on using hashes here.

File details

Details for the file moonclaude-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: moonclaude-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for moonclaude-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0225f67a5398b1d58ad6e2b310509d634960ee1b5b5188ece27a7dc41dc656f7
MD5 a5e7fbb18d266de9c072a1a3544a21b2
BLAKE2b-256 aada136daddb4e40f6355b23435c603475fb4757cf442a1083f777360d3abb87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page