Skip to content

Enabling to pass --model and --effort when run ./ralph#148

Open
ygorpinto wants to merge 1 commit intosnarktank:mainfrom
ygorpinto:feat/enable-pass-model-and-effort-to-sh
Open

Enabling to pass --model and --effort when run ./ralph#148
ygorpinto wants to merge 1 commit intosnarktank:mainfrom
ygorpinto:feat/enable-pass-model-and-effort-to-sh

Conversation

@ygorpinto
Copy link
Copy Markdown

Summary

Extends ralph.sh with two optional passthrough flags for the claude CLI, letting users pick the
model and reasoning effort per run without editing the script or relying on environment variables.

Changes

  • New --model : forwards to claude --model. Accepts aliases (sonnet, opus, haiku) or full
    model IDs (e.g. claude-sonnet-4-6). Empty = CLI default.
  • New --effort : forwards to claude --effort. Validated against low|medium|high|xhigh|max
    with a clear error if the value is off. Empty = CLI default.
  • Both flags support --flag value and --flag=value forms, consistent with the existing --tool
    flag.
  • Startup banner and per-iteration header now echo the active model/effort so runs are auditable
    from the log.
  • No behavior change when flags are omitted — fully backwards compatible with existing
    invocations.

Usage

default (unchanged)

./ralph.sh --tool claude 20

pick a model

./ralph.sh --tool claude --model sonnet 20

pick model + effort

./ralph.sh --tool claude --model opus --effort high 20

effort only

./ralph.sh --tool claude --effort max 20

Motivation

When running long multi-iteration loops, the right model and effort level vary by task complexity
and cost budget. Hard-coding them in the script or juggling env vars made it awkward to tune. A
flag makes experimentation trivial and keeps the invocation self-documenting in shell history.

Testing

  • bash -n ralph.sh passes.
  • Manually verified invalid effort values are rejected with a helpful message.
  • Ran the script with --tool claude --model sonnet --effort high and confirmed the flags reach the
    underlying claude command.
  • Omitting both flags preserves previous behavior.

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.

1 participant