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

Product Updates — 2026-08-02
Public
Aug 2, 2026

Product Updates — 2026-08-02

A major Inbox upgrade: auto-translation, full conversation management, and intent ratings — plus smarter automated follow-ups and a daily business briefing.

Public
Jul 27, 2026

Product Updates — 2026-07-27

Auto-switch interface and content language based on tenant’s onboarded language, improving experience for multilingual teams

Public
Jul 23, 2026

90-Day Burnout Cost Analysis: Why Human SDRs Cost 3x More Than PulseAgent for B2B Export Sales

Human SDRs cost $48,000+ in 90 days vs. PulseAgent AI at $299/month. 70% RFQ failure, 15% error rates, 60% outdated contacts—see the data.

Public
Jul 22, 2026

Real-Time FOB/CIF Pricing with Validity Dates for Exporters

Real-time FOB/CIF pricing with validity dates helps cross-border exporters avoid costly errors by automatically annotating quotes with a clear expiration, reducing negotiation friction and building buyer trust.

Public
Jul 22, 2026

WhatsApp & Email Follow-Up Agent for B2B Traders

WhatsApp & Email follow‑up agent automates lead capture after hours, reduces response friction, and increases conversion rates for B2B vehicle traders sourcing from China.

Public
Jul 22, 2026

Trade Document Pre-Validation: Stop Costly Export Errors

Trade document pre-validation prevents costly export failures by catching HS code errors on EUR1 and B/L before quoting, saving exporters up to 40% rework time.

Public
Jul 13, 2026

Real-Time FOB/CIF Pricing with Expiry Dates for B2B Traders

Get real-time FOB/CIF pricing with expiry dates for B2B machinery traders; avoid outdated quotes that erode margins. AutoGlobalAI updates prices live from steel and freight indices.

Public
Jul 13, 2026

WhatsApp & Email Follow-Up Agent for B2B Sales

WhatsApp and email follow-up agent for B2B sales teams automates replies within 24 hours, reduces manual chasing, and re-engages cold leads from Excel pipelines. See 80% less follow-up time.

Public
Jul 13, 2026

Trade-Document Pre-Validation: Stop Quote Rework Before It Starts

Trade-document pre-validation catches certificate, EUR.1, and bill of lading errors before quoting, reducing rework by 40% for export sales teams.

Public
Jul 9, 2026

WhatsApp + Email Follow-Up Agent for Cross-Border B2B Sellers

Cross-border B2B sellers use a WhatsApp and email follow-up agent to reply within 24 hours on the buyer’s preferred channel, increasing conversion by 35%.