Anthropic has a native solution to this which is that you can use `/advisor` to adjust config to enable using Sonnet but set Opus as an advisor or use Haiku and then set Sonnet or Opus as advisor that the weaker model will automatically call when it thinks something warrants it:
https://code.claude.com/docs/en/advisor
It allegedly will automatically judge when to call the stronger model, not sure how much instructions in prompts or AGENTS.md can steer it.
The "oh my pi" (omp) harness has this also.