claudish 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,8 @@
19
19
  - ✅ **Parallel runs** - Each instance gets isolated proxy
20
20
  - ✅ **Autonomous mode** - Bypass all prompts with flags
21
21
  - ✅ **Context inheritance** - Runs in current directory with same `.claude` settings
22
- - ✅ **Multiple models** - 5 prioritized OpenRouter models
22
+ - ✅ **Multiple models** - 10+ prioritized OpenRouter models
23
+ - ✅ **Agent support** - Use Claude Code agents in headless mode with `--agent`
23
24
 
24
25
  ## Installation
25
26
 
@@ -214,7 +215,10 @@ claudish [OPTIONS] <claude-args...>
214
215
  | `-d, --debug` | Enable debug logging to file | `false` |
215
216
  | `--no-auto-approve` | Disable auto-approve (require prompts) | Auto-approve **enabled** |
216
217
  | `--dangerous` | Pass `--dangerouslyDisableSandbox` | `false` |
217
- | `--list-models` | List available models | - |
218
+ | `--agent <agent>` | Use specific agent (e.g., `frontend:developer`) | - |
219
+ | `--list-models` | List available OpenRouter models | - |
220
+ | `--list-agents` | List available agents in current project | - |
221
+ | `--force-update` | Force refresh model cache | - |
218
222
  | `--init` | Install Claudish skill in current project | - |
219
223
  | `--help-ai` | Show AI agent usage guide | - |
220
224
  | `-h, --help` | Show help message | - |
@@ -263,6 +267,28 @@ List models anytime with:
263
267
  claudish --list-models
