loading…
Search for a command to run...
loading…
Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models
Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models
npm version license Claude Code
Use your existing AI subscriptions with Claude Code. Works with Anthropic Max, Gemini Advanced, ChatGPT Plus/Codex, Kimi, GLM, OllamaCloud — plus 580+ models via OpenRouter and local models for complete privacy.
Claudish (Claude-ish) is a CLI tool that allows you to run Claude Code with any AI model by proxying requests through a local Anthropic API-compatible server.
Supported Providers:
Stop paying for multiple AI subscriptions. Claudish lets you use subscriptions you already have with Claude Code's powerful interface:
| Your Subscription | Command |
|---|---|
| Anthropic Max | Native support (just use claude) |
| Gemini Advanced | claudish --model g@gemini-3-pro-preview |
| ChatGPT Plus/Codex | claudish --model [email protected] or [email protected] |
| Kimi | claudish --model [email protected] |
| GLM | claudish --model [email protected] |
| MiniMax | claudish --model [email protected] |
| OllamaCloud | claudish --model oc@qwen3-next |
| OpenCode Zen Go | claudish --model zgo@glm-5 |
100% Offline Option — Your code never leaves your machine:
claudish --model ollama@qwen3-coder:latest "your task"
Claudish is a BYOK AI coding assistant:
provider@model[:concurrency] for explicit routing (e.g., [email protected])gpt-4o, gemini-2.0-flash, llama-3.1-70b route to their native APIs automaticallyollama@, lmstudio@ syntax and concurrency controlnpx or bunx - no installation required.claude settings--agent, --effort, --permission-mode, etc.) in any order# Shell script (Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/MadAppGang/claudish/main/install.sh | bash
# Homebrew (macOS)
brew tap MadAppGang/tap && brew install claudish
# npm
npm install -g claudish
# Bun
bun install -g claudish
oc/ prefix)Use without installing:
npx claudish@latest --model x-ai/grok-code-fast-1 "your prompt"
bunx claudish@latest --model x-ai/grok-code-fast-1 "your prompt"
Install from source:
git clone https://github.com/MadAppGang/claudish.git
cd claudish
bun install && bun run build && bun link
# Navigate to your project directory
cd /path/to/your/project
# Install Claudish skill for automatic best practices
claudish --init
# Reload Claude Code to discover the skill
What this does:
.claude/skills/claudish-usage/After running --init, Claude will automatically:
# Just run it - will prompt for API key and model
claudish
# Enter your OpenRouter API key when prompted
# Select a model from the list
# Start coding!
# Set up environment
export OPENROUTER_API_KEY=sk-or-v1-... # For OpenRouter models
export GEMINI_API_KEY=... # For direct Google API
export OPENAI_API_KEY=sk-... # For direct OpenAI API
export ANTHROPIC_API_KEY=sk-ant-api03-placeholder # Required placeholder
# Run with auto-detected model
claudish --model gpt-4o "implement user authentication" # → OpenAI
claudish --model gemini-2.0-flash "add tests" # → Google
# Or with explicit provider
claudish --model openrouter@anthropic/claude-3.5-sonnet "review code"
Note: In interactive mode, if OPENROUTER_API_KEY is not set, you'll be prompted to enter it. This makes first-time usage super simple!
For AI agents running within Claude Code: Use the dedicated AI agent guide for comprehensive instructions on file-based patterns and sub-agent delegation.
# Print complete AI agent usage guide
claudish --help-ai
# Save guide to file for reference
claudish --help-ai > claudish-agent-guide.md
Quick Reference for AI Agents:
Get available models:
# List all models or search
claudish --models
claudish --models gemini
# Get top recommended models (JSON)
claudish --top-models --json
Run Claudish through sub-agent (recommended pattern):
// Don't run Claudish directly in main conversation
// Use Task tool to delegate to sub-agent
const result = await Task({
subagent_type: "general-purpose",
description: "Implement feature with Grok",
prompt: `
Use Claudish to implement feature with Grok model.
STEPS:
1. Create instruction file: /tmp/claudish-task-${Date.now()}.md
2. Write feature requirements to file
3. Run: claudish --model x-ai/grok-code-fast-1 --stdin < /tmp/claudish-task-*.md
4. Read result and return ONLY summary (2-3 sentences)
DO NOT return full implementation. Keep response under 300 tokens.
`
});
File-based instruction pattern (avoids context pollution):
// Write instructions to file
const instructionFile = `/tmp/claudish-task-${Date.now()}.md`;
const resultFile = `/tmp/claudish-result-${Date.now()}.md`;
await Write({ file_path: instructionFile, content: `
# Task
Your task description here
# Output
Write results to: ${resultFile}
` });
// Run Claudish with stdin
await Bash(`claudish --model x-ai/grok-code-fast-1 --stdin < ${instructionFile}`);
// Read result
const result = await Read({ file_path: resultFile });
// Return summary only
return extractSummary(result);
Key Principles:
--models or --top-models)Resources:
claudish --help-aiskills/claudish-usage/SKILL.md (in repository root)skills/claudish-integration/SKILL.md (in repository root)claudish [OPTIONS] <claude-args...>
For the exhaustive reference with all details, see Settings Reference.
| Flag | Short | Description | Default |
|---|---|---|---|
--model <model> |
-m |
Model to use (provider@model syntax) |
Interactive selector |
--default-provider <name> |
Default provider for bare model routing (v7.0.0+) | Auto-detected | |
--model-opus <model> |
Model for Opus role (planning, complex tasks) | ||
--model-sonnet <model> |
Model for Sonnet role (default coding) | ||
--model-haiku <model> |
Model for Haiku role (fast tasks) | ||
--model-subagent <model> |
Model for sub-agents (Task tool) | ||
--profile <name> |
-p |
Named profile for model mapping | Default profile |
--interactive |
-i |
Interactive mode (persistent session) | Auto when no prompt |
--auto-approve |
-y |
Skip permission prompts | false |
--no-auto-approve |
Explicitly enable permission prompts | ||
--dangerous |
Pass --dangerouslyDisableSandbox |
false |
|
--port <port> |
Proxy server port | Random (3000-9000) | |
--debug |
-d |
Enable debug logging to logs/ |
false |
--log-level <level> |
Log verbosity: debug, info, minimal |
info |
|
--quiet |
-q |
Suppress [claudish] messages |
Default in single-shot |
--verbose |
-v |
Show [claudish] messages |
Default in interactive |
--json |
JSON output for tool integration (implies --quiet) |
false |
|
--stdin |
Read prompt from stdin | false |
|
--free |
Show only free models in selector | false |
|
--monitor |
Proxy to real Anthropic API and log traffic | false |
|
--summarize-tools |
Summarize tool descriptions (for local models) | false |
|
--cost-tracker |
Enable cost tracking (enables monitor mode) | false |
|
--audit-costs |
Show cost analysis report | ||
--reset-costs |
Reset accumulated cost statistics | ||
--models [query] |
-s |
List all models or fuzzy search | |
--top-models |
Show curated recommended models | ||
--force-update |
Force refresh model cache | ||
--init |
Install Claudish skill in current project | ||
--mcp |
Run as MCP server | ||
--gemini-login |
Login to Gemini Code Assist via OAuth | ||
--gemini-logout |
Clear Gemini OAuth credentials | ||
--kimi-login |
Login to Kimi via OAuth | ||
--kimi-logout |
Clear Kimi OAuth credentials | ||
--help-ai |
Show AI agent usage guide | ||
--version |
Show version | ||
--help |
-h |
Show help message | |
-- |
Everything after passes to Claude Code |
Flag passthrough: Any unrecognized flag is automatically forwarded to Claude Code (e.g., --agent, --effort, --permission-mode).
Claudish automatically loads .env from the current directory at startup. For the full list, see Settings Reference.
| Variable | Provider | Aliases |
|---|---|---|
OPENROUTER_API_KEY |
OpenRouter (default backend, 580+ models) | |
GEMINI_API_KEY |
Google Gemini (g@, google@) |
|
OPENAI_API_KEY |
OpenAI (oai@) |
|
MINIMAX_API_KEY |
MiniMax (mm@, mmax@) |
|
MINIMAX_CODING_API_KEY |
MiniMax Coding Plan (mmc@) |
|
MOONSHOT_API_KEY |
Kimi/Moonshot (kimi@) |
KIMI_API_KEY |
KIMI_CODING_API_KEY |
Kimi Coding Plan (kc@) |
Or OAuth via --kimi-login |
ZHIPU_API_KEY |
GLM/Zhipu (glm@) |
GLM_API_KEY |
GLM_CODING_API_KEY |
GLM Coding Plan (gc@) |
ZAI_CODING_API_KEY |
ZAI_API_KEY |
Z.AI (zai@) |
|
OLLAMA_API_KEY |
OllamaCloud (oc@) |
|
OPENCODE_API_KEY |
OpenCode Zen (zen@) — optional for free models |
|
LITELLM_API_KEY |
LiteLLM (ll@) — requires LITELLM_BASE_URL |
|
POE_API_KEY |
Poe (poe@) |
|
VERTEX_API_KEY |
Vertex AI Express (v@) |
|
VERTEX_PROJECT |
Vertex AI OAuth mode (v@) |
GOOGLE_CLOUD_PROJECT |
ANTHROPIC_API_KEY |
Placeholder (suppresses Claude Code dialog) |
| Variable | Description | Default |
|---|---|---|
CLAUDISH_MODEL |
Default model (overrides ANTHROPIC_MODEL) |
Interactive selector |
CLAUDISH_PORT |
Default proxy port | Random (3000-9000) |
CLAUDISH_CONTEXT_WINDOW |
Override context window size (local models) | Auto-detected |
CLAUDISH_MODEL_OPUS |
Model for Opus role | |
CLAUDISH_MODEL_SONNET |
Model for Sonnet role | |
CLAUDISH_MODEL_HAIKU |
Model for Haiku role | |
CLAUDISH_MODEL_SUBAGENT |
Model for sub-agents | |
CLAUDISH_SUMMARIZE_TOOLS |
Summarize tool descriptions (true/1) |
false |
CLAUDISH_TELEMETRY |
Override telemetry (0/false/off to disable) |
From config |
CLAUDISH_LOCAL_MAX_PARALLEL |
Max concurrent local model requests (1-8) | 1 |
CLAUDISH_LOCAL_QUEUE_ENABLED |
Enable/disable local model queue | true |
CLAUDISH_DEFAULT_PROVIDER |
Default provider for bare model routing (v7.0.0+) | Auto-detected |
CLAUDISH_QWEN_NO_THINK |
Disable thinking for Qwen models (1) |
| Variable | Description |
|---|---|
ANTHROPIC_MODEL |
Fallback for CLAUDISH_MODEL |
ANTHROPIC_DEFAULT_OPUS_MODEL |
Fallback for CLAUDISH_MODEL_OPUS |
ANTHROPIC_DEFAULT_SONNET_MODEL |
Fallback for CLAUDISH_MODEL_SONNET |
ANTHROPIC_DEFAULT_HAIKU_MODEL |
Fallback for CLAUDISH_MODEL_HAIKU |
CLAUDE_CODE_SUBAGENT_MODEL |
Fallback for CLAUDISH_MODEL_SUBAGENT |
CLAUDE_PATH |
Custom path to Claude Code binary |
| Variable | Provider | Default |
|---|---|---|
GEMINI_BASE_URL |
Gemini API | https://generativelanguage.googleapis.com |
OPENAI_BASE_URL |
OpenAI/Azure | https://api.openai.com |
MINIMAX_BASE_URL |
MiniMax | https://api.minimax.io |
MOONSHOT_BASE_URL |
Kimi/Moonshot | https://api.moonshot.ai |
ZHIPU_BASE_URL |
GLM/Zhipu | https://open.bigmodel.cn |
ZAI_BASE_URL |
Z.AI | https://api.z.ai |
OLLAMACLOUD_BASE_URL |
OllamaCloud | https://ollama.com |
OPENCODE_BASE_URL |
OpenCode Zen | https://opencode.ai/zen |
LITELLM_BASE_URL |
LiteLLM proxy server | (required with LITELLM_API_KEY) |
OLLAMA_BASE_URL |
Ollama (local) | http://localhost:11434 |
OLLAMA_HOST |
Alias for OLLAMA_BASE_URL |
|
LMSTUDIO_BASE_URL |
LM Studio (local) | http://localhost:1234 |
VLLM_BASE_URL |
vLLM (local) | http://localhost:8000 |
MLX_BASE_URL |
MLX (local) | http://127.0.0.1:8080 |
Priority order: CLI flags > CLAUDISH_* env vars > ANTHROPIC_* env vars > profile config > interactive selector.
Important Notes:
ANTHROPIC_API_KEY=sk-ant-api03-placeholder (or any value) to suppress the Claude Code login dialogClaudish uses a two-scope configuration system:
| File | Scope | Purpose |
|---|---|---|
~/.claudish/config.json |
Global | Profiles, telemetry, routing rules (shared across projects) |
.claudish.json |
Local | Project-specific profiles and routing rules (overrides global) |
.env |
Local | Environment variables (auto-loaded at startup) |
Profile configuration (~/.claudish/config.json):
{
"version": "1.0.0",
"defaultProfile": "default",
"profiles": {
"default": {
"name": "default",
"models": {
"opus": "[email protected]",
"sonnet": "google@gemini-3-pro",
"haiku": "[email protected]",
"subagent": "[email protected]"
}
}
},
"routing": {
"kimi-*": ["kc", "kimi", "openrouter"],
"glm-*": ["gc", "glm"],
"*": ["litellm", "openrouter"]
}
}
Custom routing rules map model name patterns to ordered provider fallback chains. Patterns support exact names, globs (kimi-*), and * catch-all. Local .claudish.json routing rules replace global rules entirely.
Manage profiles with:
claudish init [--local|--global] # Setup wizard
claudish profile list [--local|--global] # List profiles
claudish profile add [--local|--global] # Add profile
claudish profile use <name> # Set default
claudish profile edit <name> # Edit profile
For the complete configuration reference, see Settings Reference.
Claudish uses provider@model[:concurrency] syntax for explicit routing, plus smart auto-detection for native providers:
provider@model[:concurrency]# Explicit provider routing
claudish --model [email protected] "quick task"
claudish --model openrouter@deepseek/deepseek-r1 "analysis"
claudish --model oai@gpt-4o "implement feature"
claudish --model [email protected]:3 "code review" # 3 concurrent requests
| Shortcut | Provider | API Key | Example |
|---|---|---|---|
g@, google@ |
Google Gemini | GEMINI_API_KEY |
[email protected] |
oai@ |
OpenAI Direct | OPENAI_API_KEY |
oai@gpt-4o |
or@, openrouter@ |
OpenRouter | OPENROUTER_API_KEY |
or@deepseek/deepseek-r1 |
mm@, mmax@ |
MiniMax Direct | MINIMAX_API_KEY |
[email protected] |
kimi@, moon@ |
Kimi Direct | MOONSHOT_API_KEY |
kimi@kimi-k2 |
glm@, zhipu@ |
GLM Direct | ZHIPU_API_KEY |
glm@glm-4 |
zai@ |
Z.AI Direct | ZAI_API_KEY |
zai@glm-4 |
llama@, lc@, meta@ |
OllamaCloud | OLLAMA_API_KEY |
[email protected] |
oc@ |
OllamaCloud | OLLAMA_API_KEY |
[email protected] |
zen@ |
OpenCode Zen (free/paid) | OPENCODE_API_KEY (optional) |
zen@gpt-5-nano |
zgo@, zengo@ |
OpenCode Zen Go plan | OPENCODE_API_KEY |
zgo@glm-5 |
v@, vertex@ |
Vertex AI | VERTEX_API_KEY |
[email protected] |
go@ |
Gemini CodeAssist | (OAuth) | [email protected] |
poe@ |
Poe | POE_API_KEY |
poe@GPT-4o |
ollama@ |
Ollama (local) | (none) | [email protected] |
lms@, lmstudio@ |
LM Studio (local) | (none) | [email protected] |
vllm@ |
vLLM (local) | (none) | vllm@mistral-7b |
mlx@ |
MLX (local) | (none) | [email protected] |
When no provider is specified, Claudish auto-detects from model name:
| Model Pattern | Routes To | Example |
|---|---|---|
gemini-*, google/* |
Google Gemini | gemini-2.0-flash |
gpt-*, o1-*, o3-* |
OpenAI Direct | gpt-4o |
llama-*, meta-llama/* |
OllamaCloud | llama-3.1-70b |
abab-*, minimax/* |
MiniMax Direct | abab-6.5 |
kimi-*, moonshot-* |
Kimi Direct | kimi-k2 |
glm-*, zhipu/* |
GLM Direct | glm-4 |
poe:* |
Poe | poe:GPT-4o |
claude-*, anthropic/* |
Native Anthropic | claude-sonnet-4 |
Unknown vendor/model |
Error | Use openrouter@vendor/model |
# Auto-detected native routing (no prefix needed!)
claudish --model gemini-2.0-flash "quick task" # → Google API
claudish --model gpt-4o "implement feature" # → OpenAI API
claudish --model llama-3.1-70b "code review" # → OllamaCloud
# Explicit provider routing
claudish --model [email protected] "complex analysis"
claudish --model oai@o1 "complex reasoning"
claudish --model openrouter@deepseek/deepseek-r1 "deep analysis"
# OllamaCloud - cloud-hosted Llama models
claudish --model [email protected] "code review"
claudish --model [email protected] "analyze image"
# Vertex AI - Google Cloud
VERTEX_API_KEY=... claudish --model [email protected] "task"
VERTEX_PROJECT=my-project claudish --model [email protected] "OAuth mode"
# Local models with concurrency control
claudish --model [email protected]:3 "review" # 3 concurrent requests
claudish --model [email protected]:0 "fast" # No limit (bypass queue)
# Unknown vendors require explicit OpenRouter
claudish --model openrouter@qwen/qwen-2.5 "task"
claudish --model or@mistralai/mistral-large "analysis"
The routing priority for bare model names (no provider@ prefix) is configurable. By default, Claudish tries LiteLLM (if configured), then OpenRouter. Override this with defaultProvider:
# Set default provider globally
claudish config set defaultProvider openrouter
# Or via env var
export CLAUDISH_DEFAULT_PROVIDER=openrouter
# Or per-invocation
claudish --default-provider litellm --model minimax-m2.5 "task"
Precedence: --default-provider flag > CLAUDISH_DEFAULT_PROVIDER env var > config file defaultProvider > legacy LiteLLM auto-promotion > OPENROUTER_API_KEY detection > hardcoded "openrouter".
Explicit provider@model syntax always bypasses defaultProvider and routes directly.
Register your own OpenAI-compatible endpoints in ~/.claudish/config.json. See Settings Reference for the full schema.
{
"customEndpoints": {
"my-vllm": {
"kind": "simple",
"url": "http://gpu-box:8000/v1",
"format": "openai",
"apiKey": "none"
}
},
"defaultProvider": "my-vllm"
}
Then route to it with: claudish --model my-vllm@llama3 "task"
The old prefix/model syntax still works but shows deprecation warnings:
# Old (deprecated) → New (recommended)
claudish --model g/gemini-pro → claudish --model g@gemini-pro
claudish --model oai/gpt-4o → claudish --model oai@gpt-4o
claudish --model ollama/llama3.2 → claudish --model [email protected]
Top recommended models for development (v3.1.1):
| Model | Provider | Best For |
|---|---|---|
openai/gpt-5.3 |
OpenAI | Default - Most advanced reasoning |
minimax/minimax-m2.1 |
MiniMax | Budget-friendly, fast |
z-ai/glm-4.7 |
Z.AI | Balanced performance |
google/gemini-3-pro-preview |
1M context window | |
moonshotai/kimi-k2-thinking |
MoonShot | Extended reasoning |
deepseek/deepseek-v3.2 |
DeepSeek | Code specialist |
qwen/qwen3-vl-235b-a22b-thinking |
Alibaba | Vision + reasoning |
Vertex AI Partner Models (MaaS - Google Cloud billing):
| Model | Provider | Best For |
|---|---|---|
vertex/minimax/minimax-m2-maas |
MiniMax | Fast, budget-friendly |
vertex/mistralai/codestral-2 |
Mistral | Code specialist |
vertex/deepseek/deepseek-v3-2-maas |
DeepSeek | Deep reasoning |
vertex/qwen/qwen3-coder-480b-a35b-instruct-maas |
Qwen | Agentic coding |
vertex/openai/gpt-oss-120b-maas |
OpenAI | Open-weight reasoning |
List all models:
claudish --models # List all OpenRouter models
claudish --models gemini # Search for specific models
claudish --top-models # Show curated recommendations
Claudish forwards all unrecognized flags directly to Claude Code. This means any Claude Code flag works with claudish — no wrapper needed:
# Use Claude Code agents
claudish --model grok --agent code-review "review auth system"
# Control effort and permissions
claudish --model grok --effort high --permission-mode plan "design API"
# Set budget caps
claudish --model grok --max-budget-usd 0.50 "quick fix"
# Custom system prompts
claudish --model grok --append-system-prompt "Always respond in JSON" "list files"
# Restrict available tools
claudish --model grok --allowedTools "Read,Grep" "search for auth bugs"
Claudish flags (--model, --stdin, --quiet, -y, etc.) can appear in any order — they are always recognized regardless of position.
Use -- when a Claude Code flag value starts with -:
claudish --model grok -- --system-prompt "-verbose logging" "task"
Every model can now "see" images — even models without native vision support.
When you send an image to a non-vision model (like local Ollama models), Claudish automatically:
[Image Description: ...] textClaude Code → image + "what's in this?" → Claudish
↓
┌──────────────────────────────┐
│ Model supports vision? │
│ YES → pass image through │
│ NO → describe via Claude → │
│ replace with text │
└──────────────────────────────┘
↓
Target Model
How it works:
x-api-key from Claude Code (no extra configuration)Example:
# Local Ollama model (no vision) — images are automatically described
claudish --model [email protected] "what's in this screenshot?"
# Vision-capable model — images pass through unchanged
claudish --model [email protected] "what's in this screenshot?"
Fallback behavior: If the vision proxy fails (network error, timeout, API issue), Claudish falls back to stripping images — the request still goes through, just without image context.
Claudish automatically shows critical information in the Claude Code status bar - no setup required!
Ultra-Compact Format: directory • model-id • $cost • ctx%
Visual Design:
Examples:
claudish • x-ai/grok-code-fast-1 • $0.003 • 95% - Using Grok, $0.003 spent, 95% context leftmy-project • openai/gpt-5-codex • $0.12 • 67% - Using GPT-5, $0.12 spent, 67% context leftbackend • minimax/minimax-m2 • $0.05 • 82% - Using MiniMax M2, $0.05 spent, 82% lefttest • openrouter/auto • $0.01 • 90% - Using any custom model, $0.01 spent, 90% leftCritical Tracking (Live Updates):
Thinking Mode Optimized:
Custom Model Support:
openrouter/auto, custom models)How it works:
--settings flag (doesn't modify global Claude Code config)CLAUDISH_ACTIVE_MODEL_NAME env varPer-instance isolation:
~/.claude/settings.json# Simple prompt
claudish "fix the bug in user.ts"
# Multi-word prompt
claudish "implement user authentication with JWT tokens"
# Auto-detected native routing (model name determines provider)
claudish --model gpt-4o "refactor entire API layer" # → OpenAI
claudish --model gemini-2.0-flash "quick fix" # → Google
claudish --model llama-3.1-70b "code review" # → OllamaCloud
# Explicit provider routing (new @ syntax)
claudish --model [email protected] "complex analysis"
claudish --model oai@o1 "deep reasoning task"
claudish --model openrouter@deepseek/deepseek-r1 "analysis" # Unknown vendors need explicit OR
# Local models with concurrency control
claudish --model [email protected] "code review"
claudish --model [email protected]:3 "parallel processing" # 3 concurrent
claudish --model [email protected] "implement dashboard UI"
Auto-approve is enabled by default. For fully autonomous mode, add --dangerous:
# Basic usage (auto-approve already enabled)
claudish "delete unused files"
# Fully autonomous (auto-approve + dangerous sandbox disabled)
claudish --dangerous "install dependencies"
# Disable auto-approve if you want prompts
claudish --no-auto-approve "make important changes"
# Use specific port
claudish --port 3000 "analyze codebase"
# Or set default
export CLAUDISH_PORT=3000
claudish "your task"
# Verbose mode
claudish "debug issue" --verbose
# Custom working directory
claudish "analyze code" --cwd /path/to/project
# Multiple flags
claudish --model openai/gpt-5.3-codex "task" --verbose --debug
NEW! Claudish now includes a monitor mode to help you understand how Claude Code works internally.
# Enable monitor mode (requires real Anthropic API key)
claudish --monitor --debug "implement a feature"
What Monitor Mode Does:
logs/claudish_*.log when --debug is usedWhen to use Monitor Mode:
Requirements:
# Monitor mode requires a REAL Anthropic API key (not placeholder)
export ANTHROPIC_API_KEY='sk-ant-api03-...'
# Use with --debug to save logs to file
claudish --monitor --debug "your task"
# Logs are saved to: logs/claudish_TIMESTAMP.log
Example Output:
[Monitor] Server started on http://127.0.0.1:8765
[Monitor] Mode: Passthrough to real Anthropic API
[Monitor] All traffic will be logged for analysis
=== [MONITOR] Claude Code → Anthropic API Request ===
{
"model": "claude-sonnet-4.5",
"messages": [...],
"max_tokens": 4096,
...
}
=== End Request ===
=== [MONITOR] Anthropic API → Claude Code Response (Streaming) ===
event: message_start
data: {"type":"message_start",...}
event: content_block_start
data: {"type":"content_block_start",...}
...
=== End Streaming Response ===
Note: Monitor mode charges your Anthropic account (not OpenRouter). Use --debug flag to save logs for analysis.
Claudish supports three output modes for different use cases:
Clean output with no [claudish] logs - perfect for piping to other tools:
# Quiet by default in single-shot
claudish "what is 2+2?"
# Output: 2 + 2 equals 4.
# Use in pipelines
claudish "list 3 colors" | grep -i blue
# Redirect to file
claudish "analyze code" > analysis.txt
Show all [claudish] log messages for debugging:
# Verbose mode
claudish --verbose "what is 2+2?"
# Output:
# [claudish] Starting Claude Code with openai/gpt-4o
# [claudish] Proxy URL: http://127.0.0.1:8797
# [claudish] Status line: dir • openai/gpt-4o • $cost • ctx%
# ...
# 2 + 2 equals 4.
# [claudish] Shutting down proxy server...
# [claudish] Done
# Interactive mode is verbose by default
claudish --interactive
Structured output perfect for automation and tool integration:
# JSON output (always quiet)
claudish --json "what is 2+2?"
# Output: {"type":"result","result":"2 + 2 equals 4.","total_cost_usd":0.068,"usage":{...}}
# Extract just the result with jq
claudish --json "list 3 colors" | jq -r '.result'
# Get cost and token usage
claudish --json "analyze code" | jq '{result, cost: .total_cost_usd, tokens: .usage.input_tokens}'
# Use in scripts
RESULT=$(claudish --json "check if tests pass" | jq -r '.result')
echo "AI says: $RESULT"
# Track costs across multiple runs
for task in task1 task2 task3; do
claudish --json "$task" | jq -r '"\(.total_cost_usd)"'
done | awk '{sum+=$1} END {print "Total: $"sum}'
JSON Output Fields:
result - The AI's response texttotal_cost_usd - Total cost in USDusage.input_tokens - Input tokens usedusage.output_tokens - Output tokens usedduration_ms - Total duration in millisecondsnum_turns - Number of conversation turnsmodelUsage - Per-model usage breakdownclaudish "your prompt"
↓
1. Parse arguments (--model, --no-auto-approve, --dangerous, etc.)
2. Find available port (random or specified)
3. Start local proxy on http://127.0.0.1:PORT
4. Spawn: claude --auto-approve --env ANTHROPIC_BASE_URL=http://127.0.0.1:PORT
5. Proxy translates: Anthropic API → OpenRouter API
6. Stream output in real-time
7. Cleanup proxy on exit
Normal Mode (OpenRouter):
Claude Code → Anthropic API format → Local Proxy → OpenRouter API format → OpenRouter
↓
Claude Code ← Anthropic API format ← Local Proxy ← OpenRouter API format ← OpenRouter
Monitor Mode (Anthropic Passthrough):
Claude Code → Anthropic API format → Local Proxy (logs) → Anthropic API
↓
Claude Code ← Anthropic API format ← Local Proxy (logs) ← Anthropic API
Each claudish invocation:
This allows multiple parallel runs:
# Terminal 1
claudish --model x-ai/grok-code-fast-1 "task A"
# Terminal 2
claudish --model openai/gpt-5.3-codex "task B"
# Terminal 3
claudish --model minimax/minimax-m2 "task C"
NEW in v1.1.0: Claudish now fully supports models with extended thinking/reasoning capabilities (Grok, o1, etc.) with complete Anthropic Messages API protocol compliance.
Claudish includes a sophisticated Thinking Translation Model that aligns Claude Code's native thinking budget with the unique requirements of every major AI provider.
When you set a thinking budget in Claude (e.g., budget: 16000), Claudish automatically translates it:
| Provider | Model | Translation Logic |
|---|---|---|
| OpenAI | o1, o3 | Maps budget to reasoning_effort (minimal/low/medium/high) |
| Gemini 3 | Maps to thinking_level (low/high) |
|
| Gemini 2.x | Passes exact thinking_budget (capped at 24k) |
|
| xAI | Grok 3 Mini | Maps to reasoning_effort (low/high) |
| Qwen | Qwen 2.5 | Enables enable_thinking + exact budget |
| MiniMax | M2 | Enables reasoning_split (interleaved thinking) |
| DeepSeek | R1 | Automatically manages reasoning (params stripped for safety) |
This ensures you can use standard Claude Code thinking controls with ANY supported model, without worrying about API specificities.
Some AI models (like Grok and OpenAI's o1) can show their internal reasoning process before providing the final answer. This "thinking" content helps you understand how the model arrived at its conclusion.
Claudish implements the Anthropic Messages API's interleaved-thinking protocol:
Thinking Blocks (Hidden):
Text Blocks (Visible):
Streaming Protocol (V2 - Protocol Compliant):
1. message_start
2. content_block_start (text, index=0) ← IMMEDIATE! (required)
3. ping
4. [If reasoning arrives]
- content_block_stop (index=0) ← Close initial empty block
- content_block_start (thinking, index=1) ← Reasoning
- thinking_delta events × N
- content_block_stop (index=1)
5. content_block_start (text, index=2) ← Response
6. text_delta events × M
7. content_block_stop (index=2)
8. message_delta + message_stop
Critical: content_block_start must be sent immediately after message_start, before ping. This is required by the Anthropic Messages API protocol for proper UI initialization.
Key Features:
thinking_delta vs text_delta event typesBefore (v1.0.0 - No Thinking Support):
After (v1.1.0 - Full Protocol Support):
For complete protocol documentation, see:
Claudish now intelligently adapts to ANY reasoning model!
No more hardcoded lists or manual flags. Claudish dynamically queries OpenRouter metadata to enable thinking capabilities for any model that supports them.
Auto-Detection:
deepseek-r1 or minimax-m2)Smart Parameter Mapping:
reasoning_efforthighmediumlowUniversal Compatibility:
NEW in v1.2.0: Claudish now intelligently manages token counting to support ANY context window size (from 128k to 2M+) while preserving Claude Code's native auto-compaction behavior.
Claude Code naturally assumes a fixed context window (typically 200k tokens for Sonnet).
Claudish implements a "Dual-Accounting" system:
Internal Scaling (For Claude):
Accurate Reporting (For You):
Benefits:
mcp/claudish/
├── src/
│ ├── index.ts # Main entry point
│ ├── cli.ts # CLI argument parser
│ ├── proxy-server.ts # Hono-based proxy server
│ ├── transform.ts # API format translation (from claude-code-proxy)
│ ├── claude-runner.ts # Claude CLI runner (creates temp settings)
│ ├── port-manager.ts # Port utilities
│ ├── config.ts # Constants and defaults
│ ├── types.ts # TypeScript types
│ └── services/
│ └── vision-proxy.ts # Image description for non-vision models
├── tests/ # Test files
├── package.json
├── tsconfig.json
└── biome.json
Claudish uses a Hono-based proxy server inspired by claude-code-proxy:
Why Hono?
# Install dependencies
bun install
# Development mode
bun run dev "test prompt"
# Build
bun run build
# Lint
bun run lint
# Format
bun run format
# Type check
bun run typecheck
# Run tests
bun test
Claudish includes a comprehensive snapshot testing system to ensure 1:1 compatibility with the official Claude Code protocol:
# Run snapshot tests (13/13 passing ✅)
bun test tests/snapshot.test.ts
# Full workflow: capture fixtures + run tests
./tests/snapshot-workflow.sh --full
# Capture new test fixtures from monitor mode
./tests/snapshot-workflow.sh --capture
# Debug SSE events
bun tests/debug-snapshot.ts
What Gets Tested:
Documentation:
# Link for global use
bun run install:global
# Now use anywhere
claudish "your task"
Install Claude Code:
npm install -g claude-code
# or visit: https://claude.com/claude-code
Set your API key:
export OPENROUTER_API_KEY=sk-or-v1-...
Or add to your shell profile (~/.zshrc, ~/.bashrc):
echo 'export OPENROUTER_API_KEY=sk-or-v1-...' >> ~/.zshrc
source ~/.zshrc
Specify a custom port:
claudish --port 3000 "your task"
Or increase port range in src/config.ts.
Check OpenRouter API status:
Verify your API key works:
If the status line doesn't show the model name:
Check if --settings flag is being passed:
# Look for this in Claudish output:
# [claudish] Instance settings: /tmp/claudish-settings-{timestamp}.json
Verify environment variable is set:
# Should be set automatically by Claudish
echo $CLAUDISH_ACTIVE_MODEL_NAME
# Should output something like: xAI/Grok-1
Test status line command manually:
export CLAUDISH_ACTIVE_MODEL_NAME="xAI/Grok-1"
cat > /dev/null && echo "[$CLAUDISH_ACTIVE_MODEL_NAME] 📁 $(basename "$(pwd)")"
# Should output: [xAI/Grok-1] 📁 your-directory-name
Check temp settings file:
# File is created in /tmp/claudish-settings-*.json
ls -la /tmp/claudish-settings-*.json 2>/dev/null | tail -1
cat /tmp/claudish-settings-*.json | head -1
Verify bash is available:
which bash
# Should show path to bash (usually /bin/bash or /usr/bin/bash)
Note: Temp settings files are automatically cleaned up when Claudish exits. If you see multiple files, you may have crashed instances - they're safe to delete manually.
| Feature | Claude Code | Claudish |
|---|---|---|
| Model | Anthropic models only | Any OpenRouter model |
| API | Anthropic API | OpenRouter API |
| Cost | Anthropic pricing | OpenRouter pricing |
| Setup | API key → direct | API key → proxy → OpenRouter |
| Speed | Direct connection | ~Same (local proxy) |
| Features | All Claude Code features | All Claude Code features |
| Vision | Native (Anthropic models) | Any model (auto-described via Claude) |
When to use Claudish:
When to use Claude Code:
Contributions welcome! Please:
git checkout -b feature/amazinggit commit -m 'Add amazing feature'git push origin feature/amazingMIT © MadAppGang
Claudish's proxy implementation is based on claude-code-proxy by @kiyo-e. We've adapted their excellent Hono-based API translation layer for OpenRouter integration.
Key contributions from claude-code-proxy:
transform.ts)Thank you to the claude-code-proxy team for building a robust, production-ready foundation! 🙏
Made with ❤️ by MadAppGang
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"claudish": {
"command": "npx",
"args": [
"-y",
"claudish"
]
}
}
}