Skip to content

feat: add per-phase Claude model configuration (claude_model + review_model)#272

Open
dwilberger wants to merge 1 commit intoumputun:masterfrom
dwilberger:feat/claude-model-config
Open

feat: add per-phase Claude model configuration (claude_model + review_model)#272
dwilberger wants to merge 1 commit intoumputun:masterfrom
dwilberger:feat/claude-model-config

Conversation

@dwilberger
Copy link
Copy Markdown

Summary

  • Add claude_model and review_model config parameters to control which Claude model is used for task execution vs review phases
  • Add --claude-model and --review-model CLI flags with standard precedence (CLI > local config > global config > default)
  • Create separate review executor when review_model differs from claude_model, used by all review phases (first review, fix loops, codex eval, finalize)
  • Empty values preserve current behavior (no --model flag passed to Claude CLI)

Motivation

Review phases run 5-7 parallel Claude agents that can iterate multiple times. Using the same model (e.g., Opus) for both tasks and reviews is unnecessarily expensive. This change allows using a capable model for tasks while using a faster/cheaper model for reviews.

Usage

# in ~/.config/ralphex/config
claude_model = opus
review_model = sonnet
# or via CLI flags
ralphex --claude-model opus --review-model sonnet docs/plans/sprint-1.md

Test plan

  • Config parsing tests: claude_model and review_model parsed from INI
  • Merge logic tests: local overrides global, empty preserves existing
  • Executor test: --model flag injected when Model is set, absent when empty
  • Full build: go build ./... passes
  • Full test suite: all pre-existing tests pass (failures are pre-existing Docker/permission issues)
  • No secrets or env values in diff

Closes #271

Add claude_model and review_model config parameters to control which
Claude model is used for task execution vs review phases. This allows
using a more capable model (e.g., opus) for tasks while using a faster
model (e.g., sonnet) for review iterations, reducing cost on
review-heavy runs.

- Add Model field to ClaudeExecutor, injecting --model flag when set
- Create separate review executor when review_model differs
- Add --claude-model and --review-model CLI flags
- Empty values preserve current behavior (no --model flag)

Closes umputun#271
@dwilberger dwilberger requested a review from umputun as a code owner April 5, 2026 20:15
Copy link
Copy Markdown
Owner

@umputun umputun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice feature, thx. couple things to address:

  1. naming - claude_model is misleading, it only applies to task/planning phases, not to claude globally. task_model would be more accurate and symmetric with review_model. same for the CLI flag - --task-model / --review-model reads better than --claude-model / --review-model
  2. config comment typo - pkg/config/defaults/config:33 says # claude_model = but should be # review_model =
  3. custom wrappers - --model flag is silently ignored by custom providers (claude_command config). not a bug, but worth documenting that model config only applies with the default Claude CLI
  4. missing processor test - the ReviewClaude executor separation logic in runner.go has no test coverage. existing tests only exercise the fallback path (ReviewClaude: nil). a test with distinct task/review mock executors verifying the review phase calls the right one would close this gap
  5. no docs update - README, CLAUDE.md, and llms.txt document all config options but don't mention the new fields or CLI flags

the approach itself is clean - separate executor only when models differ, correct config merge chain, backward compatible. no scope creep, tests pass, linter clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: per-phase Claude model configuration (claude_model + review_model)

2 participants