#3527·ruflo

init: every `ruflo init` pins "model": "claude-sonnet-5" in .claude/settings.json, overriding the user's own model (the repo's own settings.json does too)

Author: HF-teamdevCreated Sep 28, 2026Updated Sep 28, 2026

@ruvnet @proffesor-for-testing

Summary

Since v3.32.1, every fresh ruflo init (and every init --force) writes "model": "claude-sonnet-5" into the project's .claude/settings.json. Claude Code ranks shared project settings above the user's own ~/.claude/settings.json (settings precedence), so in every ruflo-initialised project the pin silently replaces whatever model the user chose, such as opus, opus[1m] or a newer Sonnet. The ruflo repo's own .claude/settings.json has the same pin, so every clone and worktree of ruflo starts Claude Code on Sonnet 5 as well.

The pin is also stale now. 3e9122a31 set it to "the latest Claude 5" in July; with Sonnet 5.5 and Opus 5.5 out, a hard-coded "latest" falls behind at every release.

Environment

ruflo 3.47.1 and @claude-flow/cli 3.47.1 (npm latest), Claude Code 2.1.284, macOS arm64, Node 24.15.0. Upstream main at b636802d8 still has both pins.

Steps to reproduce

Hermetic: a throwaway HOME, and a codex stub so init doesn't probe a real Codex.

bash
T=$(mktemp -d); mkdir -p "$T/home/bin" "$T/proj"
printf '#!/bin/sh\nexit 1\n' > "$T/home/bin/codex"; chmod +x "$T/home/bin/codex"
npm i -g --prefix "$T/prefix" [email protected] --no-fund --no-audit >/dev/null
cd "$T/proj" && HOME="$T/home" CODEX_HOME="$T/home/.codex" PATH="$T/home/bin:$PATH" \
  "$T/prefix/bin/ruflo" init --force --no-codex-detect --no-skills-sh >/dev/null
jq .model .claude/settings.json

Expected vs actual

  • Actual: "claude-sonnet-5"
  • Expected: null (no model key), so Claude Code uses the user's own setting, or its own default if they have none.

With "model": "opus" in ~/.claude/settings.json, Claude Code started in that project therefore runs Sonnet 5. The docs also note that ANTHROPIC_DEFAULT_MODEL "applies only when no file sets model", so the pin disables that variable in these projects too.

Root cause

  • settings-generator.ts#L62-L64 assigns settings.model = 'claude-sonnet-5' unconditionally in generateSettings().
  • History: when the file was written (6a356ffe6, 2026-01-05) this line set an object, and three days later (5d1dc2b74) it became a commented-out suggestion, // settings.model = 'claude-sonnet-4-20250514'; // Uncomment if you want to set a default model. 3e9122a31 ("feat(routing): default to latest Claude 5/4.x models in tier map + init template", 2026-07-15, first released in v3.32.1) turned it into a live assignment while updating the tier map, and that made the optional default mandatory for every project.
  • The same commit pinned the repo's own .claude/settings.json#L2.
  • writeSettings() in executor.ts#L896-L960 writes model only on a fresh init, --force, or over a corrupt file; merge mode copies hooks, env and permissions only. Projects initialised since v3.32.1 therefore keep their pin until the user deletes it.

Impact

  • Every project ruflo init-ed since v3.32.1 (2026-07-15): Claude Code starts on claude-sonnet-5 whatever the user picked. A Max user whose default is opus gets Sonnet in ruflo projects without being told.
  • Everyone working in the ruflo repo itself, in every clone and worktree.
  • ANTHROPIC_DEFAULT_MODEL stops working in those projects.
  • Ruflo's own routing is not affected: claudeFlow.modelPreferences (#L87-L90) is a ruflo-only key that Claude Code doesn't read.

Proposed fix

Remove both pins and leave claudeFlow.modelPreferences alone. PR to follow.

How it was found

Auditing Claude model references after Sonnet 5.5's release: the ruflo repo's own .claude/settings.json, and every ruflo worktree on my machine, pinned claude-sonnet-5 over my user-level opus[1m].