264
268
  ```
265
269
 
270
+ ## Agent Support (NEW in v2.1.0)
271
+
272
+ Run specialized agents in headless mode with direct agent selection:
273
+
274
+ ```bash
275
+ # Use frontend developer agent
276
+ claudish --model x-ai/grok-code-fast-1 --agent frontend:developer "create a React button component"
277
+
278
+ # Use API architect agent
279
+ claudish --model openai/gpt-5-codex --agent api-architect "design REST API for user management"
280
+
281
+ # Discover available agents in your project
282
+ claudish --list-agents
283
+ ```
284
+
285
+ **Agent Features:**
286
+
287
+ - ✅ **Direct agent selection** - No need to ask Claude to use an agent
288
+ - ✅ **Automatic prefixing** - Adds `@agent-` automatically (`frontend:developer` → `@agent-frontend:developer`)
289
+ - ✅ **Project-specific agents** - Works with any agents installed in `.claude/agents/`
290
+ - ✅ **Agent discovery** - List all available agents with `--list-agents`
291
+
266
292
  ## Status Line Display
267
293
 
268
294
  Claudish automatically shows critical information in the Claude Code status bar - **no setup required!**
package/dist/index.js CHANGED
@@ -186,7 +186,14 @@ async function runClaudeWithProxy(config, proxyUrl) {
186
186
  if (config.jsonOutput) {
187
187
  claudeArgs.push("--output-format", "json");
188
188
  }
189
- claudeArgs.push(...config.claudeArgs);
189
+ if (config.agent && config.claudeArgs.length > 0) {
190
+ const modifiedArgs = [...config.claudeArgs];
191
+ const agentId = config.agent.startsWith("@agent-") ? config.agent : `@agent-${config.agent}`;
192
+ modifiedArgs[0] = `Use the ${agentId} agent to: ${modifiedArgs[0]}`;
193
+ claudeArgs.push(...modifiedArgs);
194
+ } else {
195
+ claudeArgs.push(...config.claudeArgs);
196
+ }
190
197
  }
191
198
  const env = {
192
199
  ...process.env,
@@ -331,7 +338,7 @@ function getAvailableModels() {
331
338
  }
332
339
 
333
340
  // src/cli.ts
334
- import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2, mkdirSync, copyFileSync } from "node:fs";
341
+ import { readFileSync as readFileSync2, writeFileSync as writeFileSync3, existsSync as existsSync2, mkdirSync, copyFileSync } from "node:fs";
335
342
  import { fileURLToPath as fileURLToPath2 } from "node:url";
336
343
  import { dirname as dirname2, join as join3 } from "node:path";
337
344
  var __filename3 = fileURLToPath2(import.meta.url);
@@ -626,7 +633,7 @@ async function updateModelsFromOpenRouter() {
626
633
  source: "https://openrouter.ai/models?categories=programming&fmt=cards&order=top-weekly",
627
634
  models: recommendations
628
635
  };
629
- writeFileSync2(MODELS_JSON_PATH, JSON.stringify(updatedData, null, 2), "utf-8");
636
+ writeFileSync3(MODELS_JSON_PATH, JSON.stringify(updatedData, null, 2), "utf-8");
630
637
  console.error(`✅ Updated ${recommendations.length} models (last updated: ${updatedData.lastUpdated})`);
631
638
  } catch (error) {
632
639
  console.error(`❌ Failed to update models: ${error instanceof Error ? error.message : String(error)}`);
@@ -684,6 +691,10 @@ OPTIONS:
684
691
  --help-ai Show AI agent usage guide (file-based patterns, sub-agents)
685
692
  --init Install Claudish skill in current project (.claude/skills/)
686
693
 
694
+ CUSTOM MODELS:
695
+ Claudish accepts ANY valid OpenRouter model ID, even if not in --list-models
696
+ Example: claudish --model your_provider/custom-model-123 "task"
697
+
687
698
  MODES:
688
699
  • Interactive mode (default): Shows model selector, starts persistent session
689
700
  • Single-shot mode: Runs one task in headless mode and exits (requires --model)
@@ -1072,7 +1083,7 @@ async function selectModelInteractively() {
1072
1083
  }
1073
1084
 
1074
1085
  // src/logger.ts
1075
- import { writeFileSync as writeFileSync3, appendFile, existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
1086
+ import { writeFileSync as writeFileSync4, appendFile, existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
1076
1087
  import { join as join4 } from "path";
1077
1088
  var logFilePath = null;
1078
1089
  var logLevel = "info";
@@ -1103,7 +1114,7 @@ function scheduleFlush() {
1103
1114
  flushTimer = null;
1104
1115
  }
1105
1116
  if (logFilePath && logBuffer.length > 0) {
1106
- writeFileSync3(logFilePath, logBuffer.join(""), { flag: "a" });
1117
+ writeFileSync4(logFilePath, logBuffer.join(""), { flag: "a" });
1107
1118
  logBuffer = [];
1108
1119
  }
1109
1120
  });
@@ -1124,7 +1135,7 @@ function initLogger(debugMode, level = "info") {
1124
1135
  }
1125
1136
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-").split("T").join("_").slice(0, -5);
1126
1137
  logFilePath = join4(logsDir, `claudish_${timestamp}.log`);
1127
- writeFileSync3(logFilePath, `Claudish Debug Log - ${new Date().toISOString()}
1138
+ writeFileSync4(logFilePath, `Claudish Debug Log - ${new Date().toISOString()}
1128
1139
  Log Level: ${level}
1129
1140
  ${"=".repeat(80)}
1130
1141
 
@@ -3359,7 +3370,7 @@ var serve = (options, listeningListener) => {
3359
3370
  };
3360
3371
 
3361
3372
  // src/proxy-server.ts
3362
- import { writeFileSync as writeFileSync4 } from "node:fs";
3373
+ import { writeFileSync as writeFileSync5 } from "node:fs";
3363
3374
 
3364
3375
  // src/transform.ts
3365
3376
  function removeUriFormat(schema) {
@@ -4147,7 +4158,7 @@ data: ${JSON.stringify(data)}
4147
4158
  total_tokens: cumulativeInputTokens + cumulativeOutputTokens,
4148
4159
  updated_at: Date.now()
4149
4160
  };
4150
- writeFileSync4(tokenFilePath, JSON.stringify(tokenData), "utf-8");
4161
+ writeFileSync5(tokenFilePath, JSON.stringify(tokenData), "utf-8");
4151
4162
  } catch (error) {
4152
4163
  if (isLoggingEnabled()) {
4153
4164
  log(`[Proxy] Failed to write token file: ${error}`);
package/package.json CHANGED
@@ -1,12 +1,29 @@
1
1
  {
2
2
  "name": "claudish",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "CLI tool to run Claude Code with any OpenRouter model (Grok, GPT-5, MiniMax, etc.) via local Anthropic API-compatible proxy",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "bin": {
8
8
  "claudish": "dist/index.js"
9
9
  },
10
+ "scripts": {
11
+ "dev": "bun run src/index.ts",
12
+ "dev:grok": "bun run src/index.ts --interactive --model x-ai/grok-code-fast-1",
13
+ "dev:grok:debug": "bun run src/index.ts --interactive --debug --log-level info --model x-ai/grok-code-fast-1",
14
+ "dev:info": "bun run src/index.ts --interactive --monitor",
15
+ "extract-models": "bun run scripts/extract-models.ts",
16
+ "build": "bun run extract-models && bun build src/index.ts --outdir dist --target node && chmod +x dist/index.js",
17
+ "link": "npm link",
18
+ "unlink": "npm unlink -g claudish",
19
+ "install-global": "bun run build && npm link",
20
+ "kill-all": "pkill -f 'bun.*claudish' || pkill -f 'claude.*claudish-settings' || echo 'No claudish processes found'",
21
+ "test": "bun test ./tests/comprehensive-model-test.ts",
22
+ "typecheck": "tsc --noEmit",
23
+ "lint": "biome check .",
24
+ "format": "biome format --write .",
25
+ "postinstall": "node scripts/postinstall.cjs"
26
+ },
10
27
  "dependencies": {
11
28
  "@hono/node-server": "^1.19.6",
12
29
  "hono": "^4.10.6"
@@ -37,22 +54,5 @@
37
54
  "ai"
38
55
  ],
39
56
  "author": "Jack Rudenko <i@madappgang.com>",
40
- "license": "MIT",
41
- "scripts": {
42
- "dev": "bun run src/index.ts",
43
- "dev:grok": "bun run src/index.ts --interactive --model x-ai/grok-code-fast-1",
44
- "dev:grok:debug": "bun run src/index.ts --interactive --debug --log-level info --model x-ai/grok-code-fast-1",
45
- "dev:info": "bun run src/index.ts --interactive --monitor",
46
- "extract-models": "bun run scripts/extract-models.ts",
47
- "build": "bun run extract-models && bun build src/index.ts --outdir dist --target node && chmod +x dist/index.js",
48
- "link": "npm link",
49
- "unlink": "npm unlink -g claudish",
50
- "install-global": "bun run build && npm link",
51
- "kill-all": "pkill -f 'bun.*claudish' || pkill -f 'claude.*claudish-settings' || echo 'No claudish processes found'",
52
- "test": "bun test ./tests/comprehensive-model-test.ts",
53
- "typecheck": "tsc --noEmit",
54
- "lint": "biome check .",
55
- "format": "biome format --write .",
56
- "postinstall": "node scripts/postinstall.cjs"
57
- }
58
- }
57
+ "license": "MIT"
58
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "1.1.5",
3
- "lastUpdated": "2025-11-19",
2
+ "version": "2.1.0",
3
+ "lastUpdated": "2025-11-20",
4
4
  "source": "https://openrouter.ai/models?categories=programming&fmt=cards&order=top-weekly",
5
5
  "models": [
6
6
  {
@@ -24,13 +24,55 @@
24
24
  "isModerated": false,
25
25
  "recommended": true
26
26
  },
27
+ {
28
+ "id": "openai/gpt-5.1-codex",
29
+ "name": "OpenAI: GPT-5.1-Codex",
30
+ "description": "GPT-5.1-Codex is a specialized version of GPT-5.1 optimized for software engineering and coding workflows. It is designed for both interactive development sessions and long, independent execution of complex engineering tasks. The model supports building projects from scratch, feature development, debugging, large-scale refactoring, and code review. Compared to GPT-5.1, Codex is more steerable, adheres closely to developer instructions, and produces cleaner, higher-quality code outputs. Reasoning effort can be adjusted with the `reasoning.effort` parameter. Read the [docs here](https://openrouter.ai/docs/use-cases/reasoning-tokens#reasoning-effort-level)\n\nCodex integrates into developer environments including the CLI, IDE extensions, GitHub, and cloud tasks. It adapts reasoning effort dynamically—providing fast responses for small tasks while sustaining extended multi-hour runs for large projects. The model is trained to perform structured code reviews, catching critical flaws by reasoning over dependencies and validating behavior against tests. It also supports multimodal inputs such as images or screenshots for UI development and integrates tool use for search, dependency installation, and environment setup. Codex is intended specifically for agentic coding applications.",
31
+ "provider": "Openai",
32
+ "category": "vision",
33
+ "priority": 2,
34
+ "pricing": {
35
+ "input": "$1.25/1M",
36
+ "output": "$10.00/1M",
37
+ "average": "$5.63/1M"
38
+ },
39
+ "context": "400K",
40
+ "maxOutputTokens": 128000,
41
+ "modality": "text+image->text",
42
+ "supportsTools": true,
43
+ "supportsReasoning": true,
44
+ "supportsVision": true,
45
+ "isModerated": true,
46
+ "recommended": true
47
+ },
48
+ {
49
+ "id": "moonshotai/kimi-k2-thinking",
50
+ "name": "MoonshotAI: Kimi K2 Thinking",
51
+ "description": "Kimi K2 Thinking is Moonshot AI’s most advanced open reasoning model to date, extending the K2 series into agentic, long-horizon reasoning. Built on the trillion-parameter Mixture-of-Experts (MoE) architecture introduced in Kimi K2, it activates 32 billion parameters per forward pass and supports 256 k-token context windows. The model is optimized for persistent step-by-step thought, dynamic tool invocation, and complex reasoning workflows that span hundreds of turns. It interleaves step-by-step reasoning with tool use, enabling autonomous research, coding, and writing that can persist for hundreds of sequential actions without drift.\n\nIt sets new open-source benchmarks on HLE, BrowseComp, SWE-Multilingual, and LiveCodeBench, while maintaining stable multi-agent behavior through 200–300 tool calls. Built on a large-scale MoE architecture with MuonClip optimization, it combines strong reasoning depth with high inference efficiency for demanding agentic and analytical tasks.",
52
+ "provider": "Moonshotai",
53
+ "category": "reasoning",
54
+ "priority": 3,
55
+ "pricing": {
56
+ "input": "$0.50/1M",
57
+ "output": "$2.50/1M",
58
+ "average": "$1.50/1M"
59
+ },
60
+ "context": "262K",
61
+ "maxOutputTokens": 262144,
62
+ "modality": "text->text",
63
+ "supportsTools": true,
64
+ "supportsReasoning": true,
65
+ "supportsVision": false,
66
+ "isModerated": false,
67
+ "recommended": true
68
+ },
27
69
  {
28
70
  "id": "google/gemini-2.5-flash",
29
71
  "name": "Google: Gemini 2.5 Flash",
30
72
  "description": "Gemini 2.5 Flash is Google's state-of-the-art workhorse model, specifically designed for advanced reasoning, coding, mathematics, and scientific tasks. It includes built-in \"thinking\" capabilities, enabling it to provide responses with greater accuracy and nuanced context handling. \n\nAdditionally, Gemini 2.5 Flash is configurable through the \"max tokens for reasoning\" parameter, as described in the documentation (https://openrouter.ai/docs/use-cases/reasoning-tokens#max-tokens-for-reasoning).",
31
73
  "provider": "Google",
32
74
  "category": "reasoning",
33
- "priority": 2,
75
+ "priority": 4,
34
76
  "pricing": {
35
77
  "input": "$0.30/1M",
36
78
  "output": "$2.50/1M",
@@ -51,7 +93,7 @@
51
93
  "description": "MiniMax-M2 is a compact, high-efficiency large language model optimized for end-to-end coding and agentic workflows. With 10 billion activated parameters (230 billion total), it delivers near-frontier intelligence across general reasoning, tool use, and multi-step task execution while maintaining low latency and deployment efficiency.\n\nThe model excels in code generation, multi-file editing, compile-run-fix loops, and test-validated repair, showing strong results on SWE-Bench Verified, Multi-SWE-Bench, and Terminal-Bench. It also performs competitively in agentic evaluations such as BrowseComp and GAIA, effectively handling long-horizon planning, retrieval, and recovery from execution errors.\n\nBenchmarked by [Artificial Analysis](https://artificialanalysis.ai/models/minimax-m2), MiniMax-M2 ranks among the top open-source models for composite intelligence, spanning mathematics, science, and instruction-following. Its small activation footprint enables fast inference, high concurrency, and improved unit economics, making it well-suited for large-scale agents, developer assistants, and reasoning-driven applications that require responsiveness and cost efficiency.\n\nTo avoid degrading this model's performance, MiniMax highly recommends preserving reasoning between turns. Learn more about using reasoning_details to pass back reasoning in our [docs](https://openrouter.ai/docs/use-cases/reasoning-tokens#preserving-reasoning-blocks).",
52
94
  "provider": "Minimax",
53
95
  "category": "reasoning",
54
- "priority": 3,
96
+ "priority": 5,
55
97
  "pricing": {
56
98
  "input": "$0.26/1M",
57
99
  "output": "$1.02/1M",
@@ -72,7 +114,7 @@
72
114
  "description": "Compared with GLM-4.5, this generation brings several key improvements:\n\nLonger context window: The context window has been expanded from 128K to 200K tokens, enabling the model to handle more complex agentic tasks.\nSuperior coding performance: The model achieves higher scores on code benchmarks and demonstrates better real-world performance in applications such as Claude Code、Cline、Roo Code and Kilo Code, including improvements in generating visually polished front-end pages.\nAdvanced reasoning: GLM-4.6 shows a clear improvement in reasoning performance and supports tool use during inference, leading to stronger overall capability.\nMore capable agents: GLM-4.6 exhibits stronger performance in tool using and search-based agents, and integrates more effectively within agent frameworks.\nRefined writing: Better aligns with human preferences in style and readability, and performs more naturally in role-playing scenarios.",
73
115
  "provider": "Z-ai",
74
116
  "category": "reasoning",
75
- "priority": 4,
117
+ "priority": 6,
76
118
  "pricing": {
77
119
  "input": "$0.40/1M",
78
120
  "output": "$1.75/1M",
@@ -93,7 +135,7 @@
93
135
  "description": "GPT-5 is OpenAI’s most advanced model, offering major improvements in reasoning, code quality, and user experience. It is optimized for complex tasks that require step-by-step reasoning, instruction following, and accuracy in high-stakes use cases. It supports test-time routing features and advanced prompt understanding, including user-specified intent like \"think hard about this.\" Improvements include reductions in hallucination, sycophancy, and better performance in coding, writing, and health-related tasks.",
94
136
  "provider": "Openai",
95
137
  "category": "reasoning",
96
- "priority": 5,
138
+ "priority": 7,
97
139
  "pricing": {
98
140
  "input": "$1.25/1M",
99
141
  "output": "$10.00/1M",
@@ -108,13 +150,34 @@
108
150
  "isModerated": true,
109
151
  "recommended": true
110
152
  },
153
+ {
154
+ "id": "google/gemini-3-pro-preview",
155
+ "name": "Google: Gemini 3 Pro Preview",
156
+ "description": "Gemini 3 Pro is Google’s flagship frontier model for high-precision multimodal reasoning, combining strong performance across text, image, video, audio, and code with a 1M-token context window. Reasoning Details must be preserved when using multi-turn tool calling, see our docs here: https://openrouter.ai/docs/use-cases/reasoning-tokens#preserving-reasoning-blocks. It delivers state-of-the-art benchmark results in general reasoning, STEM problem solving, factual QA, and multimodal understanding, including leading scores on LMArena, GPQA Diamond, MathArena Apex, MMMU-Pro, and Video-MMMU. Interactions emphasize depth and interpretability: the model is designed to infer intent with minimal prompting and produce direct, insight-focused responses.\n\nBuilt for advanced development and agentic workflows, Gemini 3 Pro provides robust tool-calling, long-horizon planning stability, and strong zero-shot generation for complex UI, visualization, and coding tasks. It excels at agentic coding (SWE-Bench Verified, Terminal-Bench 2.0), multimodal analysis, and structured long-form tasks such as research synthesis, planning, and interactive learning experiences. Suitable applications include autonomous agents, coding assistants, multimodal analytics, scientific reasoning, and high-context information processing.",
157
+ "provider": "Google",
158
+ "category": "vision",
159
+ "priority": 8,
160
+ "pricing": {
161
+ "input": "$2.00/1M",
162
+ "output": "$12.00/1M",
163
+ "average": "$7.00/1M"
164
+ },
165
+ "context": "1048K",
166
+ "maxOutputTokens": 65536,
167
+ "modality": "text+image->text",
168
+ "supportsTools": true,
169
+ "supportsReasoning": true,
170
+ "supportsVision": true,
171
+ "isModerated": false,
172
+ "recommended": true
173
+ },
111
174
  {
112
175
  "id": "qwen/qwen3-vl-235b-a22b-instruct",
113
176
  "name": "Qwen: Qwen3 VL 235B A22B Instruct",
114
177
  "description": "Qwen3-VL-235B-A22B Instruct is an open-weight multimodal model that unifies strong text generation with visual understanding across images and video. The Instruct model targets general vision-language use (VQA, document parsing, chart/table extraction, multilingual OCR). The series emphasizes robust perception (recognition of diverse real-world and synthetic categories), spatial understanding (2D/3D grounding), and long-form visual comprehension, with competitive results on public multimodal benchmarks for both perception and reasoning.\n\nBeyond analysis, Qwen3-VL supports agentic interaction and tool use: it can follow complex instructions over multi-image, multi-turn dialogues; align text to video timelines for precise temporal queries; and operate GUI elements for automation tasks. The models also enable visual coding workflows—turning sketches or mockups into code and assisting with UI debugging—while maintaining strong text-only performance comparable to the flagship Qwen3 language models. This makes Qwen3-VL suitable for production scenarios spanning document AI, multilingual OCR, software/UI assistance, spatial/embodied tasks, and research on vision-language agents.",
115
178
  "provider": "Qwen",
116
179
  "category": "vision",
117
- "priority": 6,
180
+ "priority": 9,
118
181
  "pricing": {
119
182
  "input": "$0.21/1M",
120
183
  "output": "$1.90/1M",
@@ -135,7 +198,7 @@
135
198
  "description": "openrouter/polaris-alpha (metadata pending - not yet available in API)",
136
199
  "provider": "Openrouter",
137
200
  "category": "programming",
138
- "priority": 7,
201
+ "priority": 10,
139
202
  "pricing": {
140
203
  "input": "N/A",
141
204
  "output": "N/A",
File without changes
@@ -282,6 +282,54 @@ claudish --list-models
282
282
  claudish --list-models --force-update
283
283
  ```
284
284
 
285
+ ## NEW: Direct Agent Selection (v2.1.0)
286
+
287
+ **Use `--agent` flag to invoke agents directly without the file-based pattern:**
288
+
289
+ ```bash
290
+ # Use specific agent (prepends @agent- automatically)
291
+ claudish --model x-ai/grok-code-fast-1 --agent frontend:developer "implement React component"
292
+
293
+ # Claude receives: "Use the @agent-frontend:developer agent to: implement React component"
294
+
295
+ # List available agents in project
296
+ claudish --list-agents
297
+ ```
298
+
299
+ **When to use `--agent` vs file-based pattern:**
300
+
301
+ **Use `--agent` when:**
302
+ - Single, simple task that needs agent specialization
303
+ - Direct conversation with one agent
304
+ - Testing agent behavior
305
+ - CLI convenience
306
+
307
+ **Use file-based pattern when:**
308
+ - Complex multi-step workflows
309
+ - Multiple agents needed
310
+ - Large codebases
311
+ - Production tasks requiring review
312
+ - Need isolation from main conversation
313
+
314
+ **Example comparisons:**
315
+
316
+ **Simple task (use `--agent`):**
317
+ ```bash
318
+ claudish --model x-ai/grok-code-fast-1 --agent frontend:developer "create button component"
319
+ ```
320
+
321
+ **Complex task (use file-based):**
322
+ ```typescript
323
+ // multi-phase-workflow.md
324
+ Phase 1: Use api-architect to design API
325
+ Phase 2: Use backend-developer to implement
326
+ Phase 3: Use test-architect to add tests
327
+ Phase 4: Use senior-code-reviewer to review
328
+
329
+ then:
330
+ claudish --model x-ai/grok-code-fast-1 --stdin < multi-phase-workflow.md
331
+ ```
332
+
285
333
  ## Best Practice: File-Based Sub-Agent Pattern
286
334
 
287
335
  ### ⚠️ CRITICAL: Don't Run Claudish Directly from Main Conversation
@@ -938,6 +986,110 @@ const { stdout } = await Bash("claudish --list-models --json");
938
986
  const models = JSON.parse(stdout).models.map(m => m.id);
939
987
  ```
940
988
 
989
+ ### ✅ Do Accept Custom Models From Users
990
+
991
+ **Problem:** User provides a custom model ID that's not in --list-models
992
+
993
+ **Wrong (rejecting custom models):**
994
+ ```typescript
995
+ const availableModels = ["x-ai/grok-code-fast-1", "openai/gpt-5"];
996
+ const userModel = "custom/provider/model-123";
997
+
998
+ if (!availableModels.includes(userModel)) {
999
+ throw new Error("Model not in my shortlist"); // ❌ DON'T DO THIS
1000
+ }
1001
+ ```
1002
+
1003
+ **Right (accept any valid model ID):**
1004
+ ```typescript
1005
+ // Claudish accepts ANY valid OpenRouter model ID, even if not in --list-models
1006
+ const userModel = "custom/provider/model-123";
1007
+
1008
+ // Validate it's a non-empty string with provider format
1009
+ if (!userModel.includes("/")) {
1010
+ console.warn("Model should be in format: provider/model-name");
1011
+ }
1012
+
1013
+ // Use it directly - Claudish will validate with OpenRouter
1014
+ await Bash(`claudish --model ${userModel} "task"`);
1015
+ ```
1016
+
1017
+ **Why:** Users may have access to:
1018
+ - Beta/experimental models
1019
+ - Private/custom fine-tuned models
1020
+ - Newly released models not yet in rankings
1021
+ - Regional/enterprise models
1022
+ - Cost-saving alternatives
1023
+
1024
+ **Always accept user-provided model IDs** unless they're clearly invalid (empty, wrong format).
1025
+
1026
+ ### ✅ Do Handle User-Preferred Models
1027
+
1028
+ **Scenario:** User says "use my custom model X" and expects it to be remembered
1029
+
1030
+ **Solution 1: Environment Variable (Recommended)**
1031
+ ```typescript
1032
+ // Set for the session
1033
+ process.env.CLAUDISH_MODEL = userPreferredModel;
1034
+
1035
+ // Or set permanently in user's shell profile
1036
+ await Bash(`echo 'export CLAUDISH_MODEL="${userPreferredModel}"' >> ~/.zshrc`);
1037
+ ```
1038
+
1039
+ **Solution 2: Session Cache**
1040
+ ```typescript
1041
+ // Store in a temporary session file
1042
+ const sessionFile = "/tmp/claudish-user-preferences.json";
1043
+ const prefs = {
1044
+ preferredModel: userPreferredModel,
1045
+ lastUsed: new Date().toISOString()
1046
+ };
1047
+ await Write({ file_path: sessionFile, content: JSON.stringify(prefs, null, 2) });
1048
+
1049
+ // Load in subsequent commands
1050
+ const { stdout } = await Read({ file_path: sessionFile });
1051
+ const prefs = JSON.parse(stdout);
1052
+ const model = prefs.preferredModel || defaultModel;
1053
+ ```
1054
+
1055
+ **Solution 3: Prompt Once, Remember for Session**
1056
+ ```typescript
1057
+ // In a multi-step workflow, ask once
1058
+ if (!process.env.CLAUDISH_MODEL) {
1059
+ const { stdout } = await Bash("claudish --list-models --json");
1060
+ const models = JSON.parse(stdout).models;
1061
+
1062
+ const response = await AskUserQuestion({
1063
+ question: "Select model (or enter custom model ID):",
1064
+ options: models.map((m, i) => ({ label: m.name, value: m.id })).concat([
1065
+ { label: "Enter custom model...", value: "custom" }
1066
+ ])
1067
+ });
1068
+
1069
+ if (response === "custom") {
1070
+ const customModel = await AskUserQuestion({
1071
+ question: "Enter OpenRouter model ID (format: provider/model):"
1072
+ });
1073
+ process.env.CLAUDISH_MODEL = customModel;
1074
+ } else {
1075
+ process.env.CLAUDISH_MODEL = response;
1076
+ }
1077
+ }
1078
+
1079
+ // Use the selected model for all subsequent calls
1080
+ const model = process.env.CLAUDISH_MODEL;
1081
+ await Bash(`claudish --model ${model} "task 1"`);
1082
+ await Bash(`claudish --model ${model} "task 2"`);
1083
+ ```
1084
+
1085
+ **Guidance for Agents:**
1086
+ 1. ✅ **Accept any model ID** user provides (unless obviously malformed)
1087
+ 2. ✅ **Don't filter** based on your "shortlist" - let Claudish handle validation
1088
+ 3. ✅ **Offer to set CLAUDISH_MODEL** environment variable for session persistence
1089
+ 4. ✅ **Explain** that --list-models shows curated recommendations, not all possibilities
1090
+ 5. ✅ **Validate format** (should contain "/") but not restrict to known models
1091
+ 6. ❌ **Never reject** a user's custom model with "not in my shortlist"
1092
+
941
1093
  ### ❌ Don't Skip Error Handling
942
1094
 
943
1095
  **Wrong:**