Problem → fix pairs. Run ./verify.sh first; it catches most issues.
Run it with full output and read the first failed check.
./verify.shCommon follow-ups:
node scripts/redact-check.mjs— secrets checknode scripts/doctor-local.mjs— repo file integritynode ~/.claude/openrouter-claude-proxy/doctor.mjs— runtime state on this Mac
curl -fsSL https://claude.ai/install.sh | bash
type -a claude && claude --versionThen re-run ./install.sh --dry-run.
brew install node
node --versionNeed >= 20.
The claude zsh function is in ~/.zshrc — open a new terminal, or:
source ~/.zshrc
type claude # should print: claude is a shell functionIf ~/.local/bin isn't in PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrccode --install-extension anthropic.claude-code
node ~/.claude/openrouter-claude-proxy/patch-extension.mjs --dry-run
node ~/.claude/openrouter-claude-proxy/patch-extension.mjsThe LaunchAgent re-patches every 60 s, so a manual run is rarely needed.
Install Claude Code first (above). The installer will not proceed without it.
--fresh requires ~/.claude to be empty. If you've used Claude Desktop or Claude Code before, use --merge instead.
launchctl kickstart -k gui/$(id -u)/com.codex.openrouter-claude-proxy
sleep 2
curl -sS http://127.0.0.1:4141/healthLogs:
tail -100 ~/.claude/logs/openrouter-claude-proxy.log
tail -100 ~/.claude/logs/openrouter-claude-proxy.err.logVerify token is in settings:
node -e 'console.log(JSON.parse(require("fs").readFileSync(`${process.env.HOME}/.claude/settings.json`,"utf8")).env.ANTHROPIC_AUTH_TOKEN ? "present" : "MISSING")'If missing, re-run ./install.sh --merge and re-enter the key.
Claude CLI 2.1.131+ ignores ~/.claude/settings.json's env block. The claude-env.mjs wrapper handles this. Make sure you're using the wrapper:
type claude # should be a shell function calling claude-fullIf not, your shell didn't reload .zshrc. Open a new terminal.
claude-router status
node ~/.claude/openrouter-claude-proxy/doctor.mjs # look for drift blockFix:
claude-router apply-settings --dry-run
claude-router apply-settingsclaude-router remove <stale-alias> --replace-with <good-alias>
claude-router apply-settingsRead the preflight section of the JSON output. Common blockers:
- Disk free below threshold
- Network preflight to
downloads.claude.aifailed - Zero-byte file from prior failed update — quarantined automatically
After fixing, re-run claude-safe-update latest --dry-run.
ls -la ~/.local/bin/claude # check symlink target
ls ~/.claude/binary-snapshots/ # snapshots from previous runsTo roll back manually:
ln -sfn ~/.claude/binary-snapshots/claude-<version>-<hash> ~/.local/bin/claudeplutil -convert json -o - ~/Library/LaunchAgents/com.codex.openrouter-claude-proxy.plist | grep -i autoupdaterShould show DISABLE_AUTOUPDATER: "1". If not, re-run ./install.sh --upgrade.
claude-router tailCheck cache_read column. If always 0:
- Verify
OPENROUTER_PROXY_PROMPT_CACHE=autoin plist:plutil -convert json -o - ~/Library/LaunchAgents/com.codex.openrouter-claude-proxy.plist - Verify provider pinning is on (
OPENROUTER_PROXY_PIN_PROVIDER=1). - Verify the model has
cacheBehavior: "cache-read-observed"in registry. - Ensure same-session turns within Anthropic's 5-min cache TTL.
Provider may have rotated. Confirm pinning:
node ~/.claude/openrouter-claude-proxy/doctor.mjs | jq '.cacheReadiness'Default categories are conservative (e.g., backups must be 30 days old). Override:
claude-router cleanup old-backups --older-than 0d # dry-run
claude-router cleanup all-safe --older-than 0d --apply # applyThe cleanup tool keeps the most recent backup per source file as a rollback safety net. If you deleted older ones, restore from ~/.claude/installer-backups/<stamp>/.
If state gets too tangled:
./uninstall.sh --restore-last-backup # rolls back to pre-install stateThen a clean install:
./install.sh --dry-run
./install.sh --mergeClaude Code itself, Claude Desktop, caveman, your projects: all untouched by uninstall.
When opening a GitHub issue, include:
# Sanitized state snapshot — paste output of all of these
sw_vers
node --version
claude --version
node ~/.claude/openrouter-claude-proxy/doctor.mjs
./verify.shDo not paste your API key. Doctor output is privacy-safe by design.