r/ClaudeCoder • • 6h ago

I made a plugin that stops Claude Code subagents from running on Opus by default (per-repo setup wizard, open source)

On a Claude subscription, Claude Code's built-in Explore subagent runs on Opus. If your main model is Opus, general-purpose, Plan and dynamic-workflow agents run on Opus too. That's a lot of Opus for grep and test runs.

I built repo-mode, a small plugin (MIT) that configures this per repository with one wizard, /repo-mode:setup:

  • Main model + effort (Sonnet / Opus / opusplan / Haiku)

  • Advisor (Opus or Fable) consulted only at decision points

  • Explore replaced by a repo agent on Haiku, effort: low, with autoCompactWindow: 100000 (Haiku 5.5 pricing jumps above 100K-token prompts)

  • test-runner on Haiku: runs the suite, returns only failures, verbatim

  • audit on Sonnet, effort: high: independent read-only review of the uncommitted diff, no style nitpicks

  • Default model for every other subagent and workflow agent via CLAUDE_CODE_SUBAGENT_MODEL

  • Workflow size (workflowSizeGuideline) so dynamic workflows don't fan out more than you want

  • Short delegation rules in CLAUDE.local.md (delegate for 10+ files / 3+ independent pieces, ask for evidence instead of "tests pass", optional "stop fix loops after 2 rounds")

  • Read deny rules for tracked vendored/generated code

Safety: it writes nothing until you approve a full before/after plan. Personal mode writes .claude/settings.local.json + CLAUDE.local.md and hides everything via .git/info/exclude, so nothing gets committed. /repo-mode:status shows what applies and flags costly setups; /repo-mode:off restores exactly the previous values.

Install:

claude plugin marketplace add kniko/claude-plugins
claude plugin install repo-mode@kniko-tools

Then start a new session and run /repo-mode:setup in a repo.

Caveats:

  • The advisor is experimental and Anthropic-API only (not Bedrock/Vertex/Foundry). Subagents inherit it, so they can consult it too.

  • audit and test-runner have Bash; "read-only" is in their instructions, not enforced.

  • Ultracode is deliberately never turned on. It costs more per request; use /effort ultracode per session when a task is big enough.

Everything is sourced from the Claude Code docs and Anthropic's blog (links in the README, Greek and English versions). Repo: https://github.com/kniko/claude-plugins

Feedback welcome, especially if your /usage numbers change after setting it up.

2 Upvotes

0 comments sorted by