whatisgithub

What is claude-failover?

nicedreamzapp/claude-failover — explained in plain English

Analysis updated 2026-05-18

1ShellAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A backup routing layer that switches your Claude Code scripts to a local AI model automatically when you hit a usage cap or Anthropic is down.

Mindmap

mindmap
  root((claude-failover))
    What it does
      Routes around Claude outages
      Switches to local model
      Flag file controls mode
    Tech stack
      Python
      mlx-lm
    Use cases
      Keep cron jobs running
      Handle usage caps
      Survive outages
    Audience
      Developers
      Automation users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Keep automated cron jobs running when you hit your Claude usage cap.

USE CASE 2

Fail over to a local model during an Anthropic service outage.

USE CASE 3

Flip back to Claude automatically once the outage or cap resets.

What is it built with?

Pythonmlx-lmClaude Code CLI

How does it compare?

nicedreamzapp/claude-failoveranthonyhann/knowledge-wikibaiyuetribe/test-heroku
Stars111
LanguageShellShellShell
Last pushed2021-06-30
MaintenanceDormant
Setup difficultymoderatemoderatehard
Complexity3/53/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an Apple Silicon Mac, Python 3.9+, the Claude Code CLI, and the mlx-lm package.

So what is it?

claude-failover is a backup routing layer for the Claude Code CLI. When you hit your monthly usage cap or Anthropic's service is temporarily down, you flip a single command and all your scripts that call Claude automatically switch to a local AI model running on your own machine, no code changes required. When Claude is available again, one more command flips everything back. The way it works is through a lightweight shim called agent-llm that you drop into your PATH. Instead of calling the Claude CLI directly in your scripts, you call agent-llm. Every time it runs, it reads a flag file on your computer to decide where to send the request: if the flag says "claude," it passes the call straight to the real Claude CLI as if nothing changed, if it says "local," it sends the request to a locally running AI server instead. You switch modes with llm-failover local or llm-failover claude. The local model is lazy-loaded, meaning it only occupies memory when you are actually in failover mode. Flipping to local mode starts the server and loads the model (which can take 30 to 90 seconds the first time depending on your machine). Flipping back unloads it and frees the RAM. If you want instant failover without the warm-up delay, you can configure the server to stay loaded continuously. You would use this if you run automated scripts or cron jobs that depend on the Claude CLI and you cannot afford those jobs to stop when you hit a usage limit or during an outage. It requires an Apple Silicon Mac, Python 3.9 or later, the Claude Code CLI, and the mlx-lm package. The full README is longer than what was provided.

Copy-paste prompts

Prompt 1
Explain how to set up agent-llm as a drop-in replacement for the Claude CLI in my scripts.
Prompt 2
Run llm-failover local and tell me what happens to my running scripts.
Prompt 3
Configure claude-failover's local server to stay loaded so failover is instant.

Frequently asked questions

What is claude-failover?

A backup routing layer that switches your Claude Code scripts to a local AI model automatically when you hit a usage cap or Anthropic is down.

What language is claude-failover written in?

Mainly Shell. The stack also includes Python, mlx-lm, Claude Code CLI.

How hard is claude-failover to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is claude-failover for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.