Claude Advisor Pattern: Let Sonnet Execute While Opus Thinks

April 10, 2026
Open-source implementation of the advisor pattern for Claude API. Sonnet handles execution, Opus provides strategic guidance via custom tool orchestration — 80% cheaper than running everything on Opus.
Claude Advisor Pattern: Let Sonnet Execute While Opus Thinks

The Problem

Claude Opus is brilliant but expensive. Claude Sonnet is fast and cheap but sometimes needs a second opinion on strategic decisions. What if Sonnet could ask Opus for advice — but only when it actually needs it?

The Advisor Pattern

We built an open-source implementation where Sonnet (the executor) has a tool called ask_advisor. During task execution, Sonnet autonomously decides when to consult Opus (the advisor) — and has a budget of N calls to use wisely.

from advisor import AdvisorClient

client = AdvisorClient() result = client.run( "Design a 3-shot video storyboard for a product ad", executor="claude-sonnet-4-6", advisor="claude-opus-4-6", max_advisor_calls=3, ) print(result.text) # Opus-informed output at Sonnet prices

How It Works

The pattern uses standard Claude API custom tools — no special features needed:

  1. Define an ask_advisor tool with question + context schema
  2. Sonnet receives the task and decides if it needs advice
  3. When Sonnet calls ask_advisor, we intercept and call Opus
  4. Opus's response is fed back as a tool_result
  5. Sonnet incorporates the advice and continues execution

Real-World Example: Video Production

We integrated this into our AI Video Studio skill. When you ask it to create a video storyboard:

python3 studio.py storyboard 
--idea "Product ad for a flatbed semi-trailer"
--shots 3 --duration 5 --lang zh

Sonnet asks Opus: "What creative direction for a heavy machinery ad?"

Opus advises: "Use contrast — industrial power against epic landscape. Low angle for dominance, aerial for scale. The product should look like it belongs in the scene, not placed."

Sonnet then generates a production-ready JSON storyboard with detailed Seedance prompts, Chinese captions, and narration text — all informed by Opus's creative direction.

Cost Comparison

ApproachCost (typical task)Quality
Everything on Opus$$$Excellent
Everything on Sonnet$Good
Advisor Pattern$$ (80% cheaper than Opus-only)Excellent on decisions, Good on execution

When Sonnet Consults Opus

The beauty is that Sonnet decides autonomously:

  • Creative direction → asks advisor
  • Trade-off decisions → asks advisor
  • Quality review → asks advisor
  • Routine execution → proceeds alone

Get Started

pip install anthropic
export ANTHROPIC_API_KEY="sk-ant-..."

Standalone

git clone https://github.com/iPythoning/claude-advisor-pattern python advisor.py "Your complex task here" --max-calls 3

With AI Video Studio

git clone https://github.com/iPythoning/ai-video-studio python studio.py storyboard --idea "Your video concept" --shots 3

Repos:

Built with Claude API · OpenClaw

Related Posts

Public
Oct 23, 2026

Why AI SDR Cold Outreach Loses Approval Context (And How to Keep It)

Cold outreach stalls when the AI SDR cannot see who approved the message, what the buyer already said, or which reply is safe. Keep approval, thread context, and human gates in one workflow before you scale volume.

Public
Oct 23, 2026

How to Keep WhatsApp + Human Review in an AI SDR Workflow

Pause AI on one WhatsApp thread, let a human reply from the same number, write the decision back, then resume. Here is a review checklist, a handoff flow, and the rules that keep buyers from repeating themselves.

Public
Oct 16, 2026

ClashBox HarmonyOS Tutorial: How to Install Clash on HarmonyOS NEXT via Overseas AppGallery or Signed Sideloading (with Screenshots)

Learn how to install ClashBox on HarmonyOS NEXT via overseas AppGallery or signed HAP sideloading, then import subscriptions, enable VPN, and keep it running.

Public
Oct 16, 2026

v2rayN for Windows Tutorial: Download, Installation, Proxy Subscription Import, and Routing Setup (with Screenshots)

Step-by-step v2rayN guide for Windows, covering secure downloads, subscription imports, node testing, system proxy and routing, updates, and fixes.

Public
Oct 16, 2026

PassWall 2 OpenWrt Router Tutorial: Install the Plugin, Import a Proxy Subscription, and Connect Every Device | Airport Chinese (Screenshots Included)

Install PassWall 2 on OpenWrt, import a proxy-provider subscription, test nodes, configure split routing, and troubleshoot connectivity across your home network.

Public
Oct 16, 2026

Clash Verge Rev Guide for Windows/macOS/Linux: Download, Installation, Subscription Import, and Proxy Chaining

A complete Clash Verge Rev guide for Windows, macOS, and Linux, covering installation, subscription import, proxy modes, node selection, TUN, and proxy chaining.

Public
Oct 16, 2026

OpenClash on an OpenWrt Router: Install OpenClash, Import a Proxy Subscription, and Connect Every Device at Home | 机场中文网 (with Screenshots)

Install OpenClash on an OpenWrt router, add a Clash subscription, choose modes and nodes, verify whole-home proxying, and troubleshoot common setup issues.

Public
Oct 16, 2026

ClashMi Windows Tutorial: Using the Portable Version and Importing a Subscription (With Screenshots)

A step-by-step guide to running portable ClashMi on Windows, handling SmartScreen, importing a proxy subscription, connecting, updating profiles, and switching nodes.

Public
Oct 16, 2026

FlClash for Windows Tutorial: Download and Install the Desktop App, Import a Proxy Subscription, and Enable the Proxy | Chinese Proxy Service Guide (Screenshots Included)

A step-by-step guide to installing FlClash on Windows, importing a proxy subscription, choosing a node, enabling proxying, and fixing connection issues.

Public
Oct 16, 2026

Clash Party for Windows Tutorial: How to Use Clash Party (With Screenshots)

Step-by-step Windows guide to installing Clash Party, importing a Clash subscription, choosing nodes, enabling the system proxy, and setting updates and startup